This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/66794] New: ICE at -O2 and -O3 on x86_64-linux-gnu


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

            Bug ID: 66794
           Summary: ICE at -O2 and -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          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
-O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It is a regression from 5.1.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/6.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 6.0.0 20150707 (experimental) [trunk revision 225501] (GCC) 
$ 
$ gcc-trunk -Os -c small.c
small.c: In function âfn1â:
small.c:18:10: warning: function returns address of local variable
[-Wreturn-local-addr]
   return *c;
          ^
small.c:12:7: note: declared here
   int f, **g = &b;
       ^
$ gcc-5.1 -O2 -c small.c
small.c: In function âfn1â:
small.c:18:10: warning: function may return address of local variable
[-Wreturn-local-addr]
   return *c;
          ^
small.c:12:7: note: declared here
   int f, **g = &b;
       ^
$ 
$ gcc-trunk -O2 -c small.c
small.c: In function âfn1â:
small.c:18:10: warning: function may return address of local variable
[-Wreturn-local-addr]
   return *c;
          ^
small.c:12:7: note: declared here
   int f, **g = &b;
       ^
small.c:10:1: error: dominator of 4 status unknown
 fn1 ()
 ^
small.c:10:1: internal compiler error: Segmentation fault
0xbb296f crash_signal
        ../../gcc-trunk/gcc/toplev.c:360
0x76ac43 verify_dominators(cdi_direction)
        ../../gcc-trunk/gcc/dominance.c:1059
0x76aed7 calculate_dominance_info(cdi_direction)
        ../../gcc-trunk/gcc/dominance.c:685
0xcd85e4 execute
        ../../gcc-trunk/gcc/tree-ssa-dse.c:404
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, *b, e;
static int **c = &b;

struct
{
  int f0;
} d;

int *
fn1 ()
{
  int f, **g = &b;
  e = a;
  for (; a;)
    for (; d.f0; d.f0++)
      ;
  *g = &f;
  return *c;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]