From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25369 invoked by alias); 14 Oct 2007 10:04:17 -0000 Received: (qmail 25360 invoked by uid 22791); 14 Oct 2007 10:04:17 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 14 Oct 2007 10:04:11 +0000 Received: (qmail 18677 invoked from network); 14 Oct 2007 10:04:09 -0000 Received: from unknown (HELO maxim-kuvyrkovs-computer.local) (maxim@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 Oct 2007 10:04:09 -0000 Message-ID: <4711E98F.3080906@codesourcery.com> Date: Sun, 14 Oct 2007 10:08:00 -0000 From: Maxim Kuvyrkov User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: gcc-patches CC: Roman Zippel Subject: [PATCH][1/3] Unbreak m68k bootstrap References: <4711E7FF.7010002@codesourcery.com> In-Reply-To: <4711E7FF.7010002@codesourcery.com> Content-Type: multipart/mixed; boundary="------------060808020002090003080506" 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: 2007-10/txt/msg00817.txt.bz2 This is a multi-part message in MIME format. --------------060808020002090003080506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1044 Hi, This patch provides means to fix bootstrap failure on m68k. Bootstrap fails due to warnings 'ansi C forbids forward declaration of enum types' on enum attr_* used in m68k.h. In other words, this says that enums generated for instruction attributes can't be used in .h files. Though there are no design reasons for this resctriction, all ports workaround it by declaring mirroring enum with the same values: E.g. (define_attr "cpu" "p1,p2,unknown" (const (symbol_ref "tune_cpu"))) expands into enum attr_cpu { CPU_P1, CPU_P2, CPU_UNKNOWN }; then in .h: enum processor { PROCESSOR_P1, PROCESSOR_P2, PROCESSOR_MAX }; And now CPU_Pn and PROCESSOR_Pn are interchangeable. When using the above scheme there is a risk of going out of sync. This patch rearranges headers of insn-attrtab.c to fix the issue. With this patch applied it is ok to use autogenerated enums in -protos.h . The patch was bootstrapped on {x86_64, m68k, ia64, ppc64}-unknown-linux-gnu. OK for trunk? :ADDPATCH middle-end: Thanks, Maxim --------------060808020002090003080506 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="m68k-v1.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="m68k-v1.ChangeLog" Content-length: 122 2007-10-12 Maxim Kuvyrkov * genattrtab.c (main): Rearrange output of insn-attrtab.c headers. --------------060808020002090003080506 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="m68k-v1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="m68k-v1.patch" Content-length: 767 Index: genattrtab.c =================================================================== --- genattrtab.c (revision 184625) +++ genattrtab.c (working copy) @@ -4530,13 +4530,13 @@ from the machine description file `md'. printf ("#include \"coretypes.h\"\n"); printf ("#include \"tm.h\"\n"); printf ("#include \"rtl.h\"\n"); + printf ("#include \"insn-attr.h\"\n"); printf ("#include \"tm_p.h\"\n"); printf ("#include \"insn-config.h\"\n"); printf ("#include \"recog.h\"\n"); printf ("#include \"regs.h\"\n"); printf ("#include \"real.h\"\n"); printf ("#include \"output.h\"\n"); - printf ("#include \"insn-attr.h\"\n"); printf ("#include \"toplev.h\"\n"); printf ("#include \"flags.h\"\n"); printf ("#include \"function.h\"\n"); --------------060808020002090003080506--