From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58505 invoked by alias); 29 Nov 2015 18:58:47 -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 58495 invoked by uid 89); 29 Nov 2015 18:58:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 29 Nov 2015 18:58:46 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id E6584542B2F; Sun, 29 Nov 2015 19:58:41 +0100 (CET) Date: Sun, 29 Nov 2015 19:02:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de, joseph@codesourcery.com Subject: Fix TYPE_PACKED verify_type ICE Message-ID: <20151129185841.GD28051@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-11/txt/msg03429.txt.bz2 Hi, this patch fixes verifier ICE where we have !TYPE_PACKED variant of TYPE_PACKED type. The fix is symmetric to earlier fix for enums. Bootstrapped/regtested x86_64-linux, OK? Honza PR c/67106 * gcc.c-torture/compile/pr67106.c: New testcase. * c-decl.c: Set TYPE_PACKED in variants. Index: testsuite/gcc.c-torture/compile/pr67106.c =================================================================== --- testsuite/gcc.c-torture/compile/pr67106.c (revision 0) +++ testsuite/gcc.c-torture/compile/pr67106.c (revision 0) @@ -0,0 +1,12 @@ +/* { dg-options "-g -fpack-struct" } */ +typedef struct S S; + +struct S +{ + struct + { + S *s; + }; + int a; +}; + Index: c/c-decl.c =================================================================== --- c/c-decl.c (revision 231020) +++ c/c-decl.c (working copy) @@ -7213,7 +7213,8 @@ start_struct (location_t loc, enum tree_ } C_TYPE_BEING_DEFINED (ref) = 1; - TYPE_PACKED (ref) = flag_pack_struct; + for (tree v = TYPE_MAIN_VARIANT (ref); v; v = TYPE_NEXT_VARIANT (v)) + TYPE_PACKED (v) = flag_pack_struct; *enclosing_struct_parse_info = struct_parse_info; struct_parse_info = XNEW (struct c_struct_parse_info);