mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Warning: gcc 4.8.x may miscompile musl 0.9.12; workaround
Date: Wed, 31 Jul 2013 20:27:56 -0400	[thread overview]
Message-ID: <20130801002756.GA20164@brightrain.aerifal.cx> (raw)

Hi,

In connection to the discussion on ARM memcpy and GCC generating
an infinite-self-recursive memcpy, I've now had at least one report of
the issue affecting memset too. The relevant GCC ticket is:

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

The problem occurred with GCC 4.8.1 on x86_64. I'm not sure which
archs are affected, but as memset is a widely-used function, you'll
know right away if you are affected.

The problem seems to coincide with commit
a80847d86a8865a78fdbebe7f9e2533f7a74e010, which added the ability
(enabled by default) to compile certain parts of musl selectively with
the -O3 optimization level; string functions are included by default.

Passing --enable-optimize=fast to configure is an easy workaround for
the problem. Another solution may be to add custom CFLAGS containing
-fno-tree-loop-distribute-patterns as suggested in the GCC tracker
thread.

Note that earlier versions of musl are also affected if you manually
enable -O3.

This will definitely be fixed in the next release, even though it's
really a GCC bug.

Rich


             reply	other threads:[~2013-08-01  0:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  0:27 Rich Felker [this message]
2013-08-01  3:22 ` Rich Felker

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=20130801002756.GA20164@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).