s390.md (reload_insi, [...]): Change mode of scratch register to DImode / TImode.
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 12 Mar 2002 14:32:37 +0000 (14:32 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 12 Mar 2002 14:32:37 +0000 (14:32 +0000)
* config/s390/s390.md (reload_insi, reload_indi): Change mode of
scratch register to DImode / TImode.
config/s390/s390.c (s390_expand_plus_operand): Make sure scratch
register used does not overlap the target.

From-SVN: r50652

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/config/s390/s390.md

index 583285c9382cbc486dbf4317aaf222cdd38bc739..6bbc35f9f512b7aa582b82c83016badfef000a75 100644 (file)
@@ -1,3 +1,10 @@
+2002-03-12  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * config/s390/s390.md (reload_insi, reload_indi): Change mode of
+       scratch register to DImode / TImode.
+       config/s390/s390.c (s390_expand_plus_operand): Make sure scratch
+       register used does not overlap the target.
+
 2002-03-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (debug.o): Depend on debug.h.
@@ -76,8 +83,6 @@
        * alias.c (record_component_aliases): Record aliases for base 
        classes too.
 
-2002-03-11  Ulrich Weigand  <uweigand@de.ibm.com>
-
        * config/s390/s390.h (REG_ALLOC_ORDER): Add missing register.
 
 2002-03-11  Douglas B Rupp  <rupp@gnat.com>
index f4696e44f7f9aa4e5b25d415a5a25e77ef38903f..2881aabc65bed62eaf037c6b7b249256cdd3b67a 100644 (file)
@@ -1,5 +1,5 @@
 /* Subroutines used for code generation on IBM S/390 and zSeries
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
    Contributed by Hartmut Penner (hpenner@de.ibm.com) and
                   Ulrich Weigand (uweigand@de.ibm.com).
 
@@ -1169,14 +1169,23 @@ s390_plus_operand (op, mode)
    SCRATCH may be used as scratch register.  */
 
 void
-s390_expand_plus_operand (target, src, scratch)
+s390_expand_plus_operand (target, src, scratch_in)
      register rtx target;
      register rtx src;
-     register rtx scratch;
+     register rtx scratch_in;
 {
-  /* src must be a PLUS; get its two operands.  */
-  rtx sum1, sum2;
+  rtx sum1, sum2, scratch;
+
+  /* ??? reload apparently does not ensure that the scratch register
+     and the target do not overlap.  We absolutely require this to be
+     the case, however.  Therefore the reload_in[sd]i patterns ask for
+     a double-sized scratch register, and if one part happens to be
+     equal to the target, we use the other one.  */
+  scratch = gen_rtx_REG (Pmode, REGNO (scratch_in));
+  if (rtx_equal_p (scratch, target))
+    scratch = gen_rtx_REG (Pmode, REGNO (scratch_in) + 1);
 
+  /* src must be a PLUS; get its two operands.  */
   if (GET_CODE (src) != PLUS || GET_MODE (src) != Pmode)
     abort ();
 
index 1ec96849b36c639dd8bc8457a72432384b1d68bb..f4fbfc0a4f377dcbc8ff2557c32b3595ea05a1f5 100644 (file)
@@ -1,5 +1,5 @@
 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
-;;  Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+;;  Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 ;;  Contributed by Hartmut Penner (hpenner@de.ibm.com) and
 ;;                 Ulrich Weigand (uweigand@de.ibm.com).
 ;; This file is part of GNU CC.
 (define_expand "reload_indi"
   [(parallel [(match_operand:DI 0 "register_operand" "=a")
               (match_operand:DI 1 "s390_plus_operand" "")
-              (match_operand:DI 2 "register_operand" "=&a")])]
+              (match_operand:TI 2 "register_operand" "=&a")])]
   "TARGET_64BIT"
   "
 {
 (define_expand "reload_insi"
   [(parallel [(match_operand:SI 0 "register_operand" "=a")
               (match_operand:SI 1 "s390_plus_operand" "")
-              (match_operand:SI 2 "register_operand" "=&a")])]
+              (match_operand:DI 2 "register_operand" "=&a")])]
   "!TARGET_64BIT"
   "
 {