https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103845
Bug ID: 103845 Summary: ICE in execute, at gimple-harden-conditionals.cc:552 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: aoliva at gcc dot gnu.org Target Milestone: --- gcc 12.0.0 20211226 snapshot (g:d87483015d476a95f521f0c9dcf6988ca889063b) ICEs when compiling the following testcase w/ -O1 -fharden-compares -fno-ipa-pure-const: int baz (void); __attribute__ ((returns_twice)) void bar (void) { } int quux (int y, int z) { return (y || z >= 0) ? y : z; } int foo (int x) { int a = 0, b = x == a; bar (); if (!!baz () < quux (b, a)) ++x; return x; } % gcc-12.0.0 -O1 -fharden-compares -fno-ipa-pure-const -c sys89o7m.c during GIMPLE pass: hardcmp sys89o7m.c: In function 'foo': sys89o7m.c:16:1: internal compiler error: in execute, at gimple-harden-conditionals.cc:552 16 | foo (int x) | ^~~ 0x8122e4 execute /var/tmp/portage/sys-devel/gcc-12.0.0_p20211226/work/gcc-12-20211226/gcc/gimple-harden-conditionals.cc:552