This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Inline __udiv_w_sdiv into __divdi3 etc.
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>, rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 23 Oct 2002 00:30:50 +0200
- Subject: Re: [PATCH] Inline __udiv_w_sdiv into __divdi3 etc.
- Sensitivity:
Hans-Peter Nilsson wrote:
>I think you should mark it with attribute always_inline, see
>config/fp-bit.c.
Hmm, I was only following existing precedent (__udivmoddi4).
But you're right, the functions are not actually inlined with
the current inliner heuristics :-(
The following patch adds the always_inline attribute to both
__udiv_w_sdiv and __udivmoddi4.
Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux,
verified that now they *are* inline ;-)
OK to apply?
ChangeLog:
* libgcc2.c (__udiv_w_sdiv): Use attribute ((always_inline)) when
inlining it into other libgcc2 routines.
(__udivmoddi4): Likewise.
Index: gcc/libgcc2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/libgcc2.c,v
retrieving revision 1.152
diff -c -p -r1.152 libgcc2.c
*** gcc/libgcc2.c 21 Oct 2002 23:10:38 -0000 1.152
--- gcc/libgcc2.c 22 Oct 2002 20:38:37 -0000
*************** __muldi3 (DWtype u, DWtype v)
*** 377,383 ****
#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)
--- 377,383 ----
#if defined (sdiv_qrnnd)
#if (defined (L_udivdi3) || defined (L_divdi3) || \
defined (L_umoddi3) || defined (L_moddi3))
! static inline __attribute__ ((__always_inline__))
#endif
UWtype
__udiv_w_sdiv (UWtype *rp, UWtype a1, UWtype a0, UWtype d)
*************** const UQItype __clz_tab[] =
*** 511,517 ****
#if (defined (L_udivdi3) || defined (L_divdi3) || \
defined (L_umoddi3) || defined (L_moddi3))
! static inline
#endif
UDWtype
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
--- 511,517 ----
#if (defined (L_udivdi3) || defined (L_divdi3) || \
defined (L_umoddi3) || defined (L_moddi3))
! static inline __attribute__ ((__always_inline__))
#endif
UDWtype
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
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