Linux and aliasing?

Jeffrey A Law law@cygnus.com
Wed Jun 30 15:43:00 GMT 1999


  In message < 37591A00.ACE54339@moene.indiv.nluug.nl >you write:
  > Ah, yes, but the discussion is whether we should have gcc generate
  > "reasonable" behaviour where "reasonable" is defined by a small group of
  > users.  Note that all "behaviours" not explicitly required by the
  > Standard are prone to:
  > 
  > 1. Erosion (within a decade, gcc maintainers forget why we did this in
  >    the first place: "Hey, look at this code - what hair - and it is
  >    undefined behaviour according to the Standard in the first place;
  >    rip it out")
  > 
  > 2. Contradiction (the C0X Standard defines the previously undefined
  >    behaviour, but in a way incompatible with the "reasonable" behaviour
  >    we thought up here).
I can't agree more.  I haven't caught up on the whole thread yet, but in
general it seems like a mistake from a design standpoint to extend GCC in
the manner that I've seen suggested here.

If the Linux kernel folks don't want to change their (non-conforming) code,
then they should use -fno-strict-aliasing.  Yes it will inhibit some opts,
but that's the price one pays for writing non-conforming code.

jeff



More information about the Gcc mailing list