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

Re: Miscompilation of remainder expressions


Gabriel Paubert wrote:
\
No, because the instruction has actually two result values:

- the remainder, which you could safely set to zero (not 1!)

- the quotient, which is affected by the overflow and there may be
  compiler and languages that rely on the exception being generated.

But the division is undefined, programs have no right to rely on an exception being generated.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]