re PR debug/90900 (ICE in copy_rtx, at rtl.c:376)
authorRichard Biener <rguenther@suse.de>
Tue, 18 Jun 2019 13:56:24 +0000 (13:56 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Jun 2019 13:56:24 +0000 (13:56 +0000)
2019-06-18  Richard Biener  <rguenther@suse.de>

PR debug/90900
* cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
as if optimized away.

* gcc.dg/gomp/pr90900.c: New testcase.

From-SVN: r272421

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/pr90900.c [new file with mode: 0644]

index cdfaa5fbf233a79b58548f0797bc7377b5274247..461792c3b2973fdb4b4f720c4c516f42f9216fab 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-18  Richard Biener  <rguenther@suse.de>
+
+       PR debug/90900
+       * cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
+       as if optimized away.
+
 2019-06-18  Tom de Vries  <tdevries@suse.de>
 
        * config/nvptx/nvptx-protos.h (gen_set_softstack_insn): Remove.
index 4272e24a700847eae56feb0b8bc867e299e523ea..cc8eed6181a622c1228c794a2cfc779b45a2ced4 100644 (file)
@@ -4387,7 +4387,11 @@ expand_debug_expr (tree exp)
       op0 = DECL_RTL_IF_SET (exp);
 
       /* This decl was probably optimized away.  */
-      if (!op0)
+      if (!op0
+         /* At least label RTXen are sometimes replaced by
+            NOTE_INSN_DELETED_LABEL.  Any notes here are not
+            handled by copy_rtx.  */
+         || NOTE_P (op0))
        {
          if (!VAR_P (exp)
              || DECL_EXTERNAL (exp)
index cc5fecaf858d57dfd1fde4a087025d1105da4af6..061f7fba453447b69019386f8b0f79f9662686ae 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-18  Richard Biener  <rguenther@suse.de>
+
+       PR debug/90900
+       * gcc.dg/gomp/pr90900.c: New testcase.
+
 2019-06-18  Martin Sebor  <msebor@redhat.com>
 
        * gcc.dg/pr90866-2.c: Remove a pointless declaration
diff --git a/gcc/testsuite/gcc.dg/gomp/pr90900.c b/gcc/testsuite/gcc.dg/gomp/pr90900.c
new file mode 100644 (file)
index 0000000..d4c5d7d
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -g" } */
+
+void f (int a)
+{
+  void *x = &&lab;
+#pragma omp parallel
+  if (a)
+    { lab: __builtin_unreachable(); }
+  x;
+}