No need to continue processing an undefined range.
gcc/
PR tree-optimization/107109
* range-op.cc (adjust_op1_for_overflow): Don't process undefined.
gcc/testsuite/
* gcc.dg/pr107109.c: New.
adjust_op1_for_overflow (irange &r, const irange &op2, relation_kind rel,
bool add_p)
{
+ if (r.undefined_p ())
+ return;
tree type = r.type ();
// Check for unsigned overflow and calculate the overflow part.
signop s = TYPE_SIGN (type);
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+int printf(const char *, ...);
+int a, b;
+void c() {
+ int d, e;
+ L:
+ a = (b && a) ^ 2756578370;
+ d = ~a + (e ^ d) ^ 2756578370;
+ if (!d)
+ printf("%d", a);
+ d = a / e;
+ goto L;
+}
+int main() {
+ if (a)
+ c();
+ return 0;
+}
+