]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.
authorRichard Henderson <rth@redhat.com>
Thu, 20 Jun 2002 23:25:11 +0000 (16:25 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 20 Jun 2002 23:25:11 +0000 (16:25 -0700)
        * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.
        Call put_var_into_stack.
* g++.dg/opt/asm1.C: New.

From-SVN: r54864

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 3de4f8bdb75652aacda1c792440a10a61e42b892..4ae454e494ed7b8d23e6f536fba525bc0e7ef114 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-20  Richard Henderson  <rth@redhat.com>
+
+       PR c++/6747
+       * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early.
+       Call put_var_into_stack.
+
 2002-06-20  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/6892
index fc372361aad32d97b28975f90cf9e6206050ab69..f3ba665aa57523d32607709d102adeb946e2bd97 100644 (file)
@@ -4806,9 +4806,6 @@ mark_addressable (exp)
 {
   register tree x = exp;
 
-  if (TREE_ADDRESSABLE (x) == 1)
-    return 1;
-
   while (1)
     switch (TREE_CODE (x))
       {
@@ -4827,6 +4824,8 @@ mark_addressable (exp)
            TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
            return 1;
          }
+       /* FALLTHRU */
+
       case VAR_DECL:
        /* Caller should not be trying to mark initialized
           constant fields addressable.  */
@@ -4834,6 +4833,7 @@ mark_addressable (exp)
                            || DECL_IN_AGGR_P (x) == 0
                            || TREE_STATIC (x)
                            || DECL_EXTERNAL (x), 314);
+       /* FALLTHRU */
 
       case CONST_DECL:
       case RESULT_DECL:
@@ -4842,6 +4842,7 @@ mark_addressable (exp)
          warning ("address requested for `%D', which is declared `register'",
                      x);
        TREE_ADDRESSABLE (x) = 1;
+       put_var_into_stack (x);
        return 1;
 
       case FUNCTION_DECL: