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]

Re: [tree-ssa] More CCP fixes [patch]


Fergus Henderson wrote:-

> On 12-Aug-2002, Mark Mitchell <mark@codesourcery.com> wrote:
> 
> That sounds reasonable to me so long as you are talking about the C++
> front-end.  For the language-independent form of trees, IMHO bit-fields
> should be treated as a distinct type.  C++ can represent them how it
> likes during parsing, semantic analysis, etc., but IMHO the C++ front-end
> should have to introduce the new types before passing the trees off to
> the language-independent parts of the compiler.
> 
> The idea of treating bit-fields as having the same type as something
> with a different set of values and a different sized representation
> is IMHO an ugly hack.  The C89 standard wasn't clear about whether bit-fields
> constituted a distinct type, but it has been clarified in defect reports
> and fixed in C99.  Unfortunately C++98 has perpetuated the mistake.
> But this nasty C/C++-ism should IMHO not be incorporated into GCC's
> language-independent interface.

Has it been reported as a C++ defect, too, then?  Or is C++ branching
at this point?

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.

Neil.


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