This is the mail archive of the gcc-patches@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] |
IMO the open PRs assigned to me related to bitfields, 6 or 7 of them, show why having different types is a good idea. GCC better understands the range of non-overflow values, and gets sign promotion correct. Having the same type makes promotion and various other things work incorrectly, because of assumptions scattered around various parts of GCC.
What goes wrong if we simply make explicit the truncations and extensions? For example, consider: struct S { int i : 3; }; S s; int j; s.i = j; j = s.i; If the last two lines were represented as: s.i = j & 0x7; j = sign_extend(s.i); would that work? -- Mark Mitchell mark@codesourcery.com CodeSourcery, LLC http://www.codesourcery.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |