From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9165 invoked by alias); 23 May 2011 15:48:02 -0000 Received: (qmail 9158 invoked by uid 22791); 23 May 2011 15:48:01 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 15:47:46 +0000 Received: by wwf26 with SMTP id 26so5773405wwf.8 for ; Mon, 23 May 2011 08:47:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.54.6 with SMTP id o6mr2377017wbg.61.1306165665214; Mon, 23 May 2011 08:47:45 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Mon, 23 May 2011 08:47:44 -0700 (PDT) In-Reply-To: <4DDA7F67.2030003@redhat.com> References: <4DDA743A.7000604@redhat.com> <4DDA7F67.2030003@redhat.com> Date: Mon, 23 May 2011 16:25:00 -0000 Message-ID: Subject: Re: RFA PATCH to get_narrower for c++/48106 (ICE with scoped enum) From: Richard Guenther To: Jason Merrill Cc: gcc-patches List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg01655.txt.bz2 On Mon, May 23, 2011 at 5:38 PM, Jason Merrill wrote: > On 05/23/2011 11:01 AM, Richard Guenther wrote: >> >> Ok. =A0Though 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. =A0There is no common= type > between a scoped enum and char, so common_type returns NULL_TREE, so we g= et > a SEGV in c_common_signed_or_unsigned_type. > > Do you think I should change shorten_binary_op instead? Yeah, that might constrain it to C family languages. shorten_binary_op is one of our premature optimization things anyway, best to slowly go away ... Richard. > Jason >