(build_indirect_ref): See volatility from flag_volatile.
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 28 Dec 1992 11:10:05 +0000 (06:10 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 28 Dec 1992 11:10:05 +0000 (06:10 -0500)
From-SVN: r2974

gcc/c-typeck.c

index 46e6dac09444865bb5821c4e7f41d49ec6388f87..b5d6a09282aa06a52ef34bae788f2f3ebf8ada39 100644 (file)
@@ -1121,8 +1121,9 @@ build_indirect_ref (ptr, errorstring)
        /* A de-reference of a pointer to const is not a const.  It is valid
           to change it via some other pointer.  */
        TREE_READONLY (ref) = TYPE_READONLY (t);
-       TREE_SIDE_EFFECTS (ref) = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer);
-       TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t);
+       TREE_SIDE_EFFECTS (ref)
+         = TYPE_VOLATILE (t) || TREE_SIDE_EFFECTS (pointer) || flag_volatile;
+       TREE_THIS_VOLATILE (ref) = TYPE_VOLATILE (t) || flag_volatile;
        return ref;
       }
   else if (TREE_CODE (pointer) != ERROR_MARK)