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

            Bug ID: 77979
           Summary: ICE on valid code at -Os and above on
                    x86_64-linux-gnu: Segmentation fault
           Product: gcc
           Version: 7.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: ---

This is a regression from 6.2.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/7.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 7.0.0 20161013 (experimental) [trunk revision 241136] (GCC)
$
$ gcc-trunk -O1 -c small.c
$ gcc-6.2 -Os -c small.c
$
$ gcc-trunk -Os -c small.c
small.c: In function ‘fn1’:
small.c:3:6: internal compiler error: Segmentation fault
 void fn1 ()
      ^~~
0xbe954f crash_signal
        ../../gcc-source-trunk/gcc/toplev.c:338
0xe7b040 tree_check
        ../../gcc-source-trunk/gcc/tree.h:3286
0xe7b040 get_value_range
        ../../gcc-source-trunk/gcc/tree-vrp.c:650
0xe7f51c get_vr_for_comparison
        ../../gcc-source-trunk/gcc/tree-vrp.c:7134
0xe7f51c compare_names
        ../../gcc-source-trunk/gcc/tree-vrp.c:7299
0xe7f51c vrp_evaluate_conditional_warnv_with_ops
        ../../gcc-source-trunk/gcc/tree-vrp.c:7389
0xe7f93b vrp_evaluate_conditional
        ../../gcc-source-trunk/gcc/tree-vrp.c:7423
0xe90f36 simplify_stmt_for_jump_threading
        ../../gcc-source-trunk/gcc/tree-vrp.c:10349
0xdf169e simplify_control_stmt_condition
        ../../gcc-source-trunk/gcc/tree-ssa-threadedge.c:453
0xdf20e8 thread_through_normal_block
        ../../gcc-source-trunk/gcc/tree-ssa-threadedge.c:1088
0xdf3402 thread_across_edge(gcond*, edge_def*, bool, const_and_copies*,
avail_exprs_stack*, tree_node* (*)(gimple*, gimple*, avail_exprs_stack*))
        ../../gcc-source-trunk/gcc/tree-ssa-threadedge.c:1189
0xe88843 identify_jump_threads
        ../../gcc-source-trunk/gcc/tree-vrp.c:10536
0xe88843 vrp_finalize
        ../../gcc-source-trunk/gcc/tree-vrp.c:10624
0xe88843 execute_vrp
        ../../gcc-source-trunk/gcc/tree-vrp.c:11016
0xe88843 execute
        ../../gcc-source-trunk/gcc/tree-vrp.c:11102
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, c, d, e, f;

void fn1 ()
{ 
  int g = b;
  a = -~(d || a) << 4 || e;
  b = c || g ^ a;
  if (f < g)
    d = e;
}

Reply via email to