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: signed is undefined and has been since 1992 (in GCC)


On Tue, Jun 28, 2005 at 03:31:59PM -0400, Robert Dewar wrote:
> Gabriel Dos Reis wrote:
> 
> >The strict aliasing rule by itself does not show it is not a high level
> >assembly language.  There are chips out there where you cannot access
> >data willy-nilly through random register types.
> 
> And there are chips for which signed arithmetic is not wrap around!

No, there are not.  There are chips that possess a signed add instruction
that traps, but those same chips possess an unsigned add instruction that
does not trap, so any sane C compiler writer would choose the latter
instruction.  At the instruction level, there are no signed or unsigned
operands, only signed or unsigned operations.

I challenge you, Robert, to find us a C compiler that generates trapping
instructions for integer adds by default.  I do not believe that such a
compiler exists.


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