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]
Other format: [Raw text]

[Bug c++/33887] [4.1/4.2/4.3 Regression] Reference to bitfield gets wrong value when optimizing



------- Comment #22 from aoliva at gcc dot gnu dot org  2008-01-14 19:56 -------
Both are cases in which the absence of bit-field reduction *on widening
conversions* causes the problem.

I realize the absence of such reductions can be harmful in other cases as well,
e.g. division and right-shifts.  But for most cases, modulo semantics
guarantees the correct results as long as we stick to the narrower type. 
However, when modulo semantics is required, reduction must take place, e.g. for
compare operations that don't disregard the bits that are not in the type's
implied mask.

I believe the module semantics is the reasoning behind the no-reduction policy.
 But I do see that we fail to implement it properly, and I don't know whether
it is the front-end's responsibility to provide the missing bits explicitly, or
the  middle end to cover for what the front end might be assuming the middle
end will provide.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33887


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