re PR tree-optimization/61681 (wrong code at -Os and above on x86_64-linux-gnu)

2014-07-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/61681
	* tree-ssa-structalias.c (find_what_var_points_to): Expand
	NONLOCAL inside ESCAPED.

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

From-SVN: r212349
This commit is contained in:
Richard Biener 2014-07-08 09:04:29 +00:00 committed by Richard Biener
parent e33f43b9a6
commit e8e938e0b0
4 changed files with 52 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/61681
* tree-ssa-structalias.c (find_what_var_points_to): Expand
NONLOCAL inside ESCAPED.
2014-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/61680

View File

@ -1,3 +1,8 @@
2014-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/61681
* gcc.dg/torture/pr61681.c: New testcase.
2014-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/61680

View File

@ -0,0 +1,37 @@
/* { dg-do run } */
extern void abort (void);
int a = 1, *e = &a, **f = &e, *l, *p, j;
static int b;
long d;
short g;
void
fn1 (int *p)
{
int m;
if (!(*p & j))
{
int *n = &m;
for (d = 6; d; d--)
{
for (g = 0; g < 1; g++)
{
n = l = *f;
b = *p;
}
*n = 0;
}
}
}
int
main ()
{
p = *f;
fn1 (p);
if (b != 0)
abort ();
return 0;
}

View File

@ -6106,6 +6106,10 @@ find_what_var_points_to (varinfo_t orig_vi)
pt->ipa_escaped = 1;
else
pt->escaped = 1;
/* Expand some special vars of ESCAPED in-place here. */
varinfo_t evi = get_varinfo (find (escaped_id));
if (bitmap_bit_p (evi->solution, nonlocal_id))
pt->nonlocal = 1;
}
else if (vi->id == nonlocal_id)
pt->nonlocal = 1;