]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc: backport two patches to fix ICE in dwarf2out_var_location
authorJackie Huang <jackie.huang@windriver.com>
Fri, 31 Oct 2014 14:41:49 +0000 (10:41 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 31 Dec 2014 10:17:14 +0000 (10:17 +0000)
The first patch fixes the ICE in dwarf2out_var_location, at
dwarf2out.c.

r212171:
    * except.c (emit_note_eh_region_end): New helper function.
    (convert_to_eh_region_ranges): Use emit_note_eh_region_end to
    emit EH_REGION_END note.
    * jump.c (cleanup_barriers): Do not split a call and its
    corresponding CALL_ARG_LOCATION note.

But it introduced a regression issue:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348

so backport the fix for the regression as well:

r215613:
    PR rtl-optimization/63348
    * emit-rtl.c (try_split): Do not emit extra barrier.

(From OE-Core rev: de52db1b1b0dbc9060dddceb42b7dd4f66a7e0f3)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-devtools/gcc/gcc-4.9.inc
meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch [new file with mode: 0644]
meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch [new file with mode: 0644]

index 9a66cd294f9495f1e7f5beb6d63f8a407e0ec24f..87691289c30da3c518b4d7d7550d6c3094de197b 100644 (file)
@@ -71,6 +71,8 @@ SRC_URI = "\
     file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
     file://0055-PR-rtl-optimization-61801.patch \
     file://0056-top-level-reorder_gcc-bug-61144.patch \
+    file://0058-gcc-r212171.patch \
+    file://0059-gcc-PR-rtl-optimization-63348.patch \
 "
 SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
 SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
new file mode 100644 (file)
index 0000000..8a205b7
--- /dev/null
@@ -0,0 +1,112 @@
+From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
+From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 30 Jun 2014 19:30:52 +0000
+Subject: [PATCH] r212171
+
+* except.c (emit_note_eh_region_end): New helper
+ function.     (convert_to_eh_region_ranges): Use
+ emit_note_eh_region_end to    emit EH_REGION_END note.
+ * jump.c (cleanup_barriers): Do not split a call and its
+ corresponding CALL_ARG_LOCATION note.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+---
+ gcc/except.c |   23 ++++++++++++++++++-----
+ gcc/jump.c   |   19 +++++++++++++++----
+ 2 files changed, 33 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/except.c b/gcc/except.c
+index dc5c1d2..7ac114f 100644
+--- a/gcc/except.c
++++ b/gcc/except.c
+@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
+   return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
+ }
+
++static rtx
++emit_note_eh_region_end (rtx insn)
++{
++  rtx next = NEXT_INSN (insn);
++
++  /* Make sure we do not split a call and its corresponding
++     CALL_ARG_LOCATION note.  */
++  if (next && NOTE_P (next)
++      && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++    insn = next;
++
++  return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
++}
++
+ /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+    The new note numbers will not refer to region numbers, but
+    instead to call site entries.  */
+@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
+               note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+                                        first_no_action_insn_before_switch);
+               NOTE_EH_HANDLER (note) = call_site;
+-              note = emit_note_after (NOTE_INSN_EH_REGION_END,
+-                                      last_no_action_insn_before_switch);
++              note
++                = emit_note_eh_region_end (last_no_action_insn_before_switch);
+               NOTE_EH_HANDLER (note) = call_site;
+               gcc_assert (last_action != -3
+                           || (last_action_insn
+@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
+                   first_no_action_insn = NULL_RTX;
+                 }
+
+-              note = emit_note_after (NOTE_INSN_EH_REGION_END,
+-                                      last_action_insn);
++              note = emit_note_eh_region_end (last_action_insn);
+               NOTE_EH_HANDLER (note) = call_site;
+             }
+
+@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
+
+   if (last_action >= -1 && ! first_no_action_insn)
+     {
+-      note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
++      note = emit_note_eh_region_end (last_action_insn);
+       NOTE_EH_HANDLER (note) = call_site;
+     }
+
+diff --git a/gcc/jump.c b/gcc/jump.c
+index 9418f65..a5e5f52 100644
+--- a/gcc/jump.c
++++ b/gcc/jump.c
+@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
+ static unsigned int
+ cleanup_barriers (void)
+ {
+-  rtx insn, next, prev;
+-  for (insn = get_insns (); insn; insn = next)
++  rtx insn;
++  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+     {
+-      next = NEXT_INSN (insn);
+       if (BARRIER_P (insn))
+       {
+-        prev = prev_nonnote_insn (insn);
++        rtx prev = prev_nonnote_insn (insn);
+         if (!prev)
+           continue;
++
++        if (CALL_P (prev))
++          {
++            /* Make sure we do not split a call and its corresponding
++               CALL_ARG_LOCATION note.  */
++            rtx next = NEXT_INSN (prev);
++
++            if (NOTE_P (next)
++                && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++              prev = next;
++          }
++
+         if (BARRIER_P (prev))
+           delete_insn (insn);
+         else if (prev != PREV_INSN (insn))
+--
+1.7.9.5
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
new file mode 100644 (file)
index 0000000..77f6be3
--- /dev/null
@@ -0,0 +1,58 @@
+From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 30 Oct 2014 20:37:14 -0700
+Subject: [PATCH]PR rtl-optimization/63348
+
+PR rtl-optimization/63348
+* emit-rtl.c (try_split): Do not emit extra barrier.
+
+Note: this patch is to fix the side effect introduced by r212171 which was reported at:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcc/emit-rtl.c |   11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
+index 4736f8d..ae69dbd 100644
+--- a/gcc/emit-rtl.c
++++ b/gcc/emit-rtl.c
+@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
+ {
+   rtx before = PREV_INSN (trial);
+   rtx after = NEXT_INSN (trial);
+-  int has_barrier = 0;
+   rtx note, seq, tem;
+   int probability;
+   rtx insn_last, insn;
+@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
+
+   split_branch_probability = -1;
+
+-  /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
+-     We may need to handle this specially.  */
+-  if (after && BARRIER_P (after))
+-    {
+-      has_barrier = 1;
+-      after = NEXT_INSN (after);
+-    }
+-
+   if (!seq)
+     return trial;
+
+@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
+   tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
+
+   delete_insn (trial);
+-  if (has_barrier)
+-    emit_barrier_after (tem);
+
+   /* Recursively call try_split for each new insn created; by the
+      time control returns here that insn will be fully split, so
+--
+1.7.1