diff options
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 34 |
1 files changed, 26 insertions, 8 deletions
@@ -6821,9 +6821,10 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, 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. */ + gcc_assert (TREE_CODE (exp) < LAST_AND_UNUSED_TREE_CODE); if (DECL_P (exp) || TREE_CODE (exp) == CONSTRUCTOR - || TREE_CODE (exp) >= LAST_AND_UNUSED_TREE_CODE) + || TREE_CODE (exp) == COMPOUND_LITERAL_EXPR) { result = expand_expr (exp, target, tmode, modifier == EXPAND_INITIALIZER @@ -8069,11 +8070,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, /* Check for a built-in function. */ if (fndecl && DECL_BUILT_IN (fndecl)) { - if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_FRONTEND) - return lang_hooks.expand_expr (exp, original_target, - tmode, modifier, alt_rtl); - else - return expand_builtin (exp, target, subtarget, tmode, ignore); + gcc_assert (DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_FRONTEND); + return expand_builtin (exp, target, subtarget, tmode, ignore); } } return expand_call (exp, target, ignore); @@ -9460,9 +9458,29 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); goto binop; + case COMPOUND_LITERAL_EXPR: + { + /* Initialize the anonymous variable declared in the compound + literal, then return the variable. */ + tree decl = COMPOUND_LITERAL_EXPR_DECL (exp); + + /* Create RTL for this variable. */ + if (!DECL_RTL_SET_P (decl)) + { + if (DECL_HARD_REGISTER (decl)) + /* The user specified an assembler name for this variable. + Set that up now. */ + rest_of_decl_compilation (decl, 0, 0); + else + expand_decl (decl); + } + + return expand_expr_real (decl, original_target, tmode, + modifier, alt_rtl); + } + default: - return lang_hooks.expand_expr (exp, original_target, tmode, - modifier, alt_rtl); + gcc_unreachable (); } /* Here to do an ordinary binary operator. */ |