From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11193 invoked by alias); 26 Mar 2014 21:58:24 -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 11141 invoked by uid 55); 26 Mar 2014 21:58:21 -0000 From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/60315] [4.8/4.9 Regression] template constructor switch optimization Date: Wed, 26 Mar 2014 21:58: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: hubicka at ucw dot cz 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/msg02478.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60315 --- Comment #16 from Jan Hubicka --- > 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. Yep, it seems that the "complicate" transform is actually the most generic thing to do. (we won't need to modify all FE's and we will likely get more simplifications done) Shall I try to dig into it or you know how to do that better?