This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Inline __udiv_w_sdiv into __divdi3 etc.
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Oct 2002 22:04:36 +0200
- Subject: [PATCH] Inline __udiv_w_sdiv into __divdi3 etc.
- Sensitivity:
Hello,
this patch also removes warnings, but in this case the warnings actually
indicated things were going wrong :-/
In libgcc2.h there is this comment:
/* __udiv_w_sdiv is static inline when building other libgcc2 portions. */
#if (!defined(L_udivdi3) && !defined(L_divdi3) && \
!defined(L_umoddi3) && !defined(L_moddi3))
extern UWtype __udiv_w_sdiv (UWtype *, UWtype, UWtype, UWtype);
#endif
indicating that __udiv_w_sdiv is supposed to be inlined into the
division routines (like e.g. __udivmoddi4 is also).
However, this is not actually the case in libgcc2.c, resulting in
'no previous prototype' warnings and explicit function calls.
This patch does declare __udiv_w_sdiv as static inline, fixing
those warnings.
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.
OK to apply?
ChangeLog:
* libgcc2.c: Inline __udiv_w_sdiv when compiling __udivdi3,
__divdi3, __umoddi3, or __moddi3.
Index: gcc/libgcc2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcc2.c,v
retrieving revision 1.150
diff -c -p -r1.150 libgcc2.c
*** gcc/libgcc2.c 8 Oct 2002 23:50:56 -0000 1.150
--- gcc/libgcc2.c 21 Oct 2002 18:02:24 -0000
*************** __muldi3 (DWtype u, DWtype v)
*** 366,373 ****
--- 366,382 ----
}
#endif
+ #if (defined (L_udivdi3) || defined (L_divdi3) || \
+ defined (L_umoddi3) || defined (L_moddi3))
+ #define L_udiv_w_sdiv
+ #endif
+
#ifdef L_udiv_w_sdiv
#if defined (sdiv_qrnnd)
+ #if (defined (L_udivdi3) || defined (L_divdi3) || \
+ defined (L_umoddi3) || defined (L_moddi3))
+ static inline
+ #endif
UWtype
__udiv_w_sdiv (UWtype *rp, UWtype a1, UWtype a0, UWtype d)
{
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com