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]

Re: egcs do not call `__divqi3'


  But a breakpoint in expmed.c::expand_divmod and start debugging :-)

Actually, I don't think that will help.  :-)

I suspect the compiler has already promoted the operaration before we arrive
to expand_divmod.

C defines that all smaller-than-int arithmetic behave as if it is promoted
to (the appropriate sign flavour of) int.  We can sometimes achieve this
effect without actually performing any promotion.  But if we computed a
8-bit division using 8 bit division, we would get overflow and unpredicatble
results for (-128)/(-1).  Promoting to 16-bit however works.

(The unsinged case is simpler, of course.)

Torbjörn


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