From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11363 invoked by alias); 6 Dec 2012 14:07:53 -0000 Received: (qmail 11355 invoked by uid 22791); 6 Dec 2012 14:07:52 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Dec 2012 14:07:44 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB6E7iYS012284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Dec 2012 09:07:44 -0500 Received: from [10.3.113.167] (ovpn-113-167.phx2.redhat.com [10.3.113.167]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qB6E7h6v014953; Thu, 6 Dec 2012 09:07:43 -0500 Message-ID: <50C0A6AF.9090007@redhat.com> Date: Thu, 06 Dec 2012 14:07:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jakub Jelinek CC: gcc-patches@gcc.gnu.org Subject: Re: [C++ PATCH] Fix build_noexcept_spec ICE (PR c++/54207) References: <20121206072442.GG2315@tucnak.redhat.com> In-Reply-To: <20121206072442.GG2315@tucnak.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00393.txt.bz2 On 12/06/2012 02:24 AM, Jakub Jelinek wrote: > + if (TREE_CODE (expr) == INTEGER_CST) > + { > + if (operand_equal_p (expr, boolean_true_node, 0)) > + return noexcept_true_spec; > + else if (operand_equal_p (expr, boolean_false_node, 0)) > + return noexcept_false_spec; > + } These are the only two possibilities for a boolean INTEGER_CST, so let's assert that it's false if it isn't true. You can then leave the 'else' on the "if (expr == error_mark_node)". > + if (TREE_CODE (expr) == INTEGER_CST) > + { > + if (operand_equal_p (expr, boolean_true_node, 0) > + || operand_equal_p (expr, boolean_false_node, 0)) > + new_specs = expr; > + } And here you don't need to check the value at all unless in an assert. Jason