diff options
author | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 14:56:45 +0000 |
---|---|---|
committer | pinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-23 14:56:45 +0000 |
commit | 81616626d923637076a1eb23d24ae93e9ccdc575 (patch) | |
tree | 711dff16c947cdd28322b754bcd859f81158a7fd /gcc/tree-ssa-ccp.c | |
parent | a787ab78c65e5bbd3c8725a345a6128ca81a3489 (diff) | |
download | gcc-81616626d923637076a1eb23d24ae93e9ccdc575.tar.gz |
2006-01-23 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24437
* tree-ssa-ccp.c (fold_stmt): Move folding of OBJ_TYPE_REF
with a call expr to ...
* fold-const.c (fold_ternary) <case CALL_EXPR>: Here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110116 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 67310455690..4513f977cd0 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2342,38 +2342,6 @@ fold_stmt (tree *stmt_p) callee = get_callee_fndecl (rhs); if (callee && DECL_BUILT_IN (callee)) result = ccp_fold_builtin (stmt, rhs); - else - { - /* Check for resolvable OBJ_TYPE_REF. The only sorts we can resolve - here are when we've propagated the address of a decl into the - object slot. */ - /* ??? Should perhaps do this in fold proper. However, doing it - there requires that we create a new CALL_EXPR, and that requires - copying EH region info to the new node. Easier to just do it - here where we can just smash the call operand. */ - callee = TREE_OPERAND (rhs, 0); - if (TREE_CODE (callee) == OBJ_TYPE_REF - && lang_hooks.fold_obj_type_ref - && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR - && DECL_P (TREE_OPERAND - (OBJ_TYPE_REF_OBJECT (callee), 0))) - { - tree t; - - /* ??? Caution: Broken ADDR_EXPR semantics means that - looking at the type of the operand of the addr_expr - can yield an array type. See silly exception in - check_pointer_types_r. */ - - t = TREE_TYPE (TREE_TYPE (OBJ_TYPE_REF_OBJECT (callee))); - t = lang_hooks.fold_obj_type_ref (callee, t); - if (t) - { - TREE_OPERAND (rhs, 0) = t; - changed = true; - } - } - } } /* If we couldn't fold the RHS, hand over to the generic fold routines. */ |