aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-09-10 13:47:19 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-09-10 13:47:19 +0200
commit84cf4ab655292038d1371a801cbffb9fc6b6ecd0 (patch)
tree0381ed2becdbb7911d43100981e0d90f765e8049 /gcc/cfgcleanup.c
parent447dd9066575a8b92bd0369b809978f71a5235e5 (diff)
downloadgcc-84cf4ab655292038d1371a801cbffb9fc6b6ecd0.zip
gcc-84cf4ab655292038d1371a801cbffb9fc6b6ecd0.tar.gz
gcc-84cf4ab655292038d1371a801cbffb9fc6b6ecd0.tar.bz2
re PR rtl-optimization/58365 (likely wrong code bug)
PR rtl-optimization/58365 * cfgcleanup.c (merge_memattrs): Also clear MEM_READONLY_P resp. MEM_NOTRAP_P if they differ, or set MEM_VOLATILE_P if it differs. * gcc.c-torture/execute/pr58365.c: New test. From-SVN: r202434
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 6836a9e..e88fe2e 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -925,6 +925,24 @@ merge_memattrs (rtx x, rtx y)
set_mem_align (y, MEM_ALIGN (x));
}
}
+ if (code == MEM)
+ {
+ if (MEM_READONLY_P (x) != MEM_READONLY_P (y))
+ {
+ MEM_READONLY_P (x) = 0;
+ MEM_READONLY_P (y) = 0;
+ }
+ if (MEM_NOTRAP_P (x) != MEM_NOTRAP_P (y))
+ {
+ MEM_NOTRAP_P (x) = 0;
+ MEM_NOTRAP_P (y) = 0;
+ }
+ if (MEM_VOLATILE_P (x) != MEM_VOLATILE_P (y))
+ {
+ MEM_VOLATILE_P (x) = 1;
+ MEM_VOLATILE_P (y) = 1;
+ }
+ }
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)