mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 10:26:16 +08:00
Fix PR/70013
gcc: PR tree-optimization/70013 * tree-sra.c (analyze_access_subtree): Also set grp_unscalarized_data for constant-pool entries. gcc/testsuite: * gcc.dg/tree-ssa/sra-20.c: New. From-SVN: r234138
This commit is contained in:
parent
686d390a8f
commit
5c6706f77e
@ -1,3 +1,9 @@
|
||||
2016-03-11 Alan Lawrence <alan.lawrence@arm.com>
|
||||
|
||||
PR tree-optimization/70013
|
||||
* tree-sra.c (analyze_access_subtree): Also set grp_unscalarized_data
|
||||
for constant-pool entries.
|
||||
|
||||
2016-03-11 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR rtl-optimization/70174
|
||||
|
@ -1,3 +1,7 @@
|
||||
2016-03-11 Alan Lawrence <alan.lawrence@arm.com>
|
||||
|
||||
* gcc.dg/tree-ssa/sra-20.c: New.
|
||||
|
||||
2016-03-11 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR rtl-optimization/70174
|
||||
|
20
gcc/testsuite/gcc.dg/tree-ssa/sra-20.c
Normal file
20
gcc/testsuite/gcc.dg/tree-ssa/sra-20.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O1 -Wall" } */
|
||||
/* PR/70013, SRA of constant-pool loads removes initialization of part of d. */
|
||||
#pragma pack (1)
|
||||
struct S0 {
|
||||
unsigned f0 : 17;
|
||||
};
|
||||
|
||||
int c;
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
struct S0 d[] = { { 1 }, { 2 } };
|
||||
struct S0 e = d[1];
|
||||
|
||||
c = d[0].f0;
|
||||
__builtin_printf ("%x\n", e.f0);
|
||||
return 0;
|
||||
}
|
@ -2427,7 +2427,8 @@ analyze_access_subtree (struct access *root, struct access *parent,
|
||||
|
||||
if (!hole || root->grp_total_scalarization)
|
||||
root->grp_covered = 1;
|
||||
else if (root->grp_write || TREE_CODE (root->base) == PARM_DECL)
|
||||
else if (root->grp_write || TREE_CODE (root->base) == PARM_DECL
|
||||
|| constant_decl_p (root->base))
|
||||
root->grp_unscalarized_data = 1; /* not covered and written to */
|
||||
return sth_created;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user