From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18411 invoked by alias); 9 Dec 2004 23:53:57 -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 18382 invoked from network); 9 Dec 2004 23:53:50 -0000 Received: from unknown (HELO kiruna.synopsys.com) (198.182.44.80) by sourceware.org with SMTP; 9 Dec 2004 23:53:50 -0000 Received: from mother.synopsys.com (mother.synopsys.com [146.225.100.171]) by kiruna.synopsys.com (Postfix) with ESMTP id F2F38FBE6; Thu, 9 Dec 2004 15:53:29 -0800 (PST) Received: from piper.synopsys.com (localhost [127.0.0.1]) by mother.synopsys.com (8.9.1/8.9.1) with ESMTP id PAA23819; Thu, 9 Dec 2004 15:53:50 -0800 (PST) Received: (from jbuck@localhost) by piper.synopsys.com (8.11.6/8.11.6) id iB9Nrdo28051; Thu, 9 Dec 2004 15:53:39 -0800 X-Authentication-Warning: piper.synopsys.com: jbuck set sender to Joe.Buck@synopsys.com using -f Date: Thu, 09 Dec 2004 23:53:00 -0000 From: Joe Buck To: Paul Schlie Cc: gcc@gcc.gnu.org Subject: Re: memcpy / Language Lawyer / optimization question Message-ID: <20041209155339.B26193@synopsys.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from schlie@comcast.net on Thu, Dec 09, 2004 at 05:54:08PM -0500 X-SW-Source: 2004-12/txt/msg00347.txt.bz2 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.