OSDN Git Service

PR target/42113
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 2009 09:30:50 +0000 (09:30 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 2009 09:30:50 +0000 (09:30 +0000)
* config/alpha/alpha.md (*cmp_sadd_si): Change mode
of scratch register to SImode.
(*cmp_sadd_sidi): Ditto.
(*cmp_ssub_si): Ditto.
(*cmp_ssub_sidi): Ditto.

testsuite/ChangeLog:

PR target/42113
* gcc.target/alpha/pr42113.c: New test.

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

gcc/ChangeLog
gcc/config/alpha/alpha.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/alpha/pr42113.c [new file with mode: 0644]

index 31dcdb6..57feb9a 100644 (file)
@@ -1,3 +1,12 @@
+2009-11-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42113
+       * config/alpha/alpha.md (*cmp_sadd_si): Change mode
+       of scratch register to SImode.
+       (*cmp_sadd_sidi): Ditto.
+       (*cmp_ssub_si): Ditto.
+       (*cmp_ssub_sidi): Ditto.
+
 2009-11-21  Ian Lance Taylor  <iant@google.com>
 
        * Makefile.in (HOST_LIBS): Move higher in file.
index 2327879..86bfd74 100644 (file)
                 (match_dup 4)))]
 {
   if (can_create_pseudo_p ())
-    operands[5] = gen_reg_rtx (DImode);
+    operands[5] = gen_reg_rtx (SImode);
   else if (reg_overlap_mentioned_p (operands[5], operands[4]))
     operands[5] = operands[0];
 })
                                 (match_dup 4))))]
 {
   if (can_create_pseudo_p ())
-    operands[5] = gen_reg_rtx (DImode);
+    operands[5] = gen_reg_rtx (SImode);
   else if (reg_overlap_mentioned_p (operands[5], operands[4]))
-    operands[5] = operands[0];
+    operands[5] = gen_rtx_REG (SImode, REGNO (operands[0]));
 })
 
 (define_insn_and_split "*cmp_ssub_di"
                 (match_dup 4)))]
 {
   if (can_create_pseudo_p ())
-    operands[5] = gen_reg_rtx (DImode);
+    operands[5] = gen_reg_rtx (SImode);
   else if (reg_overlap_mentioned_p (operands[5], operands[4]))
     operands[5] = operands[0];
 })
                                  (match_dup 4))))]
 {
   if (can_create_pseudo_p ())
-    operands[5] = gen_reg_rtx (DImode);
+    operands[5] = gen_reg_rtx (SImode);
   else if (reg_overlap_mentioned_p (operands[5], operands[4]))
-    operands[5] = operands[0];
+    operands[5] = gen_rtx_REG (SImode, REGNO (operands[0]));
 })
 \f
 ;; Here are the CALL and unconditional branch insns.  Calls on NT and OSF
index 68e7afa..9aafea5 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42113
+       * gcc.target/alpha/pr42113.c: New test.
+
 2009-11-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR fortran/41807
diff --git a/gcc/testsuite/gcc.target/alpha/pr42113.c b/gcc/testsuite/gcc.target/alpha/pr42113.c
new file mode 100644 (file)
index 0000000..228c14a
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int foo (int a, int b)
+{
+  int bar = a * sizeof (int);
+
+  if (b)
+    bar += sizeof (int);
+
+  return bar;
+}