This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 4.8 and -ftree-loop-distribute-patterns.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]