PR middle-end/49029
* expmed.c (extract_fixed_bit_field): Test whether target can be used
only after deciding which mode to use.
* gcc.c-torture/compile/pr49029.c: New test.
From-SVN: r174034
+2011-05-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49029
+ * expmed.c (extract_fixed_bit_field): Test whether target can be used
+ only after deciding which mode to use.
+
2011-05-22 Tom de Vries <tom@codesourcery.com>
PR target/45098
/* To extract a signed bit-field, first shift its msb to the msb of the word,
then arithmetic-shift its lsb to the lsb of the word. */
op0 = force_reg (mode, op0);
- if (mode != tmode)
- target = 0;
/* Find the narrowest integer mode that contains the field. */
break;
}
+ if (mode != tmode)
+ target = 0;
+
if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos))
{
int amount = GET_MODE_BITSIZE (mode) - (bitsize + bitpos);
+2011-05-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49029
+ * gcc.c-torture/compile/pr49029.c: New test.
+
2011-05-22 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae23.C: New.
--- /dev/null
+/* PR middle-end/49029 */
+struct S { volatile unsigned f : 11; signed g : 30; } __attribute__((packed));
+struct T { volatile struct S h; } __attribute__((packed)) a;
+void foo (int);
+
+void
+bar ()
+{
+ foo (a.h.g);
+}