From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14120 invoked by alias); 8 Dec 2013 00:56:26 -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 14091 invoked by uid 48); 8 Dec 2013 00:56:20 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/59420] arm: broken code generated (memset from newlib 2.0) Date: Sun, 08 Dec 2013 00:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: RESOLVED 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 component resolution 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: 2013-12/txt/msg00632.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59420 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Component|c |middle-end Resolution|--- |INVALID --- Comment #3 from Andrew Pinski --- (In reply to Richard Earnshaw from comment #2) > You'll get more attention paid to this if you can describe why you think the > code generated is incorrect. The issue is there is a loop inside of memset that gets converted to a call to memset; that is if I read the assembly code correctly. if that is the case then this is a bug in the newlib makefiles as they should be using -fno-tree-loop-distribute-patterns or like what glibc does: /* Add the compiler optimization to inhibit loop transformation to library calls. This is used to avoid recursive calls in memset and memmove default implementations. */ #ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL # define inhibit_loop_to_libcall \ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns"))) #else # define inhibit_loop_to_libcall #endif So closing as invalid, please report this to newlib. Note the work around is not to use -O3 or use -O3 -fno-tree-loop-distribute-patterns .