Commit ccb1b17b by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/49029 (ICE in simplify_subreg, at simplify-rtx.c:5266)

	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
parent 50ad7db2
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> 2011-05-22 Tom de Vries <tom@codesourcery.com>
PR target/45098 PR target/45098
......
...@@ -1769,8 +1769,6 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, ...@@ -1769,8 +1769,6 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
/* To extract a signed bit-field, first shift its msb to the msb of the word, /* 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. */ then arithmetic-shift its lsb to the lsb of the word. */
op0 = force_reg (mode, op0); op0 = force_reg (mode, op0);
if (mode != tmode)
target = 0;
/* Find the narrowest integer mode that contains the field. */ /* Find the narrowest integer mode that contains the field. */
...@@ -1782,6 +1780,9 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0, ...@@ -1782,6 +1780,9 @@ extract_fixed_bit_field (enum machine_mode tmode, rtx op0,
break; break;
} }
if (mode != tmode)
target = 0;
if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos)) if (GET_MODE_BITSIZE (mode) != (bitsize + bitpos))
{ {
int amount = 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> 2011-05-22 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae23.C: New. * g++.dg/cpp0x/sfinae23.C: New.
......
/* 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment