re PR debug/41893 (ICE with -combine and debug)

PR debug/41893
	* cfgexpand.c (expand_debug_expr): Don't attempt to create DECL_RTL
	for a VOIDmode variable.

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

From-SVN: r153806
This commit is contained in:
Jakub Jelinek 2009-11-02 14:55:41 +01:00 committed by Jakub Jelinek
parent 9789ba46f6
commit 0fba566cb5
5 changed files with 33 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR debug/41893
* cfgexpand.c (expand_debug_expr): Don't attempt to create DECL_RTL
for a VOIDmode variable.
PR c++/41774
* c-pragma.c (visstack): Change into vector of ints rather than
enum symbol_visibility.

View File

@ -2349,7 +2349,8 @@ expand_debug_expr (tree exp)
|| DECL_EXTERNAL (exp)
|| !TREE_STATIC (exp)
|| !DECL_NAME (exp)
|| DECL_HARD_REGISTER (exp))
|| DECL_HARD_REGISTER (exp)
|| mode == VOIDmode)
return NULL;
op0 = DECL_RTL (exp);

View File

@ -1,5 +1,9 @@
2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR debug/41893
* gcc.dg/debug/pr41893-1.c: New test.
* gcc.dg/debug/pr41893-2.c: New file.
PR c++/41774
* g++.dg/ext/visibility/namespace3.C: New test.

View File

@ -0,0 +1,13 @@
/* PR debug/41893 */
/* { dg-do compile } */
/* { dg-options "-combine -fwhole-program -O" } */
/* { dg-additional-sources "pr41893-2.c" } */
struct S { int v; };
struct S s;
void __attribute__((externally_visible))
func1 (void)
{
struct S *p = &s;
}

View File

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