[forwarded from http://bugs.debian.org/390694] 4.1 SVN 20060920, works with 4.2 and 4.0.4 $ gcc -c -fPIC -g -O2 -g tree234.i tree234.c: In function 'delpos234_internal': tree234.c:927: fatal error: internal consistency failure compilation terminated. compilation works with -O1 compilation with -O0: $ gcc -c -fPIC -g -O0 -g tree234.i /tmp/cco6vA7j.s: Assembler messages: /tmp/cco6vA7j.s:172: Error: Rn must not overlap other operands -- `swpb r3,r2,[r3]' Matthias
Created attachment 12376 [details] preprocessed source
(In reply to comment #0) > compilation with -O0: > > $ gcc -c -fPIC -g -O0 -g tree234.i > /tmp/cco6vA7j.s: Assembler messages: > /tmp/cco6vA7j.s:172: Error: Rn must not overlap other operands -- `swpb > r3,r2,[r3]' That is a bug in the source: asm volatile( "# here \n\t" "swpb %0, %1, [%2] \n\t" : "=r" (val) : "r"(1), "r" (lock) : "memory" ); I don't know how to fix that in the inline-asm. Maybe an early clobber can fix that. I doubt this is related to the ICE anyways.
Reduced testcase: struct node234_Tag { int t1; int kids[4]; void *elems[3]; }; void *add234_internal(struct node234_Tag *n, int ei) { int j; for (j = ei; j < 2 && n->elems[j+1];) j++; n->kids[j+1] = 0; }
Investigating.
The combiner drops a REG_DEAD note without updating liveness info.
Still blocked by 25514. Mark, we badly need a decision for the latter.
Subject: Bug 29329 Author: ebotcazou Date: Sun Jan 21 22:32:39 2007 New Revision: 121037 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121037 Log: PR rtl-optimization/29329 * combine.c (replaced_rhs_insn): Rename to i2mod. (replaced_rhs_value): Rename to i2mod_new_rhs. (i2mod_old_rhs): New global variable. (combine_instructions): Adjust for above change. Save a copy of the old RHS into i2mod_old_rhs when the contents of a REG_EQUAL note are substituted in the second instruction. (distribute_notes) <REG_DEAD>: Adjust for above change. Do not ditch the note if it pertains to the second eliminated register and this register is mentioned in i2mod_old_rhs. Revert: 2006-09-12 Eric Botcazou <ebotcazou@libertysurf.fr> * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past the insn to which the note was originally attached. Added: trunk/gcc/testsuite/gcc.c-torture/compile/20070121.c Modified: trunk/gcc/ChangeLog trunk/gcc/combine.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 29329 Author: ebotcazou Date: Sun Jan 21 22:33:52 2007 New Revision: 121038 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121038 Log: PR rtl-optimization/29329 * combine.c (replaced_rhs_insn): Rename to i2mod. (replaced_rhs_value): Rename to i2mod_new_rhs. (i2mod_old_rhs): New global variable. (combine_instructions): Adjust for above change. Save a copy of the old RHS into i2mod_old_rhs when the contents of a REG_EQUAL note are substituted in the second instruction. (distribute_notes) <REG_DEAD>: Adjust for above change. Do not ditch the note if it pertains to the second eliminated register and this register is mentioned in i2mod_old_rhs. Revert: 2006-09-12 Eric Botcazou <ebotcazou@libertysurf.fr> * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past the insn to which the note was originally attached. Added: branches/gcc-4_2-branch/gcc/testsuite/gcc.c-torture/compile/20070121.c Modified: branches/gcc-4_2-branch/gcc/ChangeLog branches/gcc-4_2-branch/gcc/combine.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
Subject: Bug 29329 Author: ebotcazou Date: Sun Jan 21 22:34:57 2007 New Revision: 121039 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121039 Log: PR rtl-optimization/29329 * combine.c (replaced_rhs_insn): Rename to i2mod. (replaced_rhs_value): Rename to i2mod_new_rhs. (i2mod_old_rhs): New global variable. (combine_instructions): Adjust for above change. Save a copy of the old RHS into i2mod_old_rhs when the contents of a REG_EQUAL note are substituted in the second instruction. (distribute_notes) <REG_DEAD>: Adjust for above change. Do not ditch the note if it pertains to the second eliminated register and this register is mentioned in i2mod_old_rhs. Revert: 2006-09-12 Eric Botcazou <ebotcazou@libertysurf.fr> * combine.c (distribute_notes) <REG_DEAD>: Do not consider SETs past the insn to which the note was originally attached. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/compile/20070121.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/combine.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
At long last.