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

Renato Golin renato.golin at linaro.org
Mon Sep 8 01:19:42 PDT 2014


> Why not adjust this instead?

I was just being conservative. I don't know what else depends on this
library and I don't want to change things outside of my scope.

Since returning zero is consistent with the EABI, I don't think we
should deviate from that norm, not without a lot of thought, at least.


> We could use __rt_raise(2, 2), which would need to call signal as well, so
> you end up growing a dependency on the target environment's libc
> implementation.  I think that expanding the responsibility of compiler-rt
> from supporting the code generation from the compiler to integrating into
> the target environment's libc can be problematic.

I wasn't proposing we signal, but that we return zero, instead of the argument.

Today we return either zero (in divmod/div/mod) or the argument (when
calling div0 directly), and that's just wrong.


> Why 0 and not infinity?  Or some other value?

Because 0 is what it was before.

cheers,
--renato



More information about the llvm-dev mailing list