http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58242 UroÅ¡ Bizjak changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aivchenk at gmail dot com --- Comment #1 from UroÅ¡ Bizjak --- Patch at [1] that fixes this issue is awaiting review. [1] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01245.html >From gcc-bugs-return-428396-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 26 09:53:52 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 14489 invoked by alias); 26 Aug 2013 09:53: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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 14455 invoked by uid 48); 26 Aug 2013 09:53:47 -0000 From: "hp at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58243] New: Suboptimal structure initialization with tree-sra Date: Mon, 26 Aug 2013 09:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: hp 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc attachments.created Message-ID: 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-08/txt/msg01320.txt.bz2 Content-length: 1530 http://gcc.gnu.org/bugzilla/show_bug.cgi?idX243 Bug ID: 58243 Summary: Suboptimal structure initialization with tree-sra Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hp at gcc dot gnu.org CC: jamborm at gcc dot gnu.org Created attachment 30700 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0700&actioníit Example C code to be compiled at -O2 with/without -fno-tree-sra See the attached code, which initializes a structure 4 byte long and copies it through the pointer parameter in various similar functions, except func0 which does the same bitwise setting using unsigned int to act as a reference for the generated code (assuming a specific structure layout). All functions are functionally equivalent; all struct members are set to constants, either implicitly or explicitly, at initialization or afterwards, and should be compiled to the same code at -O2. With tree-sra (default) that does not happen: there's byte-wise setting for at least x86_64-linux, armv5-linux-gnueabi and cris-* for some of the functions. With -O2 -fno-tree-sra the same code is generated for all functions. Observed for x86_64-unknown-linux-gnu, armv5-linux-gnueabi and cris-elf at r201882. (I thought there already was a PR for this but couldn't find any.)