[Bug rtl-optimization/45235] const volatile read moved out of order

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Aug 9 13:56:00 GMT 2010



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-08-09 13:56 -------
Probably easier to not set TREE_READONLY or MEM_READONY_P here.

Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c      (revision 163030)
+++ gcc/emit-rtl.c      (working copy)
@@ -1669,7 +1670,8 @@ set_mem_attributes_minus_bitpos (rtx ref
       base = get_base_address (base);
       if (base && DECL_P (base)
          && TREE_READONLY (base)
-         && (TREE_STATIC (base) || DECL_EXTERNAL (base)))
+         && (TREE_STATIC (base) || DECL_EXTERNAL (base))
+         && !TREE_THIS_VOLATILE (base))
        MEM_READONLY_P (ref) = 1;

       /* If this expression uses it's parent's alias set, mark it such


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2010-08-09 13:56:06
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45235



More information about the Gcc-bugs mailing list