summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch
new file mode 100644
index 0000000000..47d896c6b7
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0305-PR-middle-end-49029.patch
@@ -0,0 +1,52 @@
1From 7f6851f9e44e25a3ddb77bf09b6e138a9c39bbf0 Mon Sep 17 00:00:00 2001
2From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Sun, 22 May 2011 19:02:59 +0000
4Subject: [PATCH] PR middle-end/49029
5 * expmed.c (extract_fixed_bit_field): Test whether target can be used
6 only after deciding which mode to use.
7
8 * gcc.c-torture/compile/pr49029.c: New test.
9
10
11git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@174036 138bc75d-0d04-0410-961f-82ee72b054a4
12
13index 6c35f8e..0d44b2b 100644
14--- a/gcc/expmed.c
15+++ b/gcc/expmed.c
16@@ -1875,8 +1875,6 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
17 /* To extract a signed bit-field, first shift its msb to the msb of the word,
18 then arithmetic-shift its lsb to the lsb of the word. */
19 op0 = force_reg (mode, op0);
20- if (mode != tmode)
21- target = 0;
22
23 /* Find the narrowest integer mode that contains the field. */
24
25@@ -1888,6 +1886,9 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
26 break;
27 }
28
29+ if (mode != tmode)
30+ target = 0;
31+
32 if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos))
33 {
34 tree amount
35new file mode 100644
36index 0000000..ebe81b3
37--- /dev/null
38+++ b/gcc/testsuite/gcc.c-torture/compile/pr49029.c
39@@ -0,0 +1,10 @@
40+/* PR middle-end/49029 */
41+struct S { volatile unsigned f : 11; signed g : 30; } __attribute__((packed));
42+struct T { volatile struct S h; } __attribute__((packed)) a;
43+void foo (int);
44+
45+void
46+bar ()
47+{
48+ foo (a.h.g);
49+}
50--
511.7.0.4
52