+2013-04-19 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/56847
+ * lra-constraints.c (process_alt_operands): Discourage alternative
+ with non-matche doffsettable memory constraint fro memory with
+ known offset.
+
2013-04-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/56982
(op, this_alternative) == NO_REGS))))
reject += LRA_MAX_REJECT;
- if (! ((const_to_mem && constmemok)
- || (MEM_P (op) && offmemok)))
+ if (MEM_P (op) && offmemok)
+ {
+ /* If we know offset and this non-offsetable memory,
+ something wrong with this memory and it is better
+ to try other memory possibilities. */
+ if (MEM_OFFSET_KNOWN_P (op))
+ reject += LRA_MAX_REJECT;
+ }
+ else if (! (const_to_mem && constmemok))
{
/* We prefer to reload pseudos over reloading other
things, since such reloads may be able to be
+2013-04-19 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/56847
+ * gcc.dg/pr56847.c: New test.
+
2013-04-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/56982
--- /dev/null
+/* PR rtl-optimization/56847 */
+/* { dg-do compile { target pie } } */
+/* { dg-options "-O2 -fpie" } */
+
+struct S { long int a, b; } e;
+__thread struct S s;
+
+void
+foo (void)
+{
+ s = e;
+}