[LLVMdev] [Compiler-RT] [ARM] Where __aeabi_[il]div0 builtins should be implemented?

Sergey Dmitrouk sdmitrouk at accesssoftek.com
Fri Sep 5 11:10:01 PDT 2014


Hi,

There are several places in compiler-rt which refer to __aeabi_idiv0.
For example, in lib/builtins/arm/udivsi3.S:

#ifdef __ARM_EABI__
    b __aeabi_idiv0
#else
    JMP(lr)
#endif

At the same time there is no definition of it.  It looks as if it was
done intentionally so that third-party could provide custom handler for
division by zero.

IMHO It's not very consistent and looks odd as all other __aebi_*
functions are provided by compiler-rt.

Did I get it all right or maybe I'm missing something?

libgcc provides both __aeabi_idiv0 and __aeabi_ldiv0 as weak symbols,
any reasons not to do the same in compiler-rt?  Or, to put it
differently, why force external implementation of these functions?

Thanks,
Sergey



More information about the llvm-dev mailing list