From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12505 invoked by alias); 26 Mar 2014 09:00:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12387 invoked by uid 55); 26 Mar 2014 09:00:07 -0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/60315] [4.8/4.9 Regression] template constructor switch optimization Date: Wed, 26 Mar 2014 09:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: minor X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg02394.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60315 --- Comment #15 from 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 --- > 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.