OSDN Git Service

(struct function): Make frame_offset be HOST_WIDE_INT.
[pf3gnuchains/gcc-fork.git] / gcc / cp / expr.c
index ef90ad4..3351ccb 100644 (file)
@@ -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;