From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5411 invoked by alias); 28 May 2014 12:24: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 5109 invoked by uid 48); 28 May 2014 12:24:43 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58483] missing optimization opportunity for const std::vector compared to std::array Date: Wed, 28 May 2014 12:24: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.8.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: glisse at gcc dot gnu.org 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: bug_status cf_reconfirmed_on everconfirmed 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-05/txt/msg02405.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483 Marc Glisse changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-05-28 Ever confirmed|0 |1 --- Comment #6 from Marc Glisse --- With current trunk, for the vector version, the most obvious optimization failure is the following: _57 = (unsigned long) &MEM[(void *)&._79 + 12B]; _36 = (unsigned long) &MEM[(void *)&._79 + 4B]; _51 = _57 - _36; _3 = _51 /[ex] 4; _26 = _3; _27 = _26 + 1; _31 = _27 * 4; etc. _51 should be folded to 8 (then we have the usual useless /4*4, but with a constant it would be ok). This part is a 4.9/4.10 regression, gcc-4.8 managed to get the constant 12: __builtin_memcpy (_33, &._80, 12);