+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-ccp.c (ccp_fold): Fold VIEW_CONVERT_EXPRs of constants.
+
2008-08-21 Jan Hubicka <jh@suse.cz>
* cgraph.c (first_cgraph_function_insertion_hook): New variable.
+2008-08-21 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/vect/vect-fold-1.c: Scan ccp1 dump instead of dom1.
+
2008-08-21 Richard Guenther <rguenther@suse.de>
PR middle-end/36817
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom1" } */
+/* { dg-options "-O2 -fdump-tree-ccp1" } */
typedef unsigned char v4qi __attribute__ ((vector_size (4)));
c = a + b;
}
-/* { dg-final { scan-tree-dump-times "c = { 6, 8, 10, 12 }" 1 "dom1" } } */
-/* { dg-final { cleanup-tree-dump "dom1" } } */
+/* { dg-final { scan-tree-dump-times "c =.* { 6, 8, 10, 12 }" 1 "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
}
if (kind == tcc_reference)
- return fold_const_aggregate_ref (rhs);
+ {
+ if (TREE_CODE (rhs) == VIEW_CONVERT_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (TREE_OPERAND (rhs, 0));
+ if (val->lattice_val == CONSTANT)
+ return fold_unary (VIEW_CONVERT_EXPR,
+ TREE_TYPE (rhs), val->value);
+ }
+ return fold_const_aggregate_ref (rhs);
+ }
else if (kind == tcc_declaration)
return get_symbol_constant_value (rhs);
return rhs;