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: Adding UNION/MAP -- Feedback and tips pls!


On Mar 6 2013, Russell Brennan wrote:

Perhaps I misunderstand how you are defining failure here... what would be the failure mode? Perhaps if you could provide an example of the ill-effects that could be seen as a result of this behavior it would clarify the issue?

Generating bad code. In:


   union {
       double x[10];
       double y;
   } fred, joe;
   fred.y = 0.0;
   joe = fred;
   call alf(fred);

The compiler is permitted to copy only a single double in either of
the last two statements, because the last use was via y.  That liberty
dates from C90, but C99 effective types extended it to many more cases.

If you break the semantic rules of a language, it is common to see no
error until you enable optimisation, whereupon it produces wrong answers
and the average user claims that the optimiser is broken.


Regards, Nick Maclaren.



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