From owner-freebsd-questions@FreeBSD.ORG Mon Jul 14 18:39:32 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F05E37B401 for ; Mon, 14 Jul 2003 18:39:32 -0700 (PDT) Received: from lifesupport.shutdown.com (dsl092-048-059.sfo2.dsl.speakeasy.net [66.92.48.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8F7943F85 for ; Mon, 14 Jul 2003 18:39:31 -0700 (PDT) (envelope-from llewelly@lifesupport.shutdown.com) Received: (from llewelly@localhost) by lifesupport.shutdown.com (8.11.2/8.11.2) id h6F1ZBV29806; Mon, 14 Jul 2003 18:35:12 -0700 (PDT) To: Chuck Swiger References: <3F1322A9.8080805@mac.com> From: LLeweLLyn Reese Date: 14 Jul 2003 18:35:10 -0700 In-Reply-To: <3F1322A9.8080805@mac.com> Message-ID: Lines: 31 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: freebsd Questions Subject: Re: buggy optimization levels... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 01:39:32 -0000 Chuck Swiger writes: > Hi, all-- > > The "known bugs" section of the GCC info documentation lists 5 issues; > "man gcc" lists none. Can someone provide a test case for a bug > involving "cc -O" versus "cc -O3" under FreeBSD 4-STABLE for the x86 > architecture? You could probably find a few by searching the bug data base at: http://gcc.gnu.org/bugzilla/ > > What is the preferred solution? The Dragon book and other compiler > references have a definition of safe versus unsafe "optimizations"; is > the problem that -O3 enables something unsafe? I believe that none of -O[0-3s] are intended to enable unsafe optimizations. (There are some optimization flags, which are *not* enabled by any -O opt, like -ffast-math, which are documented to be unsafe in some fashion or another; see http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Optimize-Options.html#Optimize%20Options) > Who is responsible > (FreeBSD, GNU compiler team, others?) for changing the compiler > defaults so that -Ox will not produce known-invalid results, for any x? [snip] If gcc produces invalid results or bad code at any optimization level, I think you should report it as a bug according to the instructions at http://gcc.gnu.org/bugs.html