summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch
new file mode 100644
index 0000000000..d43c6357e9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0403-PR-target-49238.patch
@@ -0,0 +1,53 @@
1From 097c985ab5f847fba2fe4f9e53732b75f2ecf266 Mon Sep 17 00:00:00 2001
2From: kkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Wed, 8 Jun 2011 04:07:25 +0000
4Subject: [PATCH] PR target/49238
5 * config/sh/sh.c (expand_cbranchdi4): Use a scratch register if
6 needed when original operands are used for msw_skip comparison.
7 * gcc.c-torture/compile/pr49238.c: New.
8
9git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174793 138bc75d-0d04-0410-961f-82ee72b054a4
10
11index 05acb0a..ee80028 100644
12--- a/gcc/config/sh/sh.c
13+++ b/gcc/config/sh/sh.c
14@@ -2187,6 +2187,13 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
15 {
16 operands[1] = op1h;
17 operands[2] = op2h;
18+ if (reload_completed
19+ && ! arith_reg_or_0_operand (op2h, SImode)
20+ && (true_regnum (op1h) || (comparison != EQ && comparison != NE)))
21+ {
22+ emit_move_insn (scratch, operands[2]);
23+ operands[2] = scratch;
24+ }
25 }
26
27 operands[3] = skip_label = gen_label_rtx ();
28new file mode 100644
29index 0000000..fd8443a
30--- /dev/null
31+++ b/gcc/testsuite/gcc.c-torture/compile/pr49238.c
32@@ -0,0 +1,18 @@
33+/* PR target/49238 */
34+extern int bar (void);
35+
36+void
37+foo (unsigned long long a, int b)
38+{
39+ int i;
40+
41+ if (b)
42+ for (a = -12; a >= 10; a = bar ())
43+ break;
44+ else
45+ return;
46+
47+ for (i = 0; i < 10; i += 10)
48+ if ((i == bar ()) | (bar () >= a))
49+ bar ();
50+}
51--
521.7.0.4
53