From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25047 invoked by alias); 10 Dec 2004 03:18:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25035 invoked from network); 10 Dec 2004 03:18:26 -0000 Received: from unknown (HELO rwcrmhc13.comcast.net) (204.127.198.39) by sourceware.org with SMTP; 10 Dec 2004 03:18:26 -0000 Received: from [10.0.1.2] (h000393256f12.ne.client2.attbi.com[24.61.199.96]) by comcast.net (rwcrmhc13) with SMTP id <2004121003182501500t5h88e>; Fri, 10 Dec 2004 03:18:26 +0000 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Fri, 10 Dec 2004 03:18:00 -0000 Subject: Re: memcpy / Language Lawyer / optimization question From: Paul Schlie To: Message-ID: In-Reply-To: <20041209155339.B26193@synopsys.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2004-12/txt/msg00351.txt.bz2 > From: Joe Buck > 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 > 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-