2010-09-09 Vladimir Makarov <vmakarov@redhat.com>
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2010 13:51:25 +0000 (13:51 +0000)
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2010 13:51:25 +0000 (13:51 +0000)
PR middle-end/40386
* ira.c (pseudo_for_reload_consideration_p): Don't use
flag_ira_share_spill_slots.

2010-09-09  Vladimir Makarov  <vmakarov@redhat.com>

PR middle-end/40386
* gcc.c-torture/execute/{pr40386.c,pr40386.x}: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164100 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ira.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr40386.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr40386.x [new file with mode: 0644]

index 7fd3efd..f407781 100644 (file)
@@ -1,3 +1,9 @@
+2010-09-09  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR middle-end/40386
+       * ira.c (pseudo_for_reload_consideration_p): Don't use
+       flag_ira_share_spill_slots.
+
 2010-09-09  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * config/s390/s390.c (legitimate_reload_constant_p): Accept floating-
index 71841d9..a38808c 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2742,8 +2742,7 @@ pseudo_for_reload_consideration_p (int regno)
 {
   /* Consider spilled pseudos too for IRA because they still have a
      chance to get hard-registers in the reload when IRA is used.  */
-  return (reg_renumber[regno] >= 0
-         || (ira_conflicts_p && flag_ira_share_spill_slots));
+  return (reg_renumber[regno] >= 0 || ira_conflicts_p);
 }
 
 /* Init LIVE_SUBREGS[ALLOCNUM] and LIVE_SUBREGS_USED[ALLOCNUM] using
index d2a2393..cf6aa57 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-09  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR middle-end/40386
+       * gcc.c-torture/execute/{pr40386.c,pr40386.x}: New testcase.
+       
 2010-09-09  Mikael Morin  <mikael@gcc.gnu.org>
 
        * gfortran.dg/inline_transpose_1.f90: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40386.c b/gcc/testsuite/gcc.c-torture/execute/pr40386.c
new file mode 100644 (file)
index 0000000..ae0ac5a
--- /dev/null
@@ -0,0 +1,99 @@
+/* { dg-options "-fno-ira-share-spill-slots" } */
+#define CHAR_BIT 8
+
+#define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b))))
+#define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b))))
+
+#define CHAR_VALUE ((char)0xf234)
+#define SHORT_VALUE ((short)0xf234)
+#define INT_VALUE ((int)0xf234)
+#define LONG_VALUE ((long)0xf2345678L)
+#define LL_VALUE ((long long)0xf2345678abcdef0LL)
+
+#define SHIFT1 4
+#define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1)
+
+char c = CHAR_VALUE;
+short s = SHORT_VALUE;
+int i = INT_VALUE;
+long l = LONG_VALUE;
+long long ll = LL_VALUE;
+int shift1 = SHIFT1;
+int shift2 = SHIFT2;
+
+main ()
+{
+  if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (c, SHIFT1) != ROR (CHAR_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (s, shift1) != ROR (SHORT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (s, SHIFT1) != ROR (SHORT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (i, shift1) != ROR (INT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (i, SHIFT1) != ROR (INT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (l, shift1) != ROR (LONG_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (l, SHIFT1) != ROR (LONG_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (ll, shift1) != ROR (LL_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (ll, SHIFT1) != ROR (LL_VALUE, SHIFT1))
+    abort ();
+
+  if (ROR (ll, shift2) != ROR (LL_VALUE, SHIFT2))
+    abort ();
+
+  if (ROR (ll, SHIFT2) != ROR (LL_VALUE, SHIFT2))
+    abort ();
+
+  if (ROL (c, shift1) != ROL (CHAR_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (c, SHIFT1) != ROL (CHAR_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (s, shift1) != ROL (SHORT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (s, SHIFT1) != ROL (SHORT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (i, shift1) != ROL (INT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (i, SHIFT1) != ROL (INT_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (l, shift1) != ROL (LONG_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (l, SHIFT1) != ROL (LONG_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (ll, shift1) != ROL (LL_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (ll, SHIFT1) != ROL (LL_VALUE, SHIFT1))
+    abort ();
+
+  if (ROL (ll, shift2) != ROL (LL_VALUE, SHIFT2))
+    abort ();
+
+  if (ROL (ll, SHIFT2) != ROL (LL_VALUE, SHIFT2))
+    abort ();
+
+  exit (0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr40386.x b/gcc/testsuite/gcc.c-torture/execute/pr40386.x
new file mode 100644 (file)
index 0000000..12192e2
--- /dev/null
@@ -0,0 +1,2 @@
+set additional_flags "-fno-ira-share-spill-slots"
+return 0