This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH] Disable mod libfunc for ARM BPAPI


Hi,

This is a patch from the csl-arm branch. The original message is here:

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg02077.html

The ARM BPAPI only defines divmod helper functions, not individual mod functions. This patch stops gcc trying to use nonstandard mod-only libcalls on such targets.

Tested with cross to arm-none-eabi.

OK to apply?

Julian

ChangeLog (Paul Brook):

* config/arm/arm.c (arm_init_libfuncs): Clear mod optabs.
Index: gcc/config/arm/arm.c
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.442
diff -c -p -r1.442 arm.c
*** gcc/config/arm/arm.c	12 Apr 2005 06:33:25 -0000	1.442
--- gcc/config/arm/arm.c	18 Apr 2005 16:26:18 -0000
*************** arm_init_libfuncs (void)
*** 755,760 ****
--- 755,767 ----
    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]