mailing list of musl libc
 help / color / mirror / code / Atom feed
* Warning: gcc 4.8.x may miscompile musl 0.9.12; workaround
@ 2013-08-01  0:27 Rich Felker
  2013-08-01  3:22 ` Rich Felker
  0 siblings, 1 reply; 2+ messages in thread
From: Rich Felker @ 2013-08-01  0:27 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Warning: gcc 4.8.x may miscompile musl 0.9.12; workaround
  2013-08-01  0:27 Warning: gcc 4.8.x may miscompile musl 0.9.12; workaround Rich Felker
@ 2013-08-01  3:22 ` Rich Felker
  0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2013-08-01  3:22 UTC (permalink / raw)
  To: musl

On Wed, Jul 31, 2013 at 08:27:56PM -0400, Rich Felker wrote:
> Passing --enable-optimize=fast to configure is an easy workaround for
> the problem. Another solution may be to add custom CFLAGS containing

Of course this should have read --enable-optimize=size...

Rich


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-01  3:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01  0:27 Warning: gcc 4.8.x may miscompile musl 0.9.12; workaround Rich Felker
2013-08-01  3:22 ` Rich Felker

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).