This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] MIPS, use trap instead of break to detect divide by zero
Richard Sandiford wrote:
> David Daney <ddaney@avtrex.com> writes:
>
>>>adjust the length attribute of the division instruction.
>>
>>Currently only integer division operations call mips_output_division()
>>and are the only ones effected. As far as I can see, there are no size
>>attributes defined for integer division on mips.md.
>
>
> See the define_attr definition of the "length" attribute
> and mips_idiv_insns().
>
Scary, I am now modifying mips.md and it is doing what I want (on 3.4.1
that is, as in 3.5 the change is to mips_idiv_insns()).
Next question:
All linux kernels that do not have the patches checked into
linux-mips.org last week will generate SIGTRAP instead of SIGFPE on
divide by zero when using traps. Also gas has options to select use of
trap vs. break for this when it is expanding div macros.
If I port this to 3.5 and try to get approval to check it in, should
there be a command line switch to choose trap vs. break ?
David Daney.