This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR target/8340


Aloha,

Thank you for working on this PR...  Another issue to consider:
If inline asm doesn't use the PIC register to access global variables,
is it allowed to clobber the register?  e.g.

int foo ()
{
  int a;

  __asm__ __volatile__ (
    "xorl %%ebx, %%ebx\n"
    "movl %%ebx, %0\n"
    : "=3Dm" (a)
    :
    : "%ebx"
  );

  return a;
}

Previously, the above code would not cause an ICE, but failed to
preserve the %ebx register...  This problem was reported by someone else
in PR c/8546.  With your patch, the above code produces an error.

- glen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]