expr.c (get_bit_range): Handle *MEM_REF's.
authorAldy Hernandez <aldyh@redhat.com>
Thu, 28 Jul 2011 19:48:48 +0000 (19:48 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 28 Jul 2011 19:48:48 +0000 (19:48 +0000)
        * expr.c (get_bit_range): Handle *MEM_REF's.

From-SVN: r176891

gcc/ChangeLog
gcc/expr.c

index 8b6111e6630ea73705f39c01c52ecdd6e601aaa9..6c0ec7cfd8b0e25630270c333a05f556eca97d8c 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-28  Aldy Hernandez  <aldyh@redhat.com>
+
+       * expr.c (get_bit_range): Handle *MEM_REF's.
+
 2011-07-28  Bernd Schmidt  <bernds@codesourcery.com>
 
        * rtlanal.c (tablejump_p): False for returns.
index 0988c51e545e9b2bda66908ab0446b4387d5e1f7..59a20b79edf996dea3d6438e8a893621c352e8d1 100644 (file)
@@ -4158,7 +4158,10 @@ get_bit_range (unsigned HOST_WIDE_INT *bitstart,
 
   /* If other threads can't see this value, no need to restrict stores.  */
   if (ALLOW_STORE_DATA_RACES
-      || (!ptr_deref_may_alias_global_p (innerdecl)
+      || ((TREE_CODE (innerdecl) == MEM_REF
+          || TREE_CODE (innerdecl) == TARGET_MEM_REF)
+         && !ptr_deref_may_alias_global_p (TREE_OPERAND (innerdecl, 0)))
+      || (DECL_P (innerdecl)
          && (DECL_THREAD_LOCAL_P (innerdecl)
              || !TREE_STATIC (innerdecl))))
     {