[LLVMdev] Integer divide by zero

dag at cray.com dag at cray.com
Tue Apr 16 09:35:58 PDT 2013


Owen Anderson <resistor at mac.com> writes:

> As I've pointed out, clang does provide such functionality as an
> opt-in feature through its -fsanitize options.  A hypothetical Fortran
> frontend could do the same, and even make it an opt-out feature if it
> chose.  I'm sorry if its implementation mechanism doesn't match
> exactly what you want it to be, but it's not like nobody else has
> thought about this problem.  They have, and they've designed and
> shipped a solution!

The problem with a clang implementation is that not everyone uses clang.
It sure would be nice to have an option that could be set to not
constant fold traps away.  Then it would be easy for implementors to
just set that option if they want.

This is an optimization/codegen issue so it seems to me the fix ought to
be there, not in the frontend.

Is there great harm in adding an option here?

                           -David




More information about the llvm-dev mailing list