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 ipa/60315] [4.8/4.9 Regression] template constructor switch optimization


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

--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 26 Mar 2014, hubicka at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60315
> 
> --- Comment #14 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
> The compile time hog issue is fixed now.  We still fix the predicates for
> switch statement (to get pass NOP_EXPR) since it seems very common pattern. 
> Richard: I suppose we can't fold away the NOP_EXPR easily earlier?

forwprop would do that, but the enum is unsigned int while the
switch value is int and thus simplify_gimple_switch bails out
because the conversion is not value-preserving.

So the frontend would need to be changed here or we need to
"complicate" the transform by not looking at the type of
the existing switch argument but instead by looking at the
actual switch label values to see if their value would be
preserved.  But yes, that enum -> int conversion asked for
by the C++ standard seems to be common that this should be
worth the trouble.


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