From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 882 invoked by alias); 15 Jun 2013 07:12:16 -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 805 invoked by uid 48); 15 Jun 2013 07:12:09 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56493] Performance regression in google dense hashmap Date: Sat, 15 Jun 2013 07:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: 2013-06/txt/msg00775.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56493 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |ktietz at gcc dot gnu.org, | |law at gcc dot gnu.org --- Comment #11 from Jakub Jelinek --- The reduced testcase has been slowed down by r176072, aka PR45437. If you want to speed it up by source code changes, q += (unsigned int) f(i); would do instead of q += f(i);, or you can do q = q + f(i);. Before that bugfix, the C++ FE produced (void) (q = (int) ((unsigned int) f (i) + (unsigned int) q)) which is generally wrong (say if q was addressable and f could modify it), after it we generate (void) (q = TARGET_EXPR ;, (int) ((long unsigned int) q + D.2078);) The question is why the narrowing of the operation (to be done on unsigned int rather than long unsigned int) isn't performed here, that is something we do right now solely in the FE. There are PRs (PR45397 and PR47477) about lack of type demotion (and promotion) on GIMPLE, but don't know what the current state of that is.