aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2013-04-19 19:55:57 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2013-04-19 19:55:57 +0000
commit682303da799ead98af850842873bf9a66dd3ddb0 (patch)
tree1d8f66f38c6f1b93aa8a73bc538dc3047bc1962d
parent79d8a2724290d3c6e14f9935b62993b90776aa4e (diff)
downloadgcc-682303da799ead98af850842873bf9a66dd3ddb0.zip
gcc-682303da799ead98af850842873bf9a66dd3ddb0.tar.gz
gcc-682303da799ead98af850842873bf9a66dd3ddb0.tar.bz2
re PR rtl-optimization/56847 ('-fpie' triggers - internal compiler error: in gen_add2_insn, at optabs.c:4705)
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. From-SVN: r198101
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/lra-constraints.c11
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr56847.c12
4 files changed, 33 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e2aca32..c27e4da 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index e3b4add..9e4924c 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -1978,8 +1978,15 @@ process_alt_operands (int only_alternative)
(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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a31889a..7227e5e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/testsuite/gcc.dg/pr56847.c b/gcc/testsuite/gcc.dg/pr56847.c
new file mode 100644
index 0000000..b94aae1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56847.c
@@ -0,0 +1,12 @@
+/* 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;
+}