From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7832 invoked by alias); 14 Jul 2005 06:52:21 -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 7818 invoked by uid 22791); 14 Jul 2005 06:52:17 -0000 Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.29.151) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 14 Jul 2005 06:52:17 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.12.10/8.12.10) with ESMTP id j6E6qF8j232668 for ; Thu, 14 Jul 2005 06:52:15 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j6E6qFW9153270 for ; Thu, 14 Jul 2005 08:52:15 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id j6E6qFqG002291 for ; Thu, 14 Jul 2005 08:52:15 +0200 Received: from d12ml102.megacenter.de.ibm.com (d12ml102.megacenter.de.ibm.com [9.149.166.138]) by d12av04.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j6E6qECE002287; Thu, 14 Jul 2005 08:52:14 +0200 In-Reply-To: <200507140759.54024.ebotcazou@libertysurf.fr> Subject: Re: isinf To: Eric Botcazou Cc: gcc@gcc.gnu.org, Hiroshi Fujishima , Joe Buck Message-ID: From: Michael Veksler Date: Thu, 14 Jul 2005 06:52:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00581.txt.bz2 Eric Botcazou wrote on 14/07/2005 08:59:53: > The compiler knows the answer of isinf (0) so it again optimizes away the > call. Try something like: > > int a; > > int > main (int argc, char *argv[]) > { > a = isinf ((double) argc); > return 0; > } 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. > > or additionally compile with -fno-builtin. That may help.