re PR target/29319 (ICE unrecognizable insn: offset too large for larl (breaks glibc))

2006-11-27  Michael Matz  <matz@suse.de>
            Andreas Krebbel  <krebbel1@de.ibm.com>

	PR target/29319
	* config/s390/predicates.md (larl_operand): Check addend of larl
	operand to be in range of -/+2GB.
	* config/s390/s390.c (legitimize_pic_address): Likewise.  
	Changed type of variable even to HOST_WIDE_INT.

2006-11-27  Michael Matz  <matz@suse.de>
            Andreas Krebbel  <krebbel1@de.ibm.com>

	PR target/29319
	* gcc.dg/20061127-1.c: New testcase.


Co-Authored-By: Andreas Krebbel <krebbel1@de.ibm.com>

From-SVN: r119256
This commit is contained in:
Michael Matz 2006-11-27 16:34:19 +00:00 committed by Andreas Krebbel
parent 9409c2f5a4
commit e064939e4a
5 changed files with 50 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2006-11-27 Michael Matz <matz@suse.de>
Andreas Krebbel <krebbel1@de.ibm.com>
PR target/29319
* config/s390/predicates.md (larl_operand): Check addend of larl
operand to be in range of -/+2GB.
* config/s390/s390.c (legitimize_pic_address): Likewise.
Changed type of variable even to HOST_WIDE_INT.
2006-11-27 Jan Hubicka <jh@suse.cz>
* expr.c (emit_block_move_via_libcall): Export.

View File

@ -126,8 +126,8 @@
if (GET_CODE (XEXP (op, 1)) != CONST_INT
|| (INTVAL (XEXP (op, 1)) & 1) != 0)
return false;
if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 32
|| INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 32))
if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 31
|| INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 31))
return false;
op = XEXP (op, 0);
}

View File

@ -3020,7 +3020,10 @@ legitimize_pic_address (rtx orig, rtx reg)
|| (GET_CODE (op0) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (op0)))
&& GET_CODE (op1) == CONST_INT)
{
if (TARGET_CPU_ZARCH && larl_operand (op0, VOIDmode))
if (TARGET_CPU_ZARCH
&& larl_operand (op0, VOIDmode)
&& INTVAL (op1) < (HOST_WIDE_INT)1 << 31
&& INTVAL (op1) >= -((HOST_WIDE_INT)1 << 31))
{
if (INTVAL (op1) & 1)
{
@ -3030,7 +3033,7 @@ legitimize_pic_address (rtx orig, rtx reg)
if (!DISP_IN_RANGE (INTVAL (op1)))
{
int even = INTVAL (op1) - 1;
HOST_WIDE_INT even = INTVAL (op1) - 1;
op0 = gen_rtx_PLUS (Pmode, op0, GEN_INT (even));
op0 = gen_rtx_CONST (Pmode, op0);
op1 = const1_rtx;

View File

@ -1,3 +1,9 @@
2006-11-27 Michael Matz <matz@suse.de>
Andreas Krebbel <krebbel1@de.ibm.com>
PR target/29319
* gcc.dg/20061127-1.c: New testcase.
2006-11-27 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/20061124-1.c: Add exit() function prototype.

View File

@ -0,0 +1,28 @@
/* { dg-do compile { target lp64 } } */
/* { dg-options "-O1 -fPIC" } */
/* PR target/29319 */
extern void abort(void);
static char l_info[100];
void
bug1 (unsigned long tag)
{
char *info = l_info;
info[tag - 0x100000000 + 1] = 1;
}
void
bug2 (unsigned long tag)
{
char *info = l_info;
info[tag - 0x700000000 + 2] = 2;
}
void
bug3 (unsigned long tag)
{
char *info = l_info;
info[tag - 0x100000000 + 1] = 3;
}