Commit 1430fb1f by Martin Jambor Committed by Martin Jambor

[PR 69355] Correct hole detection when total_scalarization fails

2016-01-27  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/69355
	* tree-sra.c (analyze_access_subtree): Correct hole detection when
	total_scalarization fails.

testsuite/
	* gcc.dg/tree-ssa/pr69355.c: New test.

From-SVN: r232877
parent 95e3030c
2016-01-27 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/69355
* tree-sra.c (analyze_access_subtree): Correct hole detection when
total_scalarization fails.
2016-01-27 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/driver-rs6000.c (detect_processor_aix): Add
......
2016-01-27 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/69355
* gcc.dg/tree-ssa/pr69355.c: New test.
2016-01-27 Marek Polacek <polacek@redhat.com>
PR c++/69496
......
/* { dg-do run } */
/* { dg-options "-O -fno-strict-aliasing" } */
struct S
{
void *a;
long double b;
};
struct Z
{
long long l;
short s;
} __attribute__((packed));
struct S __attribute__((noclone, noinline))
foo (void *v, struct Z *z)
{
struct S t;
t.a = v;
*(struct Z *) &t.b = *z;
return t;
}
struct Z gz;
int
main (int argc, char **argv)
{
struct S s;
if (sizeof (long double) < sizeof (struct Z))
return 0;
gz.l = 0xbeef;
gz.s = 0xab;
s = foo ((void *) 0, &gz);
if ((((struct Z *) &s.b)->l != gz.l)
|| (((struct Z *) &s.b)->s != gz.s))
__builtin_abort ();
return 0;
}
......@@ -2421,7 +2421,7 @@ analyze_access_subtree (struct access *root, struct access *parent,
if (covered_to < limit)
hole = true;
if (scalar)
if (scalar || !allow_replacements)
root->grp_total_scalarization = 0;
}
......
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