+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
+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
--- /dev/null
+/* { 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);
+}
+
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));