]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR debug/66432 (libgomp.c/appendix-a/a.29.1.c -O2 -g: type mismatch...
authorJakub Jelinek <jakub@redhat.com>
Thu, 11 Feb 2016 09:08:03 +0000 (10:08 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 11 Feb 2016 09:08:03 +0000 (10:08 +0100)
Backported from mainline
2015-11-21  Jakub Jelinek  <jakub@redhat.com>

PR debug/66432
* tree-inline.c (copy_debug_stmt): If
gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
in decl_debug_args, don't call remap_gimple_op_r on it.

* gcc.dg/debug/pr66432.c: New test.

From-SVN: r233320

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/pr66432.c [new file with mode: 0644]
gcc/tree-inline.c

index f63667bcde57722417a6b8947ee3658ea51784df..7508126e52f94f0d11fe9c245dc6d96a10a42c1a 100644 (file)
@@ -1,6 +1,13 @@
 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2015-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/66432
+       * tree-inline.c (copy_debug_stmt): If
+       gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
+       in decl_debug_args, don't call remap_gimple_op_r on it.
+
        2015-11-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/67770
index 48a77ec193157cb10b234080ae2cf4a054c80594..c5dd7b58f8c01849885e3410961182572ff34955 100644 (file)
@@ -1,6 +1,11 @@
 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2015-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/66432
+       * gcc.dg/debug/pr66432.c: New test.
+
        2015-11-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/67770
diff --git a/gcc/testsuite/gcc.dg/debug/pr66432.c b/gcc/testsuite/gcc.dg/debug/pr66432.c
new file mode 100644 (file)
index 0000000..cf36799
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR debug/66432 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+extern void baz (const char *, const char *) __attribute__ ((__noreturn__));
+
+void
+foo (int x, int y[x][x])
+{
+  if (x < 2)
+    baz ("", "");
+}
+
+void
+bar (void)
+{
+  int z[2][2] = { { 1, 2 }, { 3, 4 } };
+  foo (2, z);
+}
index 04d099f61f4ab83f6b8cd5870311dcf24961175a..e2048f41697904cacb2707f54ccce538e4f492de 100644 (file)
@@ -2655,8 +2655,6 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
   else if (gimple_debug_source_bind_p (stmt))
     {
       gimple_debug_source_bind_set_var (stmt, t);
-      walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
-                remap_gimple_op_r, &wi, NULL);
       /* When inlining and source bind refers to one of the optimized
         away parameters, change the source bind into normal debug bind
         referring to the corresponding DEBUG_EXPR_DECL that should have
@@ -2680,7 +2678,10 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
                    break;
                  }
            }
-       }      
+       }
+      if (gimple_debug_source_bind_p (stmt))
+       walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
+                  remap_gimple_op_r, &wi, NULL);
     }
 
   processing_debug_stmt = 0;