From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19194 invoked by alias); 5 Aug 2005 14:00:18 -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 19149 invoked by uid 22791); 5 Aug 2005 14:00:10 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 05 Aug 2005 14:00:10 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j75E04Gg006011; Fri, 5 Aug 2005 10:00:04 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j75E03V27783; Fri, 5 Aug 2005 10:00:03 -0400 Received: from topo.toronto.redhat.com (vpn50-31.rdu.redhat.com [172.16.50.31]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id j75E021M019937; Fri, 5 Aug 2005 10:00:03 -0400 Received: from topo.toronto.redhat.com (localhost.localdomain [127.0.0.1]) by topo.toronto.redhat.com (8.13.4/8.13.4) with ESMTP id j75Dxwui023678; Fri, 5 Aug 2005 09:59:58 -0400 Received: (from dnovillo@localhost) by topo.toronto.redhat.com (8.13.4/8.13.4/Submit) id j75Dxrvi023677; Fri, 5 Aug 2005 09:59:53 -0400 Date: Fri, 05 Aug 2005 14:00:00 -0000 From: Diego Novillo To: Roger Sayle Cc: gcc@gcc.gnu.org Subject: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE Message-ID: <20050805135953.GA23609@topo.toronto.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-SW-Source: 2005-08/txt/msg00169.txt.bz2 In PR 23046 we ICE inside tree-vrp.c because fold() does not realize that for enum enumtype { ENUM1, ENUM2 } x; the predicate 'if (x > 1)' is always false. This causes VRP to create the impossible range [2, 1] for that predicate. While it would be trivial for VRP to paper over this problem, the real fix should be in fold(). I looked at the logic that detects these cases and it is fairly convoluted (fold-const.c:9174). I'm wondering why doesn't fold() just use TYPE_MAX_VALUE/TYPE_MIN_VALUE if they're available? Thanks.