From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15779 invoked by alias); 5 Jul 2013 12:33:20 -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 15746 invoked by uid 48); 5 Jul 2013 12:33:17 -0000 From: "amylaar at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57830] New: fold_builtin_memory_op expands memcpy without regard to -Os Date: Fri, 05 Jul 2013 12:33: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.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amylaar 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 bug_severity priority component assigned_to reporter 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-07/txt/msg00315.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57830 Bug ID: 57830 Summary: fold_builtin_memory_op expands memcpy without regard to -Os Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amylaar at gcc dot gnu.org I see that the memcpy call at the end of gcc.dg/strlenopt-10.c:fn2.c is expanded for the avr target (which has "#define BIGGEST_ALIGNMENT 8", i.e. the "dest_align < TYPE_ALIGN (desttype)" test at builtins.c:8923 succeeds) irrespective of -Os or the size of the copied object. So this generates 20 loads, 20 stores, ancillary address arithmetic, and sky-high register pressure with 18 call-saved registers saved in the prologue and restored in the epilogue. Just leaving the call to memcpy alone would generate shorter code.