summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2014-10-31 10:41:49 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-31 10:18:37 +0000
commit68f431e850449ac9f238d45ec2e69ca95050253a (patch)
tree7dd81b541c5cc342b6519e9a5ef467135a97eeb0 /meta/recipes-devtools
parente5c3c1501bebe754cd3bd95539a2a798a28f59a3 (diff)
downloadpoky-68f431e850449ac9f238d45ec2e69ca95050253a.tar.gz
gcc: backport two patches to fix ICE in dwarf2out_var_location
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) (From OE-Core rev: 0447732a7884ef49c7afbc2b408848e969666516) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch112
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch58
3 files changed, 172 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 9a66cd294f..87691289c3 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -71,6 +71,8 @@ SRC_URI = "\
71 file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \ 71 file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
72 file://0055-PR-rtl-optimization-61801.patch \ 72 file://0055-PR-rtl-optimization-61801.patch \
73 file://0056-top-level-reorder_gcc-bug-61144.patch \ 73 file://0056-top-level-reorder_gcc-bug-61144.patch \
74 file://0058-gcc-r212171.patch \
75 file://0059-gcc-PR-rtl-optimization-63348.patch \
74" 76"
75SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1" 77SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
76SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e" 78SRC_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
index 0000000000..8a205b750b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
@@ -0,0 +1,112 @@
1From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
2From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Mon, 30 Jun 2014 19:30:52 +0000
4Subject: [PATCH] r212171
5
6* except.c (emit_note_eh_region_end): New helper
7 function. (convert_to_eh_region_ranges): Use
8 emit_note_eh_region_end to emit EH_REGION_END note.
9 * jump.c (cleanup_barriers): Do not split a call and its
10 corresponding CALL_ARG_LOCATION note.
11
12git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
13
14Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
15Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
16---
17 gcc/except.c | 23 ++++++++++++++++++-----
18 gcc/jump.c | 19 +++++++++++++++----
19 2 files changed, 33 insertions(+), 9 deletions(-)
20
21diff --git a/gcc/except.c b/gcc/except.c
22index dc5c1d2..7ac114f 100644
23--- a/gcc/except.c
24+++ b/gcc/except.c
25@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
26 return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
27 }
28
29+static rtx
30+emit_note_eh_region_end (rtx insn)
31+{
32+ rtx next = NEXT_INSN (insn);
33+
34+ /* Make sure we do not split a call and its corresponding
35+ CALL_ARG_LOCATION note. */
36+ if (next && NOTE_P (next)
37+ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
38+ insn = next;
39+
40+ return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
41+}
42+
43 /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
44 The new note numbers will not refer to region numbers, but
45 instead to call site entries. */
46@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
47 note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
48 first_no_action_insn_before_switch);
49 NOTE_EH_HANDLER (note) = call_site;
50- note = emit_note_after (NOTE_INSN_EH_REGION_END,
51- last_no_action_insn_before_switch);
52+ note
53+ = emit_note_eh_region_end (last_no_action_insn_before_switch);
54 NOTE_EH_HANDLER (note) = call_site;
55 gcc_assert (last_action != -3
56 || (last_action_insn
57@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
58 first_no_action_insn = NULL_RTX;
59 }
60
61- note = emit_note_after (NOTE_INSN_EH_REGION_END,
62- last_action_insn);
63+ note = emit_note_eh_region_end (last_action_insn);
64 NOTE_EH_HANDLER (note) = call_site;
65 }
66
67@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
68
69 if (last_action >= -1 && ! first_no_action_insn)
70 {
71- note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
72+ note = emit_note_eh_region_end (last_action_insn);
73 NOTE_EH_HANDLER (note) = call_site;
74 }
75
76diff --git a/gcc/jump.c b/gcc/jump.c
77index 9418f65..a5e5f52 100644
78--- a/gcc/jump.c
79+++ b/gcc/jump.c
80@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
81 static unsigned int
82 cleanup_barriers (void)
83 {
84- rtx insn, next, prev;
85- for (insn = get_insns (); insn; insn = next)
86+ rtx insn;
87+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
88 {
89- next = NEXT_INSN (insn);
90 if (BARRIER_P (insn))
91 {
92- prev = prev_nonnote_insn (insn);
93+ rtx prev = prev_nonnote_insn (insn);
94 if (!prev)
95 continue;
96+
97+ if (CALL_P (prev))
98+ {
99+ /* Make sure we do not split a call and its corresponding
100+ CALL_ARG_LOCATION note. */
101+ rtx next = NEXT_INSN (prev);
102+
103+ if (NOTE_P (next)
104+ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
105+ prev = next;
106+ }
107+
108 if (BARRIER_P (prev))
109 delete_insn (insn);
110 else if (prev != PREV_INSN (insn))
111--
1121.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
index 0000000000..77f6be33d1
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
@@ -0,0 +1,58 @@
1From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Thu, 30 Oct 2014 20:37:14 -0700
4Subject: [PATCH]PR rtl-optimization/63348
5
6PR rtl-optimization/63348
7* emit-rtl.c (try_split): Do not emit extra barrier.
8
9Note: this patch is to fix the side effect introduced by r212171 which was reported at:
10https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
11
12git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
13
14Upstream-status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
15Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
16Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
17---
18 gcc/emit-rtl.c | 11 -----------
19 1 files changed, 0 insertions(+), 11 deletions(-)
20
21diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
22index 4736f8d..ae69dbd 100644
23--- a/gcc/emit-rtl.c
24+++ b/gcc/emit-rtl.c
25@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
26 {
27 rtx before = PREV_INSN (trial);
28 rtx after = NEXT_INSN (trial);
29- int has_barrier = 0;
30 rtx note, seq, tem;
31 int probability;
32 rtx insn_last, insn;
33@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
34
35 split_branch_probability = -1;
36
37- /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
38- We may need to handle this specially. */
39- if (after && BARRIER_P (after))
40- {
41- has_barrier = 1;
42- after = NEXT_INSN (after);
43- }
44-
45 if (!seq)
46 return trial;
47
48@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
49 tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
50
51 delete_insn (trial);
52- if (has_barrier)
53- emit_barrier_after (tem);
54
55 /* Recursively call try_split for each new insn created; by the
56 time control returns here that insn will be fully split, so
57--
581.7.1