]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/69214 (ICE (segfault) at -Os on x86_64-linux-gnu...
authorJakub Jelinek <jakub@redhat.com>
Thu, 11 Feb 2016 09:22:21 +0000 (10:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 11 Feb 2016 09:22:21 +0000 (10:22 +0100)
Backported from mainline
2016-01-11  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/69214
* tree-vrp.c (simplify_cond_using_ranges): Don't propagate
innerop into a comparison if SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
Formatting fix.

* gcc.c-torture/compile/pr69214.c: New test.

From-SVN: r233330

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr69214.c [new file with mode: 0644]
gcc/tree-vrp.c

index 6c91448fb758048eaa48ae88ed7b3657def9a322..39b4aa922abf0c5d67a634a885001c2fc066f140 100644 (file)
@@ -1,3 +1,13 @@
+2016-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2016-01-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/69214
+       * tree-vrp.c (simplify_cond_using_ranges): Don't propagate
+       innerop into a comparison if SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
+       Formatting fix.
+
 2016-02-11  Oleg Endo  <olegendo@gcc.gnu.org>
 
        Backport from mainline
index 2837786e3eee3e5fa9c298c7fae76200caac350f..c8a19a9fb6c3ed1421d1aa7118b52e4966091502 100644 (file)
@@ -1,6 +1,11 @@
 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2016-01-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/69214
+       * gcc.c-torture/compile/pr69214.c: New test.
+
        2016-01-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/69128
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr69214.c b/gcc/testsuite/gcc.c-torture/compile/pr69214.c
new file mode 100644 (file)
index 0000000..61728f5
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR tree-optimization/69214 */
+
+extern void bar (void);
+extern int __setjmp (char *);
+
+void
+foo (char *p)
+{
+  int d = 0;
+  bar ();
+  if (__setjmp (p))
+    return;
+  long a = d;
+  d = 8;
+  if (!a)
+    bar ();
+}
index fb3e05d85c203199c9874f49276f86ef25a9a4aa..5f3a6f8dbc312fb15f1baf1b3e825d7b93addc45 100644 (file)
@@ -9021,7 +9021,8 @@ simplify_cond_using_ranges (gimple stmt)
       innerop = gimple_assign_rhs1 (def_stmt);
 
       if (TREE_CODE (innerop) == SSA_NAME
-         && !POINTER_TYPE_P (TREE_TYPE (innerop)))
+         && !POINTER_TYPE_P (TREE_TYPE (innerop))
+         && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (innerop))
        {
          value_range_t *vr = get_value_range (innerop);
 
@@ -9051,8 +9052,8 @@ simplify_cond_using_ranges (gimple stmt)
                  else
                    location = gimple_location (stmt);
                  warning_at (location, OPT_Wstrict_overflow,
-                     "assuming signed overflow does not occur when "
-                     "simplifying conditional");
+                             "assuming signed overflow does not occur when "
+                             "simplifying conditional");
                }
 
              tree newconst = fold_convert (TREE_TYPE (innerop), op1);