This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[csl-arm] Disable mod libfunc.

The Arm BPABI only defines divmod helper functions, not individual mod 
functions. Patch below stops gcc trying to use the nonstandard mod-only 
libcalls on such targets.

Tested with cross to arm-none-eabi.
Applied to csl-arm-branch.


2005-01-27  Paul Brook  <>

 * config/arm/arm.c (arm_init_libfuncs): Clear mod optabs.

Index: arm.c
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.303.2.69
diff -u -p -r1.303.2.69 arm.c
--- arm.c 26 Jan 2005 20:14:18 -0000 1.303.2.69
+++ arm.c 27 Jan 2005 15:58:23 -0000
@@ -742,6 +742,13 @@ arm_init_libfuncs (void)
   set_optab_libfunc (udiv_optab, DImode, "__aeabi_uldivmod");
   set_optab_libfunc (sdiv_optab, SImode, "__aeabi_idivmod");
   set_optab_libfunc (udiv_optab, SImode, "__aeabi_uidivmod");
+  /* We don't have mod libcalls.  Fortunately gcc knows how to use the
+     divmod libcalls instead.  */
+  set_optab_libfunc (smod_optab, DImode, NULL);
+  set_optab_libfunc (umod_optab, DImode, NULL);
+  set_optab_libfunc (smod_optab, SImode, NULL);
+  set_optab_libfunc (umod_optab, SImode, NULL);
 /* Fix up any incompatible options that the user has specified.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]