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: module level flags


On Oct  1, 2002, Joe Buck <Joe.Buck@synopsys.com> wrote:

> In practice, the case for unions will be supported by all compilers that
> are acceptable to users: code to use unions to get at the bit-level
> representation of floating-point numbers is required, and it is
> well-understood to be implementation-dependent.  Without the ability to
> write unions one way and read them another way, it's not possible to
> write IEEE isnan() or isinf() routines in C; assembly would be needed.

Unless you use volatile.

>> A hard error would probably be inappropriate, since the compiler can't
>> tell in general whether the code in question would actually be
>> executed, a condition necessary for the undefined behavior to actually
>> be invoked.

> At least in the case where the bad code is always reached if the
> function is called, a hard error might be reasonable.

Nope.  Consider a function that would only be called with arguments
that were known not to run into any aliasing problems.  When the
compiler can't tell, it is required to translate the code.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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