Commit c0d4fec7 by Kyrylo Tkachov Committed by Kyrylo Tkachov

[tree-ssa-address] Avoid creating non-canonical RTL in gen_addr_rtx

	* tree-ssa-address.c (gen_addr_rtx): Don't handle index if it
	is const0_rtx.

	* gcc.dg/20161219.c: New test.

From-SVN: r244219
parent 7b1b0cc1
2017-01-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* tree-ssa-address.c (gen_addr_rtx): Don't handle index if it
is const0_rtx.
2017-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/78997
......
2017-01-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.dg/20161219.c: New test.
2017-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/78997
......
/* { dg-do assemble } */
/* { dg-options "-O1 -w" } */
static long long a[9];
int b, c, d, e, g;
static int
fn1 (int *p1)
{
b = 1;
for (; b >= 0; b--)
{
d = 0;
for (;; d++)
{
e && (a[d] = 0);
if (*p1)
break;
c = (int) a;
}
}
return 0;
}
int
main ()
{
int f = fn1 ((int *) f);
return f;
}
......@@ -115,7 +115,7 @@ gen_addr_rtx (machine_mode address_mode,
if (offset_p)
*offset_p = NULL;
if (index)
if (index && index != const0_rtx)
{
act_elem = index;
if (step)
......
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