]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't split call from its call arg location.
authorClaudiu Zissulescu <claziss@synopsys.com>
Tue, 21 Nov 2017 11:37:42 +0000 (12:37 +0100)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Tue, 21 Nov 2017 11:37:42 +0000 (12:37 +0100)
gcc/
2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>

* cfgrtl.c (force_nonfallthru_and_redirect): Don't split a call
and its corresponding call arg location note.

testsuite/
2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>

* gcc.target/arc/loop-5.cpp: New test.

From-SVN: r254998

gcc/ChangeLog
gcc/cfgrtl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arc/loop-5.cpp [new file with mode: 0644]

index 7fa85726ae768e3cbb3b290c09f5af0c6c738b2f..bc504258ddeaacf4de075f904750f9a039411970 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * cfgrtl.c (force_nonfallthru_and_redirect): Don't split a call
+       and its corresponding call arg location note.
+
 2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>
            Andrew Burgess  <andrew.burgess@embecosm.com>
 
index ae469088eecbcc46dcdd08055da10e5094a945ea..d6e5ac05475d22f1daa4e7d401123827ca46fc56 100644 (file)
@@ -1626,6 +1626,11 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
       else
        new_head = BB_END (e->src);
       new_head = NEXT_INSN (new_head);
+      /* Make sure we don't split a call and its corresponding
+        CALL_ARG_LOCATION note.  */
+      if (new_head && NOTE_P (new_head)
+         && NOTE_KIND (new_head) == NOTE_INSN_CALL_ARG_LOCATION)
+       new_head = NEXT_INSN (new_head);
 
       jump_block = create_basic_block (new_head, NULL, e->src);
       jump_block->count = count;
index 70926dc1e2eaa7c09fcca5d684256b6d8a88dd9a..8d64a22d5c1c92b956557f8b9c46d8f53aef534b 100644 (file)
@@ -1,3 +1,7 @@
+2017-11-21  Claudiu Zissulescu  <claziss@synopsys.com>
+
+       * gcc.target/arc/loop-5.cpp: New test.
+
 2017-11-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/83047
diff --git a/gcc/testsuite/gcc.target/arc/loop-5.cpp b/gcc/testsuite/gcc.target/arc/loop-5.cpp
new file mode 100644 (file)
index 0000000..b9b188d
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+/* Check if gcc splits a call from its CALL_ARG_LOCATION note.  If so,
+   we get an ICE in dwarf2out_var_location.  */
+
+typedef void Trans_NS_std_new_handler();
+void *operator new(unsigned)
+{
+  void *p;
+  while (__builtin_expect(p == 0, false))
+    {
+      Trans_NS_std_new_handler handler;
+      try {
+       handler();
+      } catch (int) {
+      }
+    }
+  return (void*) 0xdead;
+}