diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-10 11:47:19 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-10 11:47:19 +0000 |
commit | d8a2f83992fe8eefa5e4a7346662ee134f6d3abc (patch) | |
tree | 0381ed2becdbb7911d43100981e0d90f765e8049 /gcc/cfgcleanup.c | |
parent | 869a4fb543e45452540b96d17c63909ec2050a69 (diff) | |
download | gcc-d8a2f83992fe8eefa5e4a7346662ee134f6d3abc.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 6836a9e6e84..e88fe2ed500 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--) |