expr.c (expand_expr, [...]): Set TREE_USED sooner.
authorJason Merrill <jason@gcc.gnu.org>
Fri, 8 Oct 1999 00:10:09 +0000 (20:10 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 8 Oct 1999 00:10:09 +0000 (20:10 -0400)
* expr.c (expand_expr, TARGET_EXPR): Set TREE_USED sooner.

* c-decl.c (finish_struct): Use simpler method of
removing elements of a singly-linked list.

From-SVN: r29860

gcc/ChangeLog
gcc/c-decl.c
gcc/expr.c

index 29f74543d3c0327427e212c3acdc98de561ad6ba..683e7e2c1a6cf0196bdd0e2998c2ddd844102a40 100644 (file)
@@ -1,3 +1,12 @@
+Thu Oct  7 17:02:34 1999  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * expr.c (expand_expr, TARGET_EXPR): Set TREE_USED sooner.
+
+Thu Oct  7 17:01:58 1999  Greg McGary  <gkm@gnu.org>
+
+       * c-decl.c (finish_struct): Use simpler method of
+       removing elements of a singly-linked list.
+
 Thu Oct  7 15:23:28 1999  Michael Meissner  <meissner@cygnus.com>
 
        * alpha.md (peephole2's): Comment out peephole2's that generate
index b6facc753cae81cecf03143fffc813bc53a8d43a..37915a48e503647a53f00f000b12d058bb395e40 100644 (file)
@@ -5526,17 +5526,15 @@ finish_struct (t, fieldlist, attributes)
 
   layout_type (t);
 
-  /* Delete all zero-width bit-fields from the front of the fieldlist */
-  while (fieldlist
-        && DECL_INITIAL (fieldlist))
-    fieldlist = TREE_CHAIN (fieldlist);
-  /* Delete all such members from the rest of the fieldlist */
-  for (x = fieldlist; x;)
-    {
-      if (TREE_CHAIN (x) && DECL_INITIAL (TREE_CHAIN (x)))
-       TREE_CHAIN (x) = TREE_CHAIN (TREE_CHAIN (x));
-      else x = TREE_CHAIN (x);
-    }
+  /* Delete all zero-width bit-fields from the fieldlist */
+  {
+    tree *fieldlistp = &fieldlist;
+    while (*fieldlistp && TREE_CODE (*fieldlistp) == FIELD_DECL)
+      if (DECL_INITIAL (*fieldlistp))
+       *fieldlistp = TREE_CHAIN (*fieldlistp);
+      else
+       fieldlistp = &TREE_CHAIN (*fieldlistp);
+  }
 
   /*  Now we have the truly final field list.
       Store it in this type and in the variants.  */
index 568460bebbb481b09a77f708e877e0b3e4487d32..79e651fc7f6b72c0406e4dac30856213894e7808 100644 (file)
@@ -7128,21 +7128,11 @@ expand_expr (exp, target, tmode, modifier)
          tree negated = fold (build1 (NEGATE_EXPR, type,
                                       TREE_OPERAND (exp, 1)));
 
-         /* Deal with the case where we can't negate the constant
-            in TYPE.  */
          if (TREE_UNSIGNED (type) || TREE_OVERFLOW (negated))
-           {
-             tree newtype = signed_type (type);
-             tree newop0 = convert (newtype, TREE_OPERAND (exp, 0));
-             tree newop1 = convert (newtype, TREE_OPERAND (exp, 1));
-             tree newneg = fold (build1 (NEGATE_EXPR, newtype, newop1));
-
-             if (! TREE_OVERFLOW (newneg))
-               return expand_expr (convert (type, 
-                                            build (PLUS_EXPR, newtype,
-                                                   newop0, newneg)),
-                                   target, tmode, ro_modifier);
-           }
+           /* If we can't negate the constant in TYPE, leave it alone and
+              expand_binop will negate it for us.  We used to try to do it
+              here in the signed version of TYPE, but that doesn't work
+              on POINTER_TYPEs.  */;
          else
            {
              exp = build (PLUS_EXPR, type, TREE_OPERAND (exp, 0), negated);
@@ -7845,6 +7835,11 @@ expand_expr (exp, target, tmode, modifier)
        if (! ignore)
          target = original_target;
 
+       /* Set this here so that if we get a target that refers to a
+          register variable that's already been used, put_reg_into_stack
+          knows that it should fix up those uses.  */     
+       TREE_USED (slot) = 1;
+
        if (target == 0)
          {
            if (DECL_RTL (slot) != 0)
@@ -7914,7 +7909,6 @@ expand_expr (exp, target, tmode, modifier)
        /* Mark it as expanded.  */
        TREE_OPERAND (exp, 1) = NULL_TREE;
 
-       TREE_USED (slot) = 1;
        store_expr (exp1, target, 0);
 
        expand_decl_cleanup (NULL_TREE, cleanups);