OSDN Git Service

2013-04-12 Vladimir Makarov <vmakarov@redhat.com>
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2013 17:09:10 +0000 (17:09 +0000)
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Apr 2013 17:09:10 +0000 (17:09 +0000)
PR target/56903
* config/i386/i386.c (ix86_hard_regno_mode_ok): Add
lra_in_progress for return.

2013-04-12  Vladimir Makarov  <vmakarov@redhat.com>

PR target/56903
* gcc.target/i386/pr56903.c: New test.

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

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr56903.c [new file with mode: 0644]

index 26304ec..bf244c0 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-12  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR target/56903
+       * config/i386/i386.c (ix86_hard_regno_mode_ok): Add
+       lra_in_progress for return.
+
 2013-04-12  Greta Yorsh  <Greta.Yorsh@arm.com>
 
        * config/arm/arm.md (mov_scc,mov_negscc,mov_notscc): Convert
index 9f5a24f..668bdde 100644 (file)
@@ -33976,6 +33976,11 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
        return true;
       if (!TARGET_PARTIAL_REG_STALL)
        return true;
+      /* LRA checks if the hard register is OK for the given mode.
+        QImode values can live in non-QI regs, so we allow all
+        registers here.  */
+      if (lra_in_progress)
+       return true;
       return !can_create_pseudo_p ();
     }
   /* We handle both integer and floats in the general purpose registers.  */
index 29a624e..b4fefc5 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-12  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR target/56903
+       * gcc.target/i386/pr56903.c: New test.
+
 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/56261
diff --git a/gcc/testsuite/gcc.target/i386/pr56903.c b/gcc/testsuite/gcc.target/i386/pr56903.c
new file mode 100644 (file)
index 0000000..9e6a1c3
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/56903 */
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+/* { dg-additional-options "-march=pentium3" { target ia32 } } */
+
+int a, *b, c;
+struct S { int s : 1; } *fn1 (void);
+extern int fn3 (void), fn4 (int *);
+
+void
+fn2 (void)
+{
+  int e = fn3 ();
+  char f = c + fn1 ()->s * 4;
+  if (*b && f == e)
+    a = *b;
+  fn4 (b);
+}