s390.c (s390_decompose_address): Reject non-literal pool references in UNSPEC_LTREL_OFFSET.

2011-03-04  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/s390/s390.c (s390_decompose_address): Reject non-literal
	pool references in UNSPEC_LTREL_OFFSET.

From-SVN: r170685
This commit is contained in:
Andreas Krebbel 2011-03-04 20:47:11 +00:00 committed by Andreas Krebbel
parent 78a8b16bad
commit bc6ce33429
2 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-03-04 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_decompose_address): Reject non-literal
pool references in UNSPEC_LTREL_OFFSET.
2011-03-04 Jan Hubicka <jh@suse.cz>
PR lto/47497

View File

@ -2065,6 +2065,16 @@ s390_decompose_address (rtx addr, struct s390_address *out)
else if (GET_CODE (disp) == UNSPEC
&& XINT (disp, 1) == UNSPEC_LTREL_OFFSET)
{
/* In case CSE pulled a non literal pool reference out of
the pool we have to reject the address. This is
especially important when loading the GOT pointer on non
zarch CPUs. In this case the literal pool contains an lt
relative offset to the _GLOBAL_OFFSET_TABLE_ label which
will most likely exceed the displacement. */
if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
|| !CONSTANT_POOL_ADDRESS_P (XVECEXP (disp, 0, 0)))
return false;
orig_disp = gen_rtx_CONST (Pmode, disp);
if (offset)
{