lower-subreg.c (can_decompose_p): Check every word of a hard register.

gcc/
	* lower-subreg.c (can_decompose_p): Check every word of a hard
	register.

From-SVN: r182500
This commit is contained in:
Richard Sandiford 2011-12-19 21:19:13 +00:00 committed by Richard Sandiford
parent 176fcc5d18
commit 488c8379f4
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-12-19 Richard Sandiford <rdsandiford@googlemail.com>
* lower-subreg.c (can_decompose_p): Check every word of a hard
register.
2011-12-19 Sandra Loosemore <sandra@codesourcery.com>
Tom de Vries <tom@codesourcery.com>

View File

@ -634,8 +634,15 @@ can_decompose_p (rtx x)
unsigned int regno = REGNO (x);
if (HARD_REGISTER_NUM_P (regno))
return (validate_subreg (word_mode, GET_MODE (x), x, UNITS_PER_WORD)
&& HARD_REGNO_MODE_OK (regno, word_mode));
{
unsigned int byte, num_bytes;
num_bytes = GET_MODE_SIZE (GET_MODE (x));
for (byte = 0; byte < num_bytes; byte += UNITS_PER_WORD)
if (simplify_subreg_regno (regno, GET_MODE (x), byte, word_mode) < 0)
return false;
return true;
}
else
return !bitmap_bit_p (subreg_context, regno);
}