re PR debug/43557 (ICE with -combine and -g)

PR debug/43557
	* cfgexpand.c (expand_debug_expr): Handle VOIDmode mode like
	BLKmode.

	* gcc.dg/pr43557-1.c: New test.
	* gcc.dg/pr43557-2.c: New file.

From-SVN: r157852
This commit is contained in:
Jakub Jelinek 2010-03-31 10:39:22 +02:00 committed by Jakub Jelinek
parent 9db4e87892
commit 132b4e8295
5 changed files with 40 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2010-03-31 Jakub Jelinek <jakub@redhat.com>
PR debug/43557
* cfgexpand.c (expand_debug_expr): Handle VOIDmode mode like
BLKmode.
2010-03-31 Jie Zhang <jie@codesourcery.com>
PR 43562

View file

@ -2358,7 +2358,8 @@ expand_debug_expr (tree exp)
/* If op0 is not BLKmode, but BLKmode is, adjust_mode
below would ICE. While it is likely a FE bug,
try to be robust here. See PR43166. */
|| mode == BLKmode)
|| mode == BLKmode
|| (mode == VOIDmode && GET_MODE (op0) != VOIDmode))
{
gcc_assert (MEM_P (op0));
op0 = adjust_address_nv (op0, mode, 0);

View file

@ -1,3 +1,9 @@
2010-03-31 Jakub Jelinek <jakub@redhat.com>
PR debug/43557
* gcc.dg/pr43557-1.c: New test.
* gcc.dg/pr43557-2.c: New file.
2010-03-31 Jie Zhang <jie@codesourcery.com>
PR 43562

View file

@ -0,0 +1,16 @@
/* PR debug/43557 */
/* { dg-do compile } */
/* { dg-options "--combine -g -O2" } */
/* { dg-additional-sources "pr43557-2.c" } */
struct S
{
int v;
} g;
void
f1 (void)
{
struct S *s = &g;
s->v = 0;
}

View file

@ -0,0 +1,10 @@
/* PR debug/43557 */
/* { dg-do compile } */
extern struct S g;
void
f2 (void)
{
&g;
}