re PR tree-optimization/86017 (multiple consecutive calls to bzero/memset not merged)
2018-06-01 Richard Biener <rguenther@suse.de> PR middle-end/86017 * gimple-fold.c (var_decl_component_p): Also allow offsetted vars wrapped in MEM_REFs. * gcc.dg/tree-ssa/pr86017.c: New testcase. From-SVN: r261061
This commit is contained in:
parent
abc24d932c
commit
47cac108ef
4 changed files with 43 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2018-06-01 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/86017
|
||||
* gimple-fold.c (var_decl_component_p): Also allow offsetted
|
||||
vars wrapped in MEM_REFs.
|
||||
|
||||
2018-06-01 Richard Sandiford <richard.sandiford@linaro.org>
|
||||
|
||||
* config/aarch64/aarch64.c (aarch64_ira_change_pseudo_allocno_class):
|
||||
|
|
|
@ -632,7 +632,9 @@ var_decl_component_p (tree var)
|
|||
tree inner = var;
|
||||
while (handled_component_p (inner))
|
||||
inner = TREE_OPERAND (inner, 0);
|
||||
return SSA_VAR_P (inner);
|
||||
return (DECL_P (inner)
|
||||
|| (TREE_CODE (inner) == MEM_REF
|
||||
&& TREE_CODE (TREE_OPERAND (inner, 0)) == ADDR_EXPR));
|
||||
}
|
||||
|
||||
/* If the SIZE argument representing the size of an object is in a range
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2018-06-01 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/86017
|
||||
* gcc.dg/tree-ssa/pr86017.c: New testcase.
|
||||
|
||||
2018-06-01 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR ipa/85960
|
||||
|
|
29
gcc/testsuite/gcc.dg/tree-ssa/pr86017.c
Normal file
29
gcc/testsuite/gcc.dg/tree-ssa/pr86017.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-tree-store-merging" } */
|
||||
|
||||
void f (void*);
|
||||
|
||||
void g (void)
|
||||
{
|
||||
char a[8];
|
||||
__builtin_memset (a, 0, 8);
|
||||
|
||||
f (a);
|
||||
}
|
||||
|
||||
void h (void)
|
||||
{
|
||||
char a[8];
|
||||
__builtin_memset (a, 0, 1);
|
||||
__builtin_memset (a + 1, 0, 1);
|
||||
__builtin_memset (a + 2, 0, 1);
|
||||
__builtin_memset (a + 3, 0, 1);
|
||||
__builtin_memset (a + 4, 0, 1);
|
||||
__builtin_memset (a + 5, 0, 1);
|
||||
__builtin_memset (a + 6, 0, 1);
|
||||
__builtin_memset (a + 7, 0, 1);
|
||||
|
||||
f (a);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump "Merged into 1 stores" "store-merging" } } */
|
Loading…
Add table
Reference in a new issue