X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Fexpr.c;h=3351ccba7708b52eb5cb39aacfc0fdd36a5c341b;hb=924d43beb3709488f19f58a401c225db42ab0be6;hp=ef90ad4ecea0bc44a3a9cf8b10adcb23723e76c9;hpb=7b0a0dd40d8e785d186d0debd8127992b2da838b;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index ef90ad4ecea..3351ccba770 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -137,6 +137,18 @@ cplus_expand_expr (exp, target, tmode, modifier) result. The assumptions are true only if the address was valid to begin with. */ call_target = validize_mem (call_target); + + /* If this is a reference to a symbol, expand_inline_function + will do this transformation and return a different target + than the one we gave it, though functionally equivalent. Do + the transformation here to avoid confusion. */ + if (! cse_not_expected && GET_CODE (call_target) == MEM + && GET_CODE (XEXP (call_target, 0)) == SYMBOL_REF) + { + call_target = gen_rtx + (MEM, mode, memory_address (mode, XEXP (call_target, 0))); + MEM_IN_STRUCT_P (call_target) = 1; + } } call_exp = build (CALL_EXPR, type, func, args, NULL_TREE); @@ -165,7 +177,7 @@ cplus_expand_expr (exp, target, tmode, modifier) init = maybe_build_cleanup (convert_from_reference (init)); if (init != NULL_TREE) - expand_expr (init, 0, 0, 0); + expand_expr (init, const0_rtx, VOIDmode, 0); } call_target = return_target = DECL_RTL (slot); } @@ -373,7 +385,7 @@ do_case (start, end) if (end && pedantic) pedwarn ("ANSI C++ forbids range expressions in switch statement"); - if (current_template_parms) + if (processing_template_decl) { add_tree (build_min_nt (CASE_LABEL, start, end)); return;