aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Pinski <andrew_pinski@playstation.sony.com>2006-11-15 17:04:56 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2006-11-15 09:04:56 -0800
commitf9f63ff2153c3b281c17e3de313f9c83ff08f04c (patch)
treec2f3504f54bd9ebf0422c99af06558bdeb43d873 /gcc/fold-const.c
parent47a37ce45e4feb8cd84a315353a2077c9fbda747 (diff)
downloadgcc-f9f63ff2153c3b281c17e3de313f9c83ff08f04c.zip
gcc-f9f63ff2153c3b281c17e3de313f9c83ff08f04c.tar.gz
gcc-f9f63ff2153c3b281c17e3de313f9c83ff08f04c.tar.bz2
re PR tree-optimization/29788 (ICE in var_ann, at tree-flow-inline.h:130)
2006-11-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/29788 * fold-const.c (fold_indirect_ref_1): Fold *&CONST_DECL down to what is the const decl is a place holder for. 2006-11-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/29788 * gfortran.fortran-torture/compile/inline_1.f90: New testcase. From-SVN: r118861
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index eb3b457..143dcad 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -13038,6 +13038,9 @@ fold_indirect_ref_1 (tree type, tree op0)
{
tree op = TREE_OPERAND (sub, 0);
tree optype = TREE_TYPE (op);
+ /* *&CONST_DECL -> to the value of the const decl. */
+ if (TREE_CODE (op) == CONST_DECL)
+ return DECL_INITIAL (op);
/* *&p => p; make sure to handle *&"str"[cst] here. */
if (type == optype)
{