[PATCH] Fix bootstrap issues with C++

Joseph S. Myers joseph@codesourcery.com
Sat Jun 5 12:32:00 GMT 2010


On Tue, 1 Jun 2010, Mark Mitchell wrote:

> Jakub Jelinek wrote:
> 
> >>> Well - it's pre-existing, this just completes it to avoid
> >>> unused or set-but-not-used warnings.
> >> How are designated intializers relevant?
> > 
> > Because C++ doesn't support them?
> 
> Well, sure, but the patch didn't seem to be removing any use of
> designated initializers.  I guess, reading between the line, that it
> removes a variable that itself is used only if there are designated
> initializers.  That's fine; I'm not second-guessing the patch, I think
> just think it would be helpful to briefly state the rationale for
> patches necessary to make GCC compile with a C++ compiler.

In the case of designated initializers, it would also be helpful for 
someone to indicate the performance cost of not using them when GCC is 
built with a C++ compiler.  How much startup time is spent on 
initialization that would be done with designated initializers when built 
as C?  Is there any effect on performance after startup?  Designated 
initializers are used, optionally, for a reason (or so I suppose).  It 
might make sense to add support for a sufficient subset of designated 
initializers (for what GCC uses, e.g. selecting fields of unions to 
initialized in initializers generated by genoutput.c) to the C++ front 
end, or to work out equivalent C++ idioms that are equally efficient.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list