[Bug c++/70689] New: ICE on valid code at -O1 in 32-bit mode on x86_64-linux-gnu in curr_insn_transform, at lra-constraints.c:3564

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Sat Apr 16 05:21:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70689

            Bug ID: 70689
           Summary: ICE on valid code at -O1 in 32-bit mode on
                    x86_64-linux-gnu in curr_insn_transform, at
                    lra-constraints.c:3564
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O1 on x86_64-linux-gnu in the 32-bit mode (but not in 64-bit mode). 

It is a regression from 5.3.x. 


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 6.0.0 20160415 (experimental) [trunk revision 235013] (GCC) 
$ 
$ gcc-trunk -m32 -O0 small.c         
$ gcc-5.3 -m32 -O1 small.c
$ 
$ gcc-trunk -m32 -O1 small.c
small.c: In function ‘main’:
small.c:23:1: error: unable to generate reloads for:
 }
 ^
(insn 22 50 23 4 (set (reg:DF 93 [ a_lsm.7 ])
        (float:DF (plus:SI (reg/f:SI 20 frame)
                (const_int -20 [0xffffffffffffffec])))) small.c:14 205
{*floatsidf2_i387}
     (nil))
small.c:23:1: internal compiler error: in curr_insn_transform, at
lra-constraints.c:3564
0xb05bf8 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-source-trunk/gcc/rtl-error.c:108
0xa05822 curr_insn_transform
        ../../gcc-source-trunk/gcc/lra-constraints.c:3564
0xa07726 lra_constraints(bool)
        ../../gcc-source-trunk/gcc/lra-constraints.c:4506
0x9f3544 lra(_IO_FILE*)
        ../../gcc-source-trunk/gcc/lra.c:2290
0x9aa599 do_reload
        ../../gcc-source-trunk/gcc/ira.c:5425
0x9aa599 execute
        ../../gcc-source-trunk/gcc/ira.c:5609
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.
$ 


-------------------------------------


struct S
{
  int f; 
};

double a;
int c; 

static
void fn1 (struct S *p1)
{
  for (; c; )
    if (p1->f++)
      a = (int) p1;
}

int 
main ()
{
  struct S b = { 0 };
  fn1 (&b);
  return 0; 
}


More information about the Gcc-bugs mailing list