Bug ID: 77677
           Summary: ICE at -O1 and above in both 32-bit and 64-bit modes
                    on x86_64-linux-gnu (internal compiler error: in
                    set_value_range, at tree-vrp.c:361)
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

If I add "int" in front of "p1", then the crash disappears.

$ gcc-trunk -v
Using built-in specs.
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 20160921 (experimental) [trunk revision 240316] (GCC)
$ gcc-trunk -O3 small.c
small.c: In function ‘fn1’:
small.c:2:5: warning: type of ‘p1’ defaults to ‘int’ [-Wimplicit-int]
 int fn1(p1) { return p1 == 0 || a % p1; }
small.c: At top level:
small.c:7:1: internal compiler error: in set_value_range, at tree-vrp.c:361
0xe61ec8 set_value_range
0xe6542e vrp_meet_1
0xe6542e vrp_meet(value_range*, value_range const*)
0x12e9ef5 ipcp_vr_lattice::meet_with_1(value_range const*)
0x12f038c ipcp_vr_lattice::meet_with(value_range const*)
0x12f038c propagate_vr_accross_jump_function
0x12f038c propagate_constants_accross_call
0x12f2918 propagate_constants_topo
0x12f2918 ipcp_propagate_stage
0x12f4b63 ipcp_driver
0x12f4b63 execute
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <> for instructions.
$ cat small.c
int a, b;
int fn1(p1) { return p1 == 0 || a % p1; }

int main() {
  b = fn1(2592930443);
  return 0;

Reply via email to