From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31547 invoked by alias); 14 Jul 2005 07:33:23 -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 31423 invoked by uid 22791); 14 Jul 2005 07:33:12 -0000 Received: from monty-python.gnu.org (HELO monty-python.gnu.org) (199.232.76.173) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 14 Jul 2005 07:33:12 +0000 Received: from [213.36.80.91] (helo=mail.libertysurf.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dsxyn-00014x-P2 for gcc@gcc.gnu.org; Thu, 14 Jul 2005 03:17:57 -0400 Received: from dyn-83-153-240-217.ppp.tiscali.fr (83.153.240.217) by mail.libertysurf.net (7.1.026) id 42A318CE00740379; Thu, 14 Jul 2005 09:04:30 +0200 From: Eric Botcazou To: Michael Veksler Subject: Re: isinf Date: Thu, 14 Jul 2005 07:33:00 -0000 User-Agent: KMail/1.7.1 Cc: gcc@gcc.gnu.org, Hiroshi Fujishima , Joe Buck References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200507140905.51209.ebotcazou@libertysurf.fr> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-SW-Source: 2005-07/txt/msg00583.txt.bz2 > This may work today, but and still break in the future. This > will not work (possibly) years from now when gcc will start > doing VRP on math functions like isinf. > > MIN_INT <= argc <= MAX_INT falls well into representable > values of double (assuming 32 bit int or less). This means > that the compiler may deduce that isinf((double)argc) always > returns false, without ever calling the function. You're too clever. :-) union U { int i; double d; }; volatile int a; int main (int argc, char *argv[]) { union U u; u.i = argc; a = isinf (u.d); return 0; } -- Eric Botcazou