diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-30 22:55:30 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-30 22:55:30 +0000 |
commit | e67e5e1f09d694bdc12f5d5733075cd7dba374d1 (patch) | |
tree | b8e5fa782f1cf0143b461a419b9a4855d6b9c559 /gcc/tree-ssa-ccp.c | |
parent | 98cdc32e7828071a68104dc86db105d51f76fe93 (diff) | |
download | gcc-e67e5e1f09d694bdc12f5d5733075cd7dba374d1.tar.gz |
* gimplify.c (gimplify_expr) <case CONST_DECL>: Don't replace
with DECL_INITIAL if fb_lvalue.
* tree-gimple.c (is_gimple_id): Add CONST_DECL.
* tree-pretty-print.c (dump_decl_name): Dump unnamed CONST_DECL
with <Cxxx>.
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Fold CONST_DECL.
fortran/
* trans-expr.c (gfc_conv_expr_reference): Create a CONST_DECL
for TREE_CONSTANTs.
testsuite/
* gfortran.fortran-torture/execute/intrinsic_rrspacing.f90: Fix
write to constant argument.
* gfortran.fortran-torture/execute/intrinsic_scale.f90: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85365 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index c8ab92a896b..f883e373cc4 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1868,6 +1868,11 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset) /* Strip the ADDR_EXPR. */ base = TREE_OPERAND (base, 0); + /* Fold away CONST_DECL to its value, if the type is scalar. */ + if (TREE_CODE (base) == CONST_DECL + && is_gimple_min_invariant (DECL_INITIAL (base))) + return DECL_INITIAL (base); + /* Try folding *(&B+O) to B[X]. */ t = maybe_fold_offset_to_array_ref (base, offset, TREE_TYPE (expr)); if (t) |