Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #16150

Re: Bit-field union bug

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.lang.c
Subject Re: Bit-field union bug
Date 2012-01-25 00:36 +0000
Organization A noiseless patient Spider
Message-ID <20120124163119.715@kylheku.com> (permalink)
References <j3m8np$8gv$1@speranza.aioe.org> <610e0e48-76c6-476b-8303-2c0055781cdc@s35g2000prm.googlegroups.com> <gvab67hq7evufs0upu3aliat65c14bofqu@4ax.com> <kfnhazkhn3h.fsf@x-alumni2.alumni.caltech.edu> <jfnhg7$ahl$1@dont-email.me>

Show all headers | View raw


On 2012-01-25, ec429 <ec429@cam.ac.uk> wrote:
> On 24/01/12 20:17, Tim Rentsch wrote:
>> Identical layout is not enough to make things work in
>> the presence of type-sensitive optimization.  In the
>> past one could generally get away with such things,
>> but that's becoming less true as time goes on.
> Why is this?  If the two struct (say) types have been defined 
> identically, what optimisation can the compiler possibly make that'll be 
> valid for one but not the other?

It can assume that foo->x = 42 has no effect on the value of bar->x, continuing
to use a stale cached value, because foo and bar are pointers to different
declared structure types.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Bit-field union bug Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-24 12:17 -0800
  Re: Bit-field union bug ec429 <ec429@cam.ac.uk> - 2012-01-25 00:13 +0000
    Re: Bit-field union bug Kaz Kylheku <kaz@kylheku.com> - 2012-01-25 00:36 +0000
    Re: Bit-field union bug Tim Rentsch <txr@alumni.caltech.edu> - 2012-01-31 14:54 -0800

csiph-web