Commit 4be68d9a by Richard Guenther Committed by Richard Biener

re PR tree-optimization/43879 (-fipa-pta causes various miscompilations)

2010-04-30  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/43879
	* tree-ssa-structalias.c (get_constraint_for_1): Properly
	handle non-zero initializers.

	* gcc.dg/torture/pr43879_1.c: New testcase.

From-SVN: r158924
parent 06468254
2010-04-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43879
* tree-ssa-structalias.c (get_constraint_for_1): Properly
handle non-zero initializers.
2010-04-30 Richard Guenther <rguenther@suse.de>
* builtins.c (fold_builtin_1): Delete free (0).
2010-04-29 Jan HUbicka <jh@suse.cz>
......
2010-04-30 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43879
* gcc.dg/torture/pr43879_1.c: New testcase.
2010-04-30 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/builtin-free.c: New testcase.
2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
......
/* { dg-do run } */
/* { dg-options "-fipa-pta" } */
/* { dg-additional-sources "pr43879_2.c" } */
void bar(int c)
{
static int x = 1;
if (c != x) __builtin_abort();
x--;
}
void baz(int *i)
{
(*i)--;
}
struct TBL {
int (*p)(int *i);
};
extern struct TBL tbl;
int main()
{
int c = 1;
return tbl.p(&c);
}
struct TBL {
int (*p)(int *i);
};
extern void bar(int i);
extern void baz(int *i);
static int foo(int *i)
{
bar(*i);
baz(i);
bar(*i);
return *i;
}
struct TBL tbl = { foo };
......@@ -3285,8 +3285,10 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
&& ((TREE_CODE (t) == INTEGER_CST
&& integer_zerop (t))
/* The only valid CONSTRUCTORs in gimple with pointer typed
elements are zero-initializer. */
|| TREE_CODE (t) == CONSTRUCTOR))
elements are zero-initializer. But in IPA mode we also
process global initializers, so verify at least. */
|| (TREE_CODE (t) == CONSTRUCTOR
&& CONSTRUCTOR_NELTS (t) == 0)))
{
temp.var = nothing_id;
temp.type = ADDRESSOF;
......
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