re PR target/47201 (ICE: SIGSEGV in adjust_mems (var-tracking.c:814) with -O -fPIC -g)

PR target/47201
	* config/i386/i386.c (ix86_delegitimize_address): If
	simplify_gen_subreg fails, return orig_x.

	* gcc.dg/pr47201.c: New test.

From-SVN: r168582
This commit is contained in:
Jakub Jelinek 2011-01-07 19:41:40 +01:00 committed by Jakub Jelinek
parent c6a8f6de08
commit c21bbd7a5e
4 changed files with 36 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2011-01-07 Jakub Jelinek <jakub@redhat.com>
PR target/47201
* config/i386/i386.c (ix86_delegitimize_address): If
simplify_gen_subreg fails, return orig_x.
PR bootstrap/47187
* value-prof.c (gimple_stringop_fixed_value): Handle
lhs of the call properly.

View File

@ -1,6 +1,6 @@
/* Subroutines used for code generation on IA-32.
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@ -13254,7 +13254,11 @@ ix86_delegitimize_address (rtx x)
return ix86_delegitimize_tls_address (orig_x);
x = XVECEXP (XEXP (x, 0), 0, 0);
if (GET_MODE (orig_x) != Pmode)
return simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
{
x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
if (x == NULL_RTX)
return orig_x;
}
return x;
}
@ -13323,7 +13327,11 @@ ix86_delegitimize_address (rtx x)
return orig_x;
}
if (GET_MODE (orig_x) != Pmode && MEM_P (orig_x))
return simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
{
result = simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
if (result == NULL_RTX)
return orig_x;
}
return result;
}

View File

@ -1,5 +1,8 @@
2011-01-07 Jakub Jelinek <jakub@redhat.com>
PR target/47201
* gcc.dg/pr47201.c: New test.
PR bootstrap/47187
* gcc.dg/tree-prof/pr47187.c: New test.

View File

@ -0,0 +1,18 @@
/* PR target/47201 */
/* { dg-do compile } */
/* { dg-options "-O -fpic -g" { target fpic } } */
union U
{
__UINTPTR_TYPE__ m;
float d;
} u;
int
foo (void)
{
union U v = {
(__UINTPTR_TYPE__)&u
};
return u.d == v.d;
}