This is the mail archive of the gcc-bugs@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]

Re: An alias bug


> 
> 
> 
>   In message <199807120617.XAA31802@dm.cobaltmicro.com>you write:
>   > I see this come up now and again, so I'm finally going to ask.
>   > How do we tell users they can take one type, and look at "pieces" of
>   > it, when they use gcc?  Or are you saying that we declare "long long"
>   > as a special case in this regard?
> Put them in a union and extract elements from the union.
> 
> Or use memcpy to extract the bits from one thing and put them in another
> of a different type.  
> 
> Or claim one of the  things is volatile.
> 
> HJ's testcase basically as a useless cast to try and trip the "bug".
> you can remove the whole ((long_long_type *)&u)->l[1] and replace it
> with just (u & 0xffffffff).  Actually HJ's testcase could just as
> easily fail with gcc-2.7 since the "bug" it's trying to trigger exists
> there too.
> 

That is not true. My testcase works with egcs 1.0.3 and gcc 2.7.2.3.
Mark suggested another patch which fixes it.


H.J.


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