From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128870 invoked by alias); 16 Jun 2015 11:03:48 -0000 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 Received: (qmail 128861 invoked by uid 89); 16 Jun 2015 11:03:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ob0-f178.google.com Received: from mail-ob0-f178.google.com (HELO mail-ob0-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 16 Jun 2015 11:03:46 +0000 Received: by obctg8 with SMTP id tg8so8761532obc.3 for ; Tue, 16 Jun 2015 04:03:44 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.135.202 with SMTP id pu10mr28136601obb.52.1434452623950; Tue, 16 Jun 2015 04:03:43 -0700 (PDT) Received: by 10.76.115.167 with HTTP; Tue, 16 Jun 2015 04:03:43 -0700 (PDT) In-Reply-To: <20150612080038.GE2756@redhat.com> References: <20150611214743.GA59435@kam.mff.cuni.cz> <20150612080038.GE2756@redhat.com> Date: Tue, 16 Jun 2015 11:14:00 -0000 Message-ID: Subject: Re: Fix verify_type ICE with -fshort-enum From: Richard Biener To: Marek Polacek Cc: Jan Hubicka , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg01108.txt.bz2 On Fri, Jun 12, 2015 at 10:00 AM, Marek Polacek wrote: > On Thu, Jun 11, 2015 at 11:47:43PM +0200, Jan Hubicka wrote: >> Hi, >> gcc.c-torture/execute/930408-1.c currently ICE on -fshort-enum target(s) because >> TYPE_PACKED is not consistently set among type variants. > > I guess that's because of the forward declaration in the test. But I have > no access to an ARM machine, so can't verify. > >> Bootstrapped/regtested ppc64le-linux, OK? >> Honza >> >> PR middle-end/66325 >> * c-decl.c (start_enum): Set TYPE_PACKED consistently among type variants. >> Index: c-decl.c >> =================================================================== >> --- c-decl.c (revision 224250) >> +++ c-decl.c (working copy) >> @@ -7946,7 +7946,8 @@ >> the_enum->enum_overflow = 0; >> >> if (flag_short_enums) >> - TYPE_PACKED (enumtype) = 1; >> + for (tree v = TYPE_MAIN_VARIANT (enumtype); v ;v = TYPE_NEXT_VARIANT (v)) Though I wonder why flag_short_enums was not true when building the (main-)variant? Looks like -fshort-enums is also 'Optimization', so the above is bogus for enum foo {x = 1 }; void __attribute__((optimize(short-enums))) foo() { const enum foo x = 1; } no? The main variant is correctly _not_ packed but now you make it packed as you reach foo ()? Richard. > Please fix the formatting here: no space before ;. > > Ok with that change. > > Marek