From: Paul Schlie <schlie@comcast.net>
To: <gcc@gcc.gnu.org>
Subject: Re: memcpy / Language Lawyer / optimization question
Date: Fri, 10 Dec 2004 03:18:00 -0000 [thread overview]
Message-ID: <BDDE7FAD.8302%schlie@comcast.net> (raw)
In-Reply-To: <20041209155339.B26193@synopsys.com>
> From: Joe Buck <Joe.Buck@synopsys.COM>
> On Thu, Dec 09, 2004 at 05:54:08PM -0500, Paul Schlie wrote:
>> As a more general but related question: as C does not define/specify
>> everything, and even occasionally specifies something as being explicitly
>> "unspecified", giving license to the complier to express whatever incidental
>> behavior it may have; has the GCC team adopted the strategy that it will
>> strive to adopt and document the behavior which seems most generally useful
>> and/or least-fragile in such circumstances ... ?
>
> No, because such a design decision would lead to a compiler that produces
> extremely slow code. Some programmer might accidentally try to use
> unaligned integers on a processor that does not support unaligned word
> accesses, so your dictum would force the compiler to do all memory
> accesses one byte at a time, just so that this hypothetical programmer can
> continue to write sloppy code.
>
> If, as a programmer, you follow the language standard, the gcc team will
> immediately accept that any failure to handle your code is a gcc bug.
> Same goes for use of a documented extension in a documented way. Do
> otherwise, and you are on your own.
> From: Geoffrey Keating <geoffk@geoffk.org>
> No, that strategy has not been adopted. This avoids arguments about
> what is "most generally useful" or "least-fragile". What people
> usually mean by such statements is "whatever compiler X does" or
> "whatever the previous version of GCC does" or "this particular
> behaviour that my program expects", and generally you can find
> evidence in that form for many possible behaviours.
Thanks, understood.
-paul-
next prev parent reply other threads:[~2004-12-10 3:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-09 22:54 Paul Schlie
2004-12-09 23:36 ` Geoffrey Keating
2004-12-09 23:53 ` Joe Buck
2004-12-10 3:18 ` Paul Schlie [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-12-09 19:33 Steve Ellcey
2004-12-09 19:41 ` Joe Buck
2004-12-09 19:52 ` Paul Jarc
2004-12-09 20:11 ` Gabriel Dos Reis
2004-12-09 20:14 ` Joe Buck
2004-12-09 20:20 ` Joseph S. Myers
2004-12-10 16:51 ` Steve Ellcey
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=BDDE7FAD.8302%schlie@comcast.net \
--to=schlie@comcast.net \
--cc=gcc@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).