]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2019-04-15 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Apr 2019 11:59:02 +0000 (11:59 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Apr 2019 11:59:02 +0000 (11:59 +0000)
PR tree-optimization/90071
* tree-ssa-reassoc.c (init_range_entry): Do not pick up
abnormal operands from def stmts.

* gcc.dg/torture/pr90071.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270369 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr90071.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index 8f8ec28afceaa6a9619de7bcadce99655957632c..0d61af49e43cf56ff5ab0cadb7d73ab42dd85866 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/90071
+       * tree-ssa-reassoc.c (init_range_entry): Do not pick up
+       abnormal operands from def stmts.
+
 2019-04-15  Richard Biener  <rguenther@suse.de>
 
        PR ipa/88936
index be91be7c11bc76428eba3ccb1abe487e5d667fd2..38fcc79aa7dc12a5b561c26cc249eb7359bd3946 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/90071
+       * gcc.dg/torture/pr90071.c: New testcase.
+
 2019-04-15  Segher Boessenkool  <segher@kernel.crashing.org>
 
        PR rtl-optimization/89794
diff --git a/gcc/testsuite/gcc.dg/torture/pr90071.c b/gcc/testsuite/gcc.dg/torture/pr90071.c
new file mode 100644 (file)
index 0000000..bfa7239
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+int a;
+static int b;
+
+void
+foo ()
+{
+  int d;
+  int e = (int) (__INTPTR_TYPE__) &&f;
+  void *g = &&h;
+h: ++e;
+   if (a)
+     i: goto *g;
+   for (;;)
+     {
+       e = 0;
+       if (b)
+        goto i;
+     }
+f:
+   goto *({ d || e < 0 || e >= 2; });
+   &e;
+}
index e1c4dfe537eff8ff2d14af315a80e687e6361bf3..32bff979416665bfc7017e5af6432390180473be 100644 (file)
@@ -2143,7 +2143,8 @@ init_range_entry (struct range_entry *r, tree exp, gimple *stmt)
          exp_type = boolean_type_node;
        }
 
-      if (TREE_CODE (arg0) != SSA_NAME)
+      if (TREE_CODE (arg0) != SSA_NAME
+         || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (arg0))
        break;
       loc = gimple_location (stmt);
       switch (code)