public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "acahalan at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/29171] forgotten memcpy with -ffreestanding -fwhole-program --combine
Date: Tue, 26 Jun 2007 03:37:00 -0000	[thread overview]
Message-ID: <20070626033741.28274.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29171-12219@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from acahalan at gmail dot com  2007-06-26 03:37 -------
(In reply to comment #5)
> This is related to or really a dup of bug 4417.

It's only related, not a dup, though bug 4417 is sort of a subset.

There appears to be no possible set of gcc options that will allow compiling
non-trivial programs with -fwhole-program --combine. With or without the
-ffreestanding option, gcc will leave undefined references to various string.h
things. It does not matter if the program provides these functions in *.c
files.

With -ffreestanding, gcc ought to avoid using memcpy. Without, gcc ought to
call the one I'm providing. (both should work; neither one does)

Right now neither works, making -fwhole-program --combine 100% useless.

Alternately, the documentation is not correct, and the user can indeed link
with other things. (if I supply memcpy via some other binary file, then I am
NOT supplying the "whole program" to the compiler and am thus violating the
rules -- perhaps "whole program" needs a very detailed definition regarding *.S
files, system headers, libgcc.a, libgcc.so, libc.so, and so on) According to
the documentation, a command line with "--combine foo.c bar.c baz.S" would
invoke the C front end on foo.c and bar.c only; they thus become the
compilation unit. Adding -fwhole-program adds the requirement that the current
compilation unit (foo.c and bar.c) be the whole program, thereby excluding
baz.h from being part of the program.


-- 


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


  parent reply	other threads:[~2007-06-26  3:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-21 17:53 [Bug c/29171] New: " acahalan at gmail dot com
2006-09-21 17:57 ` [Bug middle-end/29171] " pinskia at gcc dot gnu dot org
2006-09-21 18:16 ` acahalan at gmail dot com
2006-09-21 18:49 ` acahalan at gmail dot com
2006-09-21 20:36 ` pinskia at gcc dot gnu dot org
2007-06-25 16:45 ` pinskia at gcc dot gnu dot org
2007-06-26  3:37 ` acahalan at gmail dot com [this message]
2010-09-17  9:09 ` rguenth at gcc dot gnu dot org

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=20070626033741.28274.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).