This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: GCC 4.8 and -ftree-loop-distribute-patterns.
- From: Rich Felker <dalias at aerifal dot cx>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Date: Fri, 19 Apr 2013 14:22:01 -0400
- Subject: Re: GCC 4.8 and -ftree-loop-distribute-patterns.
- References: <511D4F82 dot 3080604 at redhat dot com> <515F4565 dot 6030301 at linux dot vnet dot ibm dot com> <20130405215301 dot GG20323 at brightrain dot aerifal dot cx> <Pine dot LNX dot 4 dot 64 dot 1304191648000 dot 21258 at digraph dot polyomino dot org dot uk>
On Fri, Apr 19, 2013 at 04:49:34PM +0000, Joseph S. Myers wrote:
> On Fri, 5 Apr 2013, Rich Felker wrote:
>
> > When building "part of the implementation" such a libc, -ffreestanding
> > should be passed to the compiler to let it know it cannot assume the
> > existence of an underlying hosted implementation. This should disable
> > all such optimizations. If it doesn't, it's a bug in the compiler.
>
> -ffreestanding is documented to require memcpy, memmove, memset, memcmp
> and in certain circumstances abort, in addition to libgcc functions, from
> the runtime environment.
I would still consider this a bug in the implementation of
-ffreestanding, since the standard reads:
"A conforming freestanding implementation shall accept any strictly
conforming program that does not use complex types and in which the
use of the features specified in the library clause (clause 7) is
confined to the contents of the standard headers <float.h>,
<iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, <stddef.h>, and
<stdint.h>."
(Source: C99 4. Conformance, paragraph 6)
At the very least, if GCC assumes the existence of the above
functions, then -ffreestanding is not providing a conforming
freestanding implementation nor a safe basis for building a hosted
implementation.
Rich