expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocate a kept temp.
authorMichael Matz <matz@suse.de>
Tue, 29 May 2012 14:41:53 +0000 (14:41 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Tue, 29 May 2012 14:41:53 +0000 (14:41 +0000)
* expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocate
a kept temp.
(expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Make unreachable.
* gimple-fold.c (canonicalize_constructor_val): Canonicalize
COMPOUND_LITERAL_EXPR.
* function.c (expand_function_start): Don't call expand_decl,
instead assert that we have RTL assigned.
* tree-ssa-live.c (remove_unused_locals): Clear
nonlocal_goto_save_area if its backing variable is removed.
* stmt.c (expand_asm_operands): Remove handling of non-lvalues
as mem inputs.
(expand_decl): Assert that this does nothing.
* calls.c (expand_call): Don't call mark_temp_addr_taken.

* c-tree.h (c_expand_decl): Remove prototype.

c-family/
* c-common.h (c_expand_decl): Remove prototype.

ada/
* gcc-interface/utils.c (create_var_decl_1): Don't call expand_decl.

From-SVN: r187962

12 files changed:
gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.h
gcc/c-tree.h
gcc/calls.c
gcc/expr.c
gcc/function.c
gcc/gimple-fold.c
gcc/stmt.c
gcc/tree-ssa-live.c

index 399da9304224cc2ae458e1241e2520ef5b47c2a7..5d2b2e48e68b6b4cbb0c233f2cc653d41c9f0fc0 100644 (file)
@@ -1,3 +1,21 @@
+2012-05-29  Michael Matz  <matz@suse.de>
+
+       * c-tree.h (c_expand_decl): Remove prototype.
+
+       * expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocate
+       a kept temp.
+       (expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Make unreachable.
+       * gimple-fold.c (canonicalize_constructor_val): Canonicalize 
+       COMPOUND_LITERAL_EXPR.
+       * function.c (expand_function_start): Don't call expand_decl,
+       instead assert that we have RTL assigned.
+       * tree-ssa-live.c (remove_unused_locals): Clear
+       nonlocal_goto_save_area if its backing variable is removed.
+       * stmt.c (expand_asm_operands): Remove handling of non-lvalues
+       as mem inputs.
+       (expand_decl): Assert that this does nothing.
+       * calls.c (expand_call): Don't call mark_temp_addr_taken.
+
 2012-05-29  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53516
index f92edbb11ce490c3c6bf766c157056de5c515f01..e031f46d6e4e8195418c855c3c790432deaf963b 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-29  Michael Matz  <matz@suse.de>
+
+       * gcc-interface/utils.c (create_var_decl_1): Don't call expand_decl.
+
 2012-05-26  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (variant_desc): Rename 'record' to 'new_type'.
index 36012a6ed91f8d22e901b0c1510bacecce532474..5800308470066435bb6ea8af4250087886792eb9 100644 (file)
@@ -2227,8 +2227,6 @@ create_var_decl_1 (tree var_name, tree asm_name, tree type, tree var_init,
       if (global_bindings_p ())
        rest_of_decl_compilation (var_decl, true, 0);
     }
-  else
-    expand_decl (var_decl);
 
   return var_decl;
 }
index 650302b0e937471698c39bc5422cf4a95e92cfec..a6a3623d781232693e5a95da61bd7ac8e55fd714 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-29  Michael Matz  <matz@suse.de>
+
+       * c-common.h (c_expand_decl): Remove prototype.
+
 2012-05-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        * c.opt (Wmissing-braces): Use LangEnabledBy(C ObjC,Wall).
index c3d679adcbcffede62c80fb38981f243e788384e..c8e6ce195778c7653d6889a27e53a638a2f5c578 100644 (file)
@@ -544,8 +544,6 @@ extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
                               location_t, tree, tree);
 extern tree build_indirect_ref (location_t, tree, ref_operator);
 
-extern int c_expand_decl (tree);
-
 extern int field_decl_cmp (const void *, const void *);
 extern void resort_sorted_fields (void *, void *, gt_pointer_operator,
                                  void *);
index 8f8c9d8e01406a4cedfaedee41870094af828ad8..8541747a339f25d643bad5e38295db298fd7fda4 100644 (file)
@@ -535,7 +535,6 @@ extern void store_parm_decls (void);
 extern void store_parm_decls_from (struct c_arg_info *);
 extern tree xref_tag (enum tree_code, tree);
 extern struct c_typespec parser_xref_tag (location_t, enum tree_code, tree);
-extern int c_expand_decl (tree);
 extern struct c_parm *build_c_parm (struct c_declspecs *, tree,
                                    struct c_declarator *);
 extern struct c_declarator *build_attrs_declarator (tree,
index 03c92168a24e5c76015e7189ac2f888002edd623..ea9e5cf71a8dba8c0fe99fc0291446d9e86b0b84 100644 (file)
@@ -2405,8 +2405,6 @@ expand_call (tree exp, rtx target, int ignore)
               specified.  If we were to allocate space on the stack here,
               we would have no way of knowing when to free it.  */
            rtx d = assign_temp (rettype, 0, 1, 1);
-
-           mark_temp_addr_taken (d);
            structure_value_addr = XEXP (d, 0);
            target = 0;
          }
index d568deb32fdc6b4383280ea74b04271fb90b2f58..fd995d173edbd5619dc334134f7701a1cb384cae 100644 (file)
@@ -9922,7 +9922,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
            tree nt = build_qualified_type (TREE_TYPE (tem),
                                            (TYPE_QUALS (TREE_TYPE (tem))
                                             | TYPE_QUAL_CONST));
-           memloc = assign_temp (nt, 1, 1, 1);
+           memloc = assign_temp (nt, 0, 1, 1);
            emit_move_insn (memloc, op0);
            op0 = memloc;
            mem_attrs_from_type = true;
@@ -10425,6 +10425,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
     case POSTDECREMENT_EXPR:
     case LOOP_EXPR:
     case EXIT_EXPR:
+    case COMPOUND_LITERAL_EXPR:
       /* Lowered by gimplify.c.  */
       gcc_unreachable ();
 
@@ -10439,7 +10440,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
       return expand_expr_real (treeop0, original_target, tmode,
                               modifier, alt_rtl);
 
-    case COMPOUND_LITERAL_EXPR:
+#if 0
       {
        /* Initialize the anonymous variable declared in the compound
           literal, then return the variable.  */
@@ -10459,6 +10460,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
        return expand_expr_real (decl, original_target, tmode,
                                 modifier, alt_rtl);
       }
+#endif
 
     default:
       return expand_expr_real_2 (&ops, target, tmode, modifier);
index 00c55a16a62a42078055629b5dfe07c5dd57e86c..0fd4d36bfcc3952e9c629d46d26f1b7fff4a0e82 100644 (file)
@@ -4788,11 +4788,8 @@ expand_function_start (tree subr)
       tree t_save;
       rtx r_save;
 
-      /* ??? We need to do this save early.  Unfortunately here is
-        before the frame variable gets declared.  Help out...  */
       tree var = TREE_OPERAND (cfun->nonlocal_goto_save_area, 0);
-      if (!DECL_RTL_SET_P (var))
-       expand_decl (var);
+      gcc_assert (DECL_RTL_SET_P (var));
 
       t_save = build4 (ARRAY_REF,
                       TREE_TYPE (TREE_TYPE (cfun->nonlocal_goto_save_area)),
index 8bcc13e1a41377e7fbff67ac5da101b415b82ac0..b2bd33788028349ad5087231f0ae209d3de24046 100644 (file)
@@ -154,6 +154,12 @@ canonicalize_constructor_val (tree cval, tree from_decl)
   if (TREE_CODE (cval) == ADDR_EXPR)
     {
       tree base = get_base_address (TREE_OPERAND (cval, 0));
+      if (!base && TREE_CODE (TREE_OPERAND (cval, 0)) == COMPOUND_LITERAL_EXPR)
+       {
+         base = COMPOUND_LITERAL_EXPR_DECL (TREE_OPERAND (cval, 0));
+         if (base)
+           TREE_OPERAND (cval, 0) = base;
+       }
       if (!base)
        return NULL_TREE;
 
index dd34890d46215679ccf3ac10f31960da1129a3b1..a9258b15c7d31d747df7fdd100b6df85793b7759 100644 (file)
@@ -910,6 +910,8 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
                 at this point.  Ignore it: clearly this *is* a memory.  */
            }
          else
+           gcc_unreachable ();
+#if 0
            {
              warning (0, "use of memory input without lvalue in "
                       "asm operand %d is deprecated", i + noutputs);
@@ -935,6 +937,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
                  op = memloc;
                }
            }
+#endif
        }
 
       generating_concat_p = old_generating_concat_p;
@@ -1703,6 +1706,7 @@ expand_decl (tree decl)
      type in case this node is used in a reference.  */
   if (TREE_CODE (decl) == CONST_DECL)
     {
+      gcc_unreachable ();
       DECL_MODE (decl) = TYPE_MODE (type);
       DECL_ALIGN (decl) = TYPE_ALIGN (type);
       DECL_SIZE (decl) = TYPE_SIZE (type);
@@ -1720,6 +1724,7 @@ expand_decl (tree decl)
   if (TREE_STATIC (decl) || DECL_EXTERNAL (decl))
     return;
 
+  gcc_unreachable ();
   /* Create the RTL representation for the variable.  */
 
   if (type == error_mark_node)
index dfbf110a015d8438f341b091716f71fa8f05a537..252020624b444e740ff41202a9f77ed1a2e3b1cb 100644 (file)
@@ -835,6 +835,9 @@ remove_unused_locals (void)
            {
              if (var_ann (var))
                remove_referenced_var (var);
+             if (cfun->nonlocal_goto_save_area
+                 && TREE_OPERAND (cfun->nonlocal_goto_save_area, 0) == var)
+               cfun->nonlocal_goto_save_area = NULL;
              continue;
            }
        }