This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs do not call `__divqi3'
- To: law at cygnus dot com
- Subject: Re: egcs do not call `__divqi3'
- From: Torbjorn Granlund <tege at matematik dot su dot se>
- Date: Sun, 21 Feb 1999 22:39:54 +0100
- cc: Denis Chertykov <denis at medo dot fov dot uni-mb dot si>, egcs at egcs dot cygnus dot com
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