This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51994] [4.6/4.7 Regression] git-1.7.8.3 miscompiled due to negative bitpos from get_inner_reference
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Jan 2012 11:00:33 +0000
- Subject: [Bug middle-end/51994] [4.6/4.7 Regression] git-1.7.8.3 miscompiled due to negative bitpos from get_inner_reference
- Auto-submitted: auto-generated
- References: <bug-51994-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51994
--- Comment #20 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-01-26 11:00:33 UTC ---
> Eric, you should know this area the best - what do you recommend here?
> [we could assert in the unsigned bitpos taking functions that the MSB
> is not set on bitpos]
I agree that making get_inner_reference artificially return a non-zero poffset
would most certainly be problematic as this would change the semantics. But
it's also clear that the lower level bit-field manipulation routines aren't
really prepared to deal with negative stuff. So I think that we shouldn't
change the prototypes of these routines, but instead patch up callers that
forward the values returned by get_inner_reference to these routines.
Adding assertions in these routines could indeed help.