Commit 46771da5 by Feng Xue Committed by Feng Xue

re PR ipa/90401 (Missed propagation of by-ref constant argument to callee function)

PR ipa/90401

gcc/ChangeLog:

	* ipa-prop.c (add_to_agg_contents_list): New function.
	(clobber_by_agg_contents_list_p): Likewise.
	(extract_mem_content): Likewise.
	(get_place_in_agg_contents_list): Delete.
	(determine_known_aggregate_parts): Renamed from
	determine_locally_known_aggregate_parts.  New parameter
	aa_walk_budget_p.

gcc/testsuite/ChangeLog:

	* gcc.dg/ipa/ipcp-agg-10.c: New test.

From-SVN: r272282
parent bc09939d
2019-06-14 Feng Xue <fxue@os.amperecomputing.com>
PR ipa/90401
* ipa-prop.c (add_to_agg_contents_list): New function.
(clobber_by_agg_contents_list_p): Likewise.
(extract_mem_content): Likewise.
(get_place_in_agg_contents_list): Delete.
(determine_known_aggregate_parts): Renamed from
determine_locally_known_aggregate_parts. New parameter
aa_walk_budget_p.
2019-06-13 Martin Sebor <msebor@redhat.com>
PR tree-optimization/90662
......
2019-06-14 Feng Xue <fxue@os.amperecomputing.com>
PR ipa/90401
* gcc.dg/ipa/ipcp-agg-10.c: New test.
2019-06-13 Martin Sebor <msebor@redhat.com>
PR tree-optimization/90662
......
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-ipa-cp-details -fno-inline" } */
int data1;
int callee1(int *v)
{
if (*v < 2)
return 0;
else
{
int t = data1;
data1 = *v;
*v = t;
return 1;
}
}
int __attribute__((pure)) callee2(int *v)
{
if (*v < 2)
return 0;
else
{
data1 = v[0] + v[2];
return 1;
}
}
int caller1(int c, int *r)
{
int a = 1;
if (c)
return callee1(&a);
else
{
*r = 2;
return callee1(r);
}
}
int data2[200];
int data3;
int __attribute__((const)) gen_cond(int);
int caller2(void)
{
int i, j;
int sum = 0;
int a[8];
a[0] = 3;
for (i = 0; i < 100; i++)
{
if (gen_cond (i))
continue;
a[2] = 4;
for (j = 0; j < 100; j++)
{
data2[i + j] = (i ^ j) + data3;
sum += callee2(a);
}
}
return sum;
}
/* { dg-final { scan-ipa-dump-times "offset: 0, cst: 1" 1 "cp" } } */
/* { dg-final { scan-ipa-dump-times "offset: 0, cst: 2" 1 "cp" } } */
/* { dg-final { scan-ipa-dump-times "offset: 0, cst: 3" 1 "cp" } } */
/* { dg-final { scan-ipa-dump-times "offset: 64, cst: 4" 1 "cp" } } */
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