(staticp, case COMPONENT_REF, BIT_FIELD_REF): Not static if bitfield.
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 5 Jan 1997 03:21:27 +0000 (22:21 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 5 Jan 1997 03:21:27 +0000 (22:21 -0500)
From-SVN: r13376

gcc/tree.c

index c54cf6ec6f312cca76a1d18f22613e25597a57ec..f8b1a6ecd260180c585f087bd059bea629a47dc3 100644 (file)
@@ -2174,9 +2174,14 @@ staticp (arg)
     case STRING_CST:
       return 1;
 
+      /* If we are referencing a bitfield, we can't evaluate an
+        ADDR_EXPR at compile time and so it isn't a constant.  */
     case COMPONENT_REF:
+      return (! DECL_BIT_FIELD (TREE_OPERAND (arg, 1))
+             && staticp (TREE_OPERAND (arg, 0)));
+
     case BIT_FIELD_REF:
-      return staticp (TREE_OPERAND (arg, 0));
+      return 0;
 
 #if 0
        /* This case is technically correct, but results in setting