diff options
author | Richard Guenther <rguenther@suse.de> | 2009-04-06 14:16:15 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-04-06 14:16:15 +0000 |
commit | 4bad83f55a7df9d7ee7660e4be87245da4aa8b69 (patch) | |
tree | 2c6e715b64be648e18f15050199b1eb3b029cfb2 /gcc | |
parent | 94986f6d3503507f78d2d9d10cd0b98f8f65ce3f (diff) | |
download | gcc-4bad83f55a7df9d7ee7660e4be87245da4aa8b69.zip gcc-4bad83f55a7df9d7ee7660e4be87245da4aa8b69.tar.gz gcc-4bad83f55a7df9d7ee7660e4be87245da4aa8b69.tar.bz2 |
re PR tree-optimization/39643 (cris-elf gcc.dg/torture/builtin-math-3.c -O1 and -Os sincos one)
2009-04-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39643
* tree-ssa-ccp.c (ccp_fold): Fold REALPART_EXPRs and
IMAGPART_EXPRs of complex constants.
(execute_fold_all_builtins): If we folded a call queue
TODO_update_address_taken.
From-SVN: r145604
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-ccp.c | 11 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17ebd6d..2411dd1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2009-04-06 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/39643 + * tree-ssa-ccp.c (ccp_fold): Fold REALPART_EXPRs and + IMAGPART_EXPRs of complex constants. + (execute_fold_all_builtins): If we folded a call queue + TODO_update_address_taken. + 2009-04-06 Jan Hubicka <jh@suse.cz> PR middle-end/39659 diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 6d8e88e..2f39658 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -949,12 +949,14 @@ ccp_fold (gimple stmt) if (kind == tcc_reference) { - if (TREE_CODE (rhs) == VIEW_CONVERT_EXPR + if ((TREE_CODE (rhs) == VIEW_CONVERT_EXPR + || TREE_CODE (rhs) == REALPART_EXPR + || TREE_CODE (rhs) == IMAGPART_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, + return fold_unary (TREE_CODE (rhs), TREE_TYPE (rhs), val->value); } else if (TREE_CODE (rhs) == INDIRECT_REF @@ -3270,7 +3272,10 @@ execute_fold_all_builtins (void) push_stmt_changes (gsi_stmt_ptr (&i)); if (!update_call_from_tree (&i, result)) - gimplify_and_update_call_from_tree (&i, result); + { + gimplify_and_update_call_from_tree (&i, result); + todoflags |= TODO_update_address_taken; + } stmt = gsi_stmt (i); pop_stmt_changes (gsi_stmt_ptr (&i)); |