diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 20:50:46 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-10-02 20:50:46 +0000 |
commit | e54c9818f4680bacb8162260aa0fd6d5648ccb0c (patch) | |
tree | d8b5a02be72555573d7fccaf3de7108dc83914cd /gcc/expr.c | |
parent | 678b67078335749ae396430b49782b41cd51538d (diff) | |
download | gcc-e54c9818f4680bacb8162260aa0fd6d5648ccb0c.tar.gz |
gcc/
PR middle-end/33617
* expr.c (expand_expr_addr_expr_1): Pass CONSTRUCTORs to
expand_expr.
gcc/testsuite/
PR middle-end/33617
* gcc.c-torture/compile/pr33617.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128965 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 9d2a61ad782..6b7ba168d78 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6740,8 +6740,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, /* ??? This should be considered a front-end bug. We should not be generating ADDR_EXPR of something that isn't an LVALUE. The only exception here is STRING_CST. */ - if (TREE_CODE (exp) == CONSTRUCTOR - || CONSTANT_CLASS_P (exp)) + if (CONSTANT_CLASS_P (exp)) return XEXP (expand_expr_constant (exp, 0, modifier), 0); /* Everything must be something allowed by is_gimple_addressable. */ @@ -6788,9 +6787,12 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, default: /* If the object is a DECL, then expand it for its rtl. Don't bypass expand_expr, as that can have various side effects; LABEL_DECLs for - example, may not have their DECL_RTL set yet. Assume language - specific tree nodes can be expanded in some interesting way. */ + example, may not have their DECL_RTL set yet. Expand the rtl of + CONSTRUCTORs too, which should yield a memory reference for the + constructor's contents. Assume language specific tree nodes can + be expanded in some interesting way. */ if (DECL_P (exp) + || TREE_CODE (exp) == CONSTRUCTOR || TREE_CODE (exp) >= LAST_AND_UNUSED_TREE_CODE) { result = expand_expr (exp, target, tmode, |