aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1994-09-20 00:32:29 +0000
committerJason Merrill <merrill@gnu.org>1994-09-20 00:32:29 +0000
commite082358bff5d10e50a5aebb4b864853558237216 (patch)
treef3f2e2b2f61f139ec736ced01abf6a39b9cbd44d /gcc
parentdf8b713c8c5106dcbf278225b051592a74d914e9 (diff)
downloadgcc-e082358bff5d10e50a5aebb4b864853558237216.zip
gcc-e082358bff5d10e50a5aebb4b864853558237216.tar.gz
gcc-e082358bff5d10e50a5aebb4b864853558237216.tar.bz2
(fold): Handle COMPONENT_REFs involving CONSTRUCTORs.
From-SVN: r8095
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fold-const.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 87a4a1d..e93516e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3422,6 +3422,11 @@ fold (expr)
return t;
#endif /* 0 */
+ case COMPONENT_REF:
+ if (TREE_CODE (arg0) == CONSTRUCTOR)
+ t = TREE_VALUE (purpose_member (arg1, CONSTRUCTOR_ELTS (arg0)));
+ return t;
+
case RANGE_EXPR:
TREE_CONSTANT (t) = wins;
return t;