From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8405 invoked by alias); 27 Mar 2014 07:30:51 -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 8319 invoked by uid 55); 27 Mar 2014 07:30:45 -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: Thu, 27 Mar 2014 07:30: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/msg02493.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60315 --- Comment #17 from rguenther at suse dot de --- On March 26, 2014 10:58:18 PM CET, hubicka at ucw dot cz wrote: >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? I've posted a patch but it causes some regressions I need to investigate.