From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24256 invoked by alias); 8 Jan 2015 14:36:08 -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 24193 invoked by uid 48); 8 Jan 2015 14:36:03 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/64410] gcc 25% slower than clang 3.5 for adding complex numbers Date: Thu, 08 Jan 2015 14:36: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.9.2 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: 2015-01/txt/msg00474.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64410 --- Comment #8 from Marc Glisse --- (In reply to Richard Biener from comment #5) > (In reply to Marc Glisse from comment #1) > > There are a number of things that make it complicated. > > 1) gcc doesn't like to vectorize when the number of iterations is not known > > at compile time. > > Not an issue, we know it here (it's symbolic) IIRC I tried modifying the original code by replacing all complex operations by explicit scalar operations and it failed to vectorize, but worked when replacing the number of iterations by a constant. > > 3) the ABI for complex uses 2 separate double instead of a vector of 2 > > double. > > I think that's unrelated. Indeed, it's just that with a different ABI we could have been lucky and stumbled upon the optimal code, almost by accident.