re PR tree-optimization/38865 (missing FRE with VIEW_CONVERT_EXPR)
2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/38865 * tree-ssa-sccvn.c (visit_reference_op_load): If vn_reference_lookup is returns NULL and OP is a VCE, look through the VCE. 2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/38865 * gcc.dg/tree-ssa/fre-vce-1.c : From-SVN: r148437
This commit is contained in:
parent
d3a0d55d66
commit
737142ced7
4 changed files with 52 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
PR tree-opt/38865
|
||||
* tree-ssa-sccvn.c (visit_reference_op_load): If vn_reference_lookup
|
||||
is returns NULL and OP is a VCE, look through the VCE.
|
||||
|
||||
2009-06-12 Ian Lance Taylor <iant@google.com>
|
||||
|
||||
PR bootstrap/40430
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2009-06-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
|
||||
|
||||
PR tree-opt/38865
|
||||
* gcc.dg/tree-ssa/fre-vce-1.c
|
||||
|
||||
2009-06-12 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR testsuite/40384
|
||||
|
|
35
gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
Normal file
35
gcc/testsuite/gcc.dg/tree-ssa/fre-vce-1.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/* { dg-options "-O2 -fdump-tree-fre -w" } */
|
||||
/* { dg-do compile } */
|
||||
#define vector __attribute__((vector_size(sizeof(int)*4) ))
|
||||
struct s { vector int i; };
|
||||
vector float f(struct s *sv)
|
||||
{
|
||||
sv->i = (vector int){1, 2, 3, 4};
|
||||
return (vector float)sv->i;
|
||||
}
|
||||
|
||||
|
||||
vector float f1(struct s *sv, vector int a)
|
||||
{
|
||||
sv->i = a;
|
||||
return (vector float)sv->i;
|
||||
}
|
||||
|
||||
struct s1 { int i; };
|
||||
|
||||
void g(struct s1 *, float);
|
||||
void a1 (struct s1 sv)
|
||||
{
|
||||
sv.i = 1;
|
||||
g(&sv, *(float*)&sv.i);
|
||||
}
|
||||
|
||||
|
||||
void a2 (struct s1 sv, int i)
|
||||
{
|
||||
sv.i = i;
|
||||
g(&sv, *(float*)&sv.i);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre" } } */
|
||||
/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre" } } */
|
|
@ -1976,6 +1976,12 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt)
|
|||
bool changed = false;
|
||||
tree result = vn_reference_lookup (op, gimple_vuse (stmt), true, NULL);
|
||||
|
||||
/* If we have a VCE, try looking up its operand as it might be stored in
|
||||
a different type. */
|
||||
if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR)
|
||||
result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt),
|
||||
true, NULL);
|
||||
|
||||
/* We handle type-punning through unions by value-numbering based
|
||||
on offset and size of the access. Be prepared to handle a
|
||||
type-mismatch here via creating a VIEW_CONVERT_EXPR. */
|
||||
|
|
Loading…
Add table
Reference in a new issue