Don't hoist volatile mems out of loops.
authorBernd Schmidt <bernds@cygnus.co.uk>
Wed, 8 Dec 1999 17:49:26 +0000 (17:49 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Wed, 8 Dec 1999 17:49:26 +0000 (17:49 +0000)
From-SVN: r30834

gcc/ChangeLog
gcc/loop.c

index b66687dc452e524fe0b38250b625bcc1a0249952..f0da4a9ad135852890b64d94b4db958efe7e6fe8 100644 (file)
@@ -1,3 +1,7 @@
+1999-12-08  Bernd Schmidt  <bernds@cygnus.co.uk>
+
+       * loop.c (insert_loop_mem): Don't hoist volatile mems out of loops.
+
 1999-12-08  Jakub Jelinek  <jakub@redhat.com>
 
        * config/sparc/sparc.c (ultra_cmove_results_ready_p,
index 90e6c44f5ea827c4be01f6609745c788151858d8..96f5e66b65e13ff671e3b2519c60c822b8760b61 100644 (file)
@@ -9667,7 +9667,8 @@ insert_loop_mem (mem, data)
      because we can't put it in a register.  We still store it in the
      table, though, so that if we see the same address later, but in a
      non-BLK mode, we'll not think we can optimize it at that point.  */
-  loop_mems[loop_mems_idx].optimize = (GET_MODE (m) != BLKmode);
+  loop_mems[loop_mems_idx].optimize = (GET_MODE (m) != BLKmode
+                                      && ! MEM_VOLATILE_P (m));
   loop_mems[loop_mems_idx].reg = NULL_RTX;
   ++loop_mems_idx;