re PR middle-end/52693 (Wrong code with SRA and arrays)
2012-03-27 Martin Jambor <mjambor@suse.cz> PR middle-end/52693 * tree-sra.c (sra_modify_assign): Do not call load_assign_lhs_subreplacements when working with an unscalarizable region. * testsuite/gcc.dg/torture/pr52693.c: New test. From-SVN: r185891
This commit is contained in:
parent
9a1cb58a99
commit
429576acea
4 changed files with 52 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-03-27 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
PR middle-end/52693
|
||||
* tree-sra.c (sra_modify_assign): Do not call
|
||||
load_assign_lhs_subreplacements when working with an unscalarizable
|
||||
region.
|
||||
|
||||
2012-03-27 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/52698
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2012-03-27 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
PR middle-end/52693
|
||||
* gcc.dg/torture/pr52693.c: New test.
|
||||
|
||||
2012-03-27 Meador Inge <meadori@codesourcery.com>
|
||||
|
||||
PR c++/52672
|
||||
|
|
33
gcc/testsuite/gcc.dg/torture/pr52693.c
Normal file
33
gcc/testsuite/gcc.dg/torture/pr52693.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
/* { dg-do run } */
|
||||
|
||||
struct pair
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct array
|
||||
{
|
||||
struct pair elems[ 2 ];
|
||||
unsigned index;
|
||||
};
|
||||
|
||||
extern void abort ();
|
||||
|
||||
void __attribute__ ((noinline,noclone))
|
||||
test_results (int x1, int y1, int x2, int y2)
|
||||
{
|
||||
if (x1 != x2 || y1 != y2)
|
||||
abort ();
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
struct array arr = {{{1,2}, {3,4}}, 1};
|
||||
struct pair last = arr.elems[arr.index];
|
||||
|
||||
test_results ( last.x, last.y, arr.elems[1].x, arr.elems[1].y);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -3071,7 +3071,13 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (access_has_children_p (lacc) && access_has_children_p (racc))
|
||||
if (access_has_children_p (lacc)
|
||||
&& access_has_children_p (racc)
|
||||
/* When an access represents an unscalarizable region, it usually
|
||||
represents accesses with variable offset and thus must not be used
|
||||
to generate new memory accesses. */
|
||||
&& !lacc->grp_unscalarizable_region
|
||||
&& !racc->grp_unscalarizable_region)
|
||||
{
|
||||
gimple_stmt_iterator orig_gsi = *gsi;
|
||||
enum unscalarized_data_handling refreshed;
|
||||
|
|
Loading…
Add table
Reference in a new issue