From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26259 invoked by alias); 26 Jun 2014 14:48:18 -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 26093 invoked by uid 48); 26 Jun 2014 14:48:08 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/61619] Benefits from -ftree-vectorize lost easily when changing unrelated code Date: Thu, 26 Jun 2014 14:48: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: bug_status cc assigned_to 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-06/txt/msg02134.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61619 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jamborm at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #3 from Richard Biener --- ._94/3491 (constexpr const long unsigned int ._94 [1]) @0x7ffff1d5ca90 Type: variable definition analyzed Visibility: prevailing_def_ironly artificial References: Referring: main/3232 (read) Availability: available Varpool flags: initialized read-only const-value-known Ok, for the above SRA fails to do a scalar replacement and value-numbering doesn't even reach the aggregate copy from the constant initializer. That's because only PRE exposes it and PRE doesn't do all the fancy VN tricks. I suppose I have to look closer at some point. Interesting testcase showing possible issues with C++ constexpr initializers. Note that we also have MEM[(char * {ref-all})&S] = MEM[(char * {ref-all})&._94]; but this aggregate copy has sizeof (long) so we could have optimized it (it's ref-all already) to use an integer type. This is lowered from array::array (&S, (const struct initializer_list &) &TARGET_EXPR ) to D.64552._M_array = &._94; D.64552._M_len = 1; try { array::array (&S, &D.64552); } which eventually ends up calling memmove which we optimize to the aggregate assignment.