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

            Bug ID: 63835
           Summary: ICE on valid code at -Os and above on x86_64-linux-gnu
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following code causes an ICE when compiled with the current gcc trunk at
-Os and above on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It is a regression from 4.9.x. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 5.0.0 20141111 (experimental) [trunk revision 217365] (GCC) 

$ 
$ gcc-trunk -O1 -c small.c
$ gcc-4.9 -Os -c small.c
$ 
$ gcc-trunk -Os -c small.c
small.c: In function ‘fn2’:
small.c:13:1: error: non-trivial conversion at assignment
 }
 ^
int
unsigned int
_6 = a.1_3;
small.c:13:1: error: non-trivial conversion at assignment
int
unsigned int
_7 = a.1_3;
small.c:13:1: internal compiler error: verify_gimple failed
0xa87644 verify_gimple_in_cfg(function*, bool)
    ../../gcc-trunk/gcc/tree-cfg.c:5039
0x98fa56 execute_function_todo
    ../../gcc-trunk/gcc/passes.c:1868
0x9904c3 execute_todo
    ../../gcc-trunk/gcc/passes.c:1925
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.
$ 


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


int a;

int
fn1 (int p)
{
  return -p;
}

void
fn2 ()
{
  fn1 (-(unsigned int) a);
}

Reply via email to