public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-59420-4-CdVAleBwjx@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-59420-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59420

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |middle-end
         Resolution|---                         |INVALID

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(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 .


  parent reply	other threads:[~2013-12-08  0:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07 23:31 [Bug c/59420] New: " holler at ahsoftware dot de
2013-12-07 23:32 ` [Bug c/59420] " holler at ahsoftware dot de
2013-12-08  0:30 ` rearnsha at gcc dot gnu.org
2013-12-08  0:56 ` pinskia at gcc dot gnu.org [this message]
2013-12-08  2:29 ` [Bug middle-end/59420] " holler at ahsoftware dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-59420-4-CdVAleBwjx@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).