From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3023 invoked by alias); 23 May 2011 15:38:34 -0000 Received: (qmail 2952 invoked by uid 22791); 23 May 2011 15:38:33 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Mon, 23 May 2011 15:38:17 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4NFcG3T028942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 May 2011 11:38:17 -0400 Received: from [127.0.0.1] ([10.3.113.3]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4NFcGdk023043; Mon, 23 May 2011 11:38:16 -0400 Message-ID: <4DDA7F67.2030003@redhat.com> Date: Mon, 23 May 2011 16:17:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Richard Guenther CC: gcc-patches List Subject: Re: RFA PATCH to get_narrower for c++/48106 (ICE with scoped enum) References: <4DDA743A.7000604@redhat.com> In-Reply-To: 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: 2011-05/txt/msg01653.txt.bz2 On 05/23/2011 11:01 AM, Richard Guenther wrote: > Ok. Though I wonder where you enter folding before you check semantic > validity. The problem is in c-common:shorten_binary_op, which uses get_narrower and then calls common_type on the types of the results. There is no common type between a scoped enum and char, so common_type returns NULL_TREE, so we get a SEGV in c_common_signed_or_unsigned_type. Do you think I should change shorten_binary_op instead? Jason