From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17276 invoked by alias); 18 Feb 2015 03:20:07 -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 17115 invoked by uid 48); 18 Feb 2015 03:19:54 -0000 From: "solar-gcc at openwall dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/51017] GCC 4.6 performance regression (vs. 4.4/4.5), PRE increases register pressure Date: Wed, 18 Feb 2015 03:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.6.2 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: solar-gcc at openwall dot com X-Bugzilla-Status: NEW 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: 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-02/txt/msg01954.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51017 --- Comment #19 from Alexander Peslyak --- (In reply to Alexander Peslyak from comment #17) > Should we create a new bug for the unnecessary and non-optional use of > unaligned load instructions for source code like this, or is this considered > the new intended behavior despite of the major slowdown on such CPUs? > (Presumably not only for JtR. I'd expect this to affect many programs.) Upon further analysis, I now think that this was my fault, and (presumably) not common in other programs. What I had was differing definition vs. declaration, so a bug. The lack of alignment specification in the declaration of the struct essentially told (newer) GCC not to assume alignment - to an extent greater than e.g. a pointer would. As far as I can tell, GCC does not currently produce unaligned load instructions (so assumes that SSE* vectors are properly aligned) when all it has is a pointer coming from another object file. I think that's the common scenario, whereas mine was uncommon (and incorrect). So let's focus on PRE only.