From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14546 invoked by alias); 15 Dec 2004 17:33: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 3180 invoked from network); 15 Dec 2004 17:21:38 -0000 Received: from unknown (HELO vaxjo.synopsys.com) (198.182.60.75) by sourceware.org with SMTP; 15 Dec 2004 17:21:38 -0000 Received: from crone.synopsys.com (crone.synopsys.com [146.225.7.23]) by vaxjo.synopsys.com (Postfix) with ESMTP id 076F5E0C0; Wed, 15 Dec 2004 09:21:37 -0800 (PST) Received: from piper.synopsys.com (localhost [127.0.0.1]) by crone.synopsys.com (8.9.1/8.9.1) with ESMTP id JAA21701; Wed, 15 Dec 2004 09:21:36 -0800 (PST) Received: (from jbuck@localhost) by piper.synopsys.com (8.11.6/8.11.6) id iBFHLYM25875; Wed, 15 Dec 2004 09:21:34 -0800 X-Authentication-Warning: piper.synopsys.com: jbuck set sender to Joe.Buck@synopsys.com using -f Date: Wed, 15 Dec 2004 17:33:00 -0000 From: Joe Buck To: Robert Dewar Cc: Dmitry Antipov , gcc@gcc.gnu.org Subject: Re: Dubious "'foo' might be used uninitialized in this function" message Message-ID: <20041215092134.A25280@synopsys.com> References: <41BF1207.2040102@dev.rtsoft.ru> <41BF1C0A.6060100@codesourcery.com> <41C009AA.4020700@dev.rtsoft.ru> <41C0289C.2000209@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <41C0289C.2000209@adacore.com>; from dewar@adacore.com on Wed, Dec 15, 2004 at 07:05:48AM -0500 X-SW-Source: 2004-12/txt/msg00591.txt.bz2 On Wed, Dec 15, 2004 at 07:05:48AM -0500, Robert Dewar wrote: > Dmitry Antipov wrote: > > >> it gets as complex as the halting problem :) > > Really ? Why ? > > Because the general evaluation of compile time contants > is clearly in this territory. Your example: > [ deleted ] > > requires the compiler to do symbolic evaluation of the > tests in lines 7 and 10 and determine that they always > have the same truth value. This case and many other common cases that gcc gives false reports on could be solved by using a gated SSA approach (which would, as you suggest, determine that the two tests have the same truth value). However, using such an approach goes against the desire by many people that the warnings they get at -O0 be the same as those for higher levels.