]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sparc.h (INIT_TARGET_OPTABS): If ARCH64, set the 32-bit ABI libfuncs to NULL.
authorDavid S. Miller <davem@redhat.com>
Mon, 24 Jun 2002 16:50:44 +0000 (09:50 -0700)
committerDavid S. Miller <davem@gcc.gnu.org>
Mon, 24 Jun 2002 16:50:44 +0000 (09:50 -0700)
2002-06-24  David S. Miller  <davem@redhat.com>

* config/sparc/sparc.h (INIT_TARGET_OPTABS): If ARCH64, set the
32-bit ABI libfuncs to NULL.

* expmed.c (expand_divmod): Do not set optab1/optab2 to the shift
optabs if op1 is const0_rtx.

From-SVN: r54958

gcc/ChangeLog
gcc/config/sparc/sparc.h
gcc/expmed.c

index a571e85cd71da9f3af07d1662376767d8f848b45..8b91b1bb32780b13bbd4bc646f1b74964527aebb 100644 (file)
@@ -1,3 +1,11 @@
+2002-06-24  David S. Miller  <davem@redhat.com>
+
+       * config/sparc/sparc.h (INIT_TARGET_OPTABS): If ARCH64, set the
+       32-bit ABI libfuncs to NULL.
+
+       * expmed.c (expand_divmod): Do not set optab1/optab2 to the shift
+       optabs if op1 is const0_rtx.
+
 2002-06-23  Jan Hubicka  <jh@suse.cz>
 
        * reg-stack.c (convert_regs_exit): Push the registers to stack in
index 7b59128a7a299a799a78bd9671f5794d17d8731c..2902f06ce8cd2fdea04f56a3c742531e03e130ae 100644 (file)
@@ -2612,6 +2612,17 @@ do {                                                                    \
          sqrt_optab->handlers[(int) TFmode].libfunc                    \
            = init_one_libfunc ("_Q_sqrt");                             \
       }                                                                        \
+    if (TARGET_ARCH64)                                                 \
+      {                                                                        \
+        /* In the SPARC 64bit ABI, these libfuncs do not exist in the  \
+           library.  Make sure the compiler does not emit calls to them        \
+          by accident.  */                                             \
+       sdiv_optab->handlers[(int) SImode].libfunc = NULL;              \
+       udiv_optab->handlers[(int) SImode].libfunc = NULL;              \
+       smod_optab->handlers[(int) SImode].libfunc = NULL;              \
+       umod_optab->handlers[(int) SImode].libfunc = NULL;              \
+        smul_optab->handlers[(int) SImode].libfunc = NULL;             \
+      }                                                                        \
     INIT_SUBTARGET_OPTABS;                                             \
   } while (0)
 
index 4a80013b968d44fe42a80a3152e34e8b86fcb445..ab127ec6043cafcee16c6f02919445b3924690e8 100644 (file)
@@ -3049,9 +3049,12 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
      not straightforward to generalize this.  Maybe we should make an array
      of possible modes in init_expmed?  Save this for GCC 2.7.  */
 
-  optab1 = (op1_is_pow2 ? (unsignedp ? lshr_optab : ashr_optab)
+  optab1 = ((op1_is_pow2 && op1 != const0_rtx)
+           ? (unsignedp ? lshr_optab : ashr_optab)
            : (unsignedp ? udiv_optab : sdiv_optab));
-  optab2 = (op1_is_pow2 ? optab1 : (unsignedp ? udivmod_optab : sdivmod_optab));
+  optab2 = ((op1_is_pow2 && op1 != const0_rtx)
+           ? optab1
+           : (unsignedp ? udivmod_optab : sdivmod_optab));
 
   for (compute_mode = mode; compute_mode != VOIDmode;
        compute_mode = GET_MODE_WIDER_MODE (compute_mode))