mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 15:01:17 +08:00
re PR tree-optimization/39713 (ICE in get_expr_value_id)
2009-04-11 Richard Guenther <rguenther@suse.de> PR tree-optimization/39713 * tree-ssa-sccvn.c (vn_get_expr_for): Make sure built reference trees have SSA_NAME operands. * g++.dg/torture/pr39713.C: New testcase. From-SVN: r145951
This commit is contained in:
parent
fa78c0c18b
commit
8810712ed9
@ -1,3 +1,9 @@
|
||||
2009-04-11 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/39713
|
||||
* tree-ssa-sccvn.c (vn_get_expr_for): Make sure built
|
||||
reference trees have SSA_NAME operands.
|
||||
|
||||
2009-04-11 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c/39712
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-04-11 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/39713
|
||||
* g++.dg/torture/pr39713.C: New testcase.
|
||||
|
||||
2009-04-10 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c/39712
|
||||
|
25
gcc/testsuite/g++.dg/torture/pr39713.C
Normal file
25
gcc/testsuite/g++.dg/torture/pr39713.C
Normal file
@ -0,0 +1,25 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
template <typename To, typename From>
|
||||
static inline To
|
||||
bitwise_cast (From from)
|
||||
{
|
||||
union
|
||||
{
|
||||
From f;
|
||||
To t;
|
||||
} u;
|
||||
u.f = from;
|
||||
return u.t;
|
||||
}
|
||||
|
||||
extern void foo (unsigned char *);
|
||||
|
||||
double
|
||||
bar ()
|
||||
{
|
||||
unsigned char b[sizeof (unsigned long long)];
|
||||
foo (b);
|
||||
return bitwise_cast<double> (*(unsigned long long *) b);
|
||||
}
|
||||
|
@ -257,9 +257,10 @@ vn_get_expr_for (tree name)
|
||||
switch (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)))
|
||||
{
|
||||
case tcc_reference:
|
||||
if (gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR
|
||||
|| gimple_assign_rhs_code (def_stmt) == REALPART_EXPR
|
||||
|| gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR)
|
||||
if ((gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR
|
||||
|| gimple_assign_rhs_code (def_stmt) == REALPART_EXPR
|
||||
|| gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR)
|
||||
&& TREE_CODE (gimple_assign_rhs1 (def_stmt)) == SSA_NAME)
|
||||
expr = fold_build1 (gimple_assign_rhs_code (def_stmt),
|
||||
gimple_expr_type (def_stmt),
|
||||
TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0));
|
||||
|
Loading…
x
Reference in New Issue
Block a user