[Bug rtl-optimization/55512] New: [4.8 Regression] Various LRA ICEs with inline-asm

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 28 09:25:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55512

             Bug #: 55512
           Summary: [4.8 Regression] Various LRA ICEs with inline-asm
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: error-recovery
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: vmakarov@gcc.gnu.org


#ifndef TEST
#define TEST 0
#endif

#if (TEST & 1)
#define __builtin_unreachable() do { } while (0)
#endif

#if (TEST & 2) == 0
int
foo (int x)
{
  asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3),
   "r" (x + 4), "r" (x + 5), "r" (x + 6), "r" (x + 7),
   "r" (x + 8), "r" (x + 9), "r" (x + 10), "r" (x + 11),
   "r" (x + 12), "r" (x + 13), "r" (x + 14), "r" (x + 15) : : lab);
  __builtin_unreachable ();
lab:
  return 0;
}
#endif

#if (TEST & 2)
int
bar (int x)
{
  asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3),
   "r" (x + 4), "r" (x + 5), "r" (x + 6), "r" (x + 7),
   "r" (x + 8), "r" (x + 9), "r" (x + 10), "r" (x + 11),
   "r" (x + 12), "r" (x + 13), "r" (x + 14), "r" (x + 15),
   "r" (x + 16) : : lab);
  __builtin_unreachable ();
lab:
  return 0;
}
#endif

shows 3 different ICEs on x86_64-linux with -O3.  In 4.7 I get:
for i in `seq 0 3`; do echo ===$i===; LC_ALL=C gcc -S -O2 -DTEST=$i
pr51106-3.c; done
===0===
pr51106-3.c: In function 'foo':
pr51106-3.c:13:3: error: can't find a register in class 'GENERAL_REGS' while
reloading 'asm'
pr51106-3.c:13:3: error: 'asm' operand has impossible constraints
===1===
pr51106-3.c: In function 'foo':
pr51106-3.c:13:3: error: can't find a register in class 'GENERAL_REGS' while
reloading 'asm'
pr51106-3.c:13:3: error: 'asm' operand has impossible constraints
===2===
pr51106-3.c: In function 'bar':
pr51106-3.c:27:3: error: can't find a register in class 'GENERAL_REGS' while
reloading 'asm'
pr51106-3.c:27:3: error: 'asm' operand has impossible constraints
===3===
pr51106-3.c: In function 'bar':
pr51106-3.c:27:3: error: can't find a register in class 'GENERAL_REGS' while
reloading 'asm'
pr51106-3.c:27:3: error: 'asm' operand has impossible constraints

but with the trunk:
for i in `seq 0 3`; do echo ===$i===; LC_ALL=C ./xgcc -B ./ -S -O2 -DTEST=$i
pr51106-3.c; done
===0===
pr51106-3.c: In function 'foo':
pr51106-3.c:20:1: internal compiler error: Maximum number of LRA constraint
passes is achieved (15)

 }
 ^
0x8fd167 lra_constraints(bool)
../../gcc/lra-constraints.c:3315
0x8eda2e lra(_IO_FILE*)
../../gcc/lra.c:2277
0x8a33e4 do_reload
../../gcc/ira.c:4624
0x8a35f2 rest_of_handle_reload
../../gcc/ira.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
===1===
pr51106-3.c: In function 'foo':
pr51106-3.c:20:1: internal compiler error: Maximum number of LRA constraint
passes is achieved (15)

 }
 ^
0x8fd167 lra_constraints(bool)
../../gcc/lra-constraints.c:3315
0x8eda2e lra(_IO_FILE*)
../../gcc/lra.c:2277
0x8a33e4 do_reload
../../gcc/ira.c:4624
0x8a35f2 rest_of_handle_reload
../../gcc/ira.c:4737
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
===2===
pr51106-3.c: In function 'bar':
pr51106-3.c:27:3: error: 'asm' operand has impossible constraints
   asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3),
   ^
pr51106-3.c:35:1: error: unrecognizable insn:
 }
 ^
(jump_insn 22 74 37 2 (use (const_int 0 [0])) pr51106-3.c:27 -1
     (nil)
 -> 25)
pr51106-3.c:35:1: internal compiler error: in insn_default_length, at
config/i386/i386.md:1037
0x9d5ed3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/rtl-error.c:110
0x9d5f14 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:118
0xd4887f insn_default_length(rtx_def*)
../../gcc/config/i386/i386.md:1037
0x767c92 get_attr_length_1
../../gcc/final.c:405
0x767dae get_attr_length(rtx_def*)
../../gcc/final.c:437
0xd363d8 min_insn_size
../../gcc/config/i386/i386.c:35044
0xd3661c ix86_avoid_jump_mispredicts
../../gcc/config/i386/i386.c:35140
0xd36eba ix86_reorg
../../gcc/config/i386/i386.c:35367
0x9d5bc5 rest_of_handle_machine_reorg
../../gcc/reorg.c:3944
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
===3===
pr51106-3.c: In function 'bar':
pr51106-3.c:27:3: error: 'asm' operand has impossible constraints
   asm goto ("" : : "r" (x), "r" (x + 1), "r" (x + 2), "r" (x + 3),
   ^
pr51106-3.c:35:1: internal compiler error: in fixup_reorder_chain, at
cfgrtl.c:3334
 }
 ^
0x677755 fixup_reorder_chain
../../gcc/cfgrtl.c:3334
0x6789d5 cfg_layout_finalize()
../../gcc/cfgrtl.c:3811
0xf8047b rest_of_handle_reorder_blocks
../../gcc/bb-reorder.c:2225
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.



More information about the Gcc-bugs mailing list