Commit 4c8160e7 by Richard Guenther Committed by Richard Biener

re PR lto/41669 (Infinite recursion trying to build gcc)

2009-10-15  Richard Guenther  <rguenther@suse.de>

	PR lto/41669
	* gimple.c (gimple_get_alias_set): Avoid recursing on
	invalid type topology.

	* gcc.dg/lto/20091015-1_0.c: New testcase.
	* gcc.dg/lto/20091015-1_1.c: Likewise.
	* gcc.dg/lto/20091015-1_2.c: Likewise.
	* gcc.dg/lto/20091015-1_a.h: Likewise.
	* gcc.dg/lto/20091015-1_b.h: Likewise.

From-SVN: r152850
parent b8b6edc9
2009-10-15 Richard Guenther <rguenther@suse.de>
PR lto/41669
* gimple.c (gimple_get_alias_set): Avoid recursing on
invalid type topology.
2009-10-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
* config/spu/spu.c (get_branch_target): Use extract_asm_operands.
......@@ -4111,6 +4111,7 @@ gimple_signed_type (tree type)
alias_set_type
gimple_get_alias_set (tree t)
{
static bool recursing_p;
tree u;
/* Permit type-punning when accessing a union, provided the access
......@@ -4152,6 +4153,12 @@ gimple_get_alias_set (tree t)
{
tree t1;
/* ??? We can end up creating cycles with TYPE_MAIN_VARIANT
and TYPE_CANONICAL. Avoid recursing endlessly between
this langhook and get_alias_set. */
if (recursing_p)
return -1;
/* Unfortunately, there is no canonical form of a pointer type.
In particular, if we have `typedef int I', then `int *', and
`I *' are different types. So, we have to pick a canonical
......@@ -4176,7 +4183,13 @@ gimple_get_alias_set (tree t)
C++ committee. */
t1 = build_type_no_quals (t);
if (t1 != t)
return get_alias_set (t1);
{
alias_set_type set;
recursing_p = true;
set = get_alias_set (t1);
recursing_p = false;
return set;
}
}
return -1;
......
2009-10-15 Richard Guenther <rguenther@suse.de>
PR lto/41669
* gcc.dg/lto/20091015-1_0.c: New testcase.
* gcc.dg/lto/20091015-1_1.c: Likewise.
* gcc.dg/lto/20091015-1_2.c: Likewise.
* gcc.dg/lto/20091015-1_a.h: Likewise.
* gcc.dg/lto/20091015-1_b.h: Likewise.
2009-10-15 Steve Ellcey <sje@cup.hp.com>
* gcc.dg/torture/pr41555.c: Add -std=c99 option.
......
/* { dg-lto-do link } */
/* { dg-lto-options {{-fPIC -shared -O2 -flto} {-fPIC -shared -O2 -fwhopr}} } */
#include "20091015-1_b.h"
void diagnostic_initialize (FILE **stream) { *stream = stderr; }
#include "20091015-1_a.h"
#include "20091015-1_b.h"
void ggc_print_common_statistics (FILE *stream) {
}
#include "20091015-1_a.h"
#include "20091015-1_b.h"
void debug_optab_libfuncs (void) {
foo (stderr, 4 );
}
struct _IO_FILE { int _flags;
};
typedef struct _IO_FILE FILE;
extern struct _IO_FILE *stderr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment