This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Patch to allow strlen expander to fail


Martin v. Loewis wrote:

> I wrote:

> > I probably should go to sleep - flag_hosted == 0 implies flag_no_builtin
> > - so it should work correctly.  The Linux makefile(s) simply have to
> > specify -ffreestanding to get this to work correctly.

> Not quite:

[ .... example elided ... ]

> so it generated a memcpy call even with -ffreestanding. This is
> because of (what I consider) a bug in gcc, which emits a call to
> memcpy even when asked not to. The technical reason is that
> -fno-builtin only disables availability of inline-optimizations for
> user memcpy calls - the memcpy call generated by the block mover is
> hard-coded, and does not care about freestanding or not.

Bweh - I was afraid of that but couldn't find an example that showed the
problem.  Thanks for that.  AFAICS, my conclusion is yours: This means
that GCC doesn't support freestanding compilation correctly.

The block mover should be fixed in the sense that it uses memcpy only if
flag_hosted is true.  But I wouldn't be surprised if there were more
places in the compiler where this isn't handled correctly ...

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://gcc.gnu.org/onlinedocs/g77_news.html

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