2013-09-10 Jakub Jelinek <jakub@redhat.com>
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/branches/gcc-4_7-branch@210173
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2013-09-10 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2013-08-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58277
2013-08-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58277
set_mem_align (y, MEM_ALIGN (x));
}
}
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--)
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2014-05-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2013-09-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/58365
+ * gcc.c-torture/execute/pr58365.c: New test.
+
2013-09-09 Jakub Jelinek <jakub@redhat.com>
PR c++/58325
2013-09-09 Jakub Jelinek <jakub@redhat.com>
PR c++/58325
--- /dev/null
+/* PR rtl-optimization/58365 */
+
+extern void abort (void);
+
+struct S
+{
+ volatile int a;
+ int b, c, d, e;
+} f;
+static struct S g, h;
+int i = 1;
+
+char
+foo (void)
+{
+ return i;
+}
+
+static struct S
+bar (void)
+{
+ if (foo ())
+ return f;
+ return g;
+}
+
+int
+main ()
+{
+ h = bar ();
+ f.b = 1;
+ if (h.b != 0)
+ abort ();
+ return 0;
+}