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] |
The problem here is that if the inline-asm constraint allows memory and we have an INDIRECT_REF, we don't check if the register of that variable is the clobber list. We ICE because later on, we see that the register is in the clobber and in an output register of the inline-asm. The way to fix is to skip passed the INDIRECT_REF when checking if the variable is a global register and is in the clobber list.
Thanks, Andrew Pinski
* stmt.c (expand_asm_operands): Skip passed INDIRECT_REF if the constraint allows memory right before checking against the conflicts.
Attachment:
fix.diff.txt
Description: Text document
#if defined (__alpha__) # define REG "$1" #elif defined (__CRIS__) # define REG "r10" #elif defined (__i386__) # define REG "%eax" #elif defined (__MMIX__) # define REG "$8" #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \ || defined (__POWERPC__) || defined (PPC) || defined (_IBMR2) # define REG "6" #elif defined (__x86_64__) # define REG "rax" #endif
void bug(void) { register char* dst __asm (REG); __asm__ ("%0":"=g"(*dst): : REG); /* { dg-error "conflict" } */ }
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |