From patchwork Mon Oct 4 17:26:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 66712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 08181B70D4 for ; Tue, 5 Oct 2010 04:27:14 +1100 (EST) Received: (qmail 22938 invoked by alias); 4 Oct 2010 17:27:10 -0000 Received: (qmail 22927 invoked by uid 22791); 4 Oct 2010 17:27:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Oct 2010 17:27:01 +0000 Received: (qmail 6944 invoked from network); 4 Oct 2010 17:26:59 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Oct 2010 17:26:59 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.69) (envelope-from ) id 1P2ooU-0003pQ-CX for gcc-patches@gcc.gnu.org; Mon, 04 Oct 2010 17:26:58 +0000 Date: Mon, 4 Oct 2010 17:26:58 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org Subject: Fix MIPS build after recent options changes Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I found my most recent options patch had broken the build for MIPS because it removed the target_flags_explicit declaration for the GENERATOR_FILE case, and target_flags_explicit is used in macros such as GENERATE_LL_SC which are used in insn conditions which are used in generator files. I had thought that this declaration was unneeded for generator files because it was already the case before my patch that they did not get a *definition* of this variable. However, insn conditions get used if only inside __builtin_constant_p, so it is necessary to have a declaration even without a definition. This use of target_flags_explicit in insn conditions is inappropriate by my model of option_handling; elements of global_options_set (or in future such a structure passed around as a pointer) should be used only in initial option processing to indicate what was explicitly passed, as part of determining default values, and not subsequently in code generation which should be based on variables or flags determined at initialization (possibly using target_flags_explicit as part of that initial determination). Thus it will need fixing in due course. However, this patch does the minimal change to get MIPS building again: declaring target_flags_explicit in mips.h if GENERATOR_FILE. Tested building cc1 for cross to mips-elf. OK to commit? 2010-10-04 Joseph Myers * config/mips/mips.h (target_flags_explicit): Declare for GENERATOR_FILE. Index: gcc/config/mips/mips.h =================================================================== --- gcc/config/mips/mips.h (revision 164932) +++ gcc/config/mips/mips.h (working copy) @@ -26,6 +26,12 @@ #include "config/vxworks-dummy.h" +#ifdef GENERATOR_FILE +/* This is used in some insn conditions, so needs to be declared, but + does not need to be defined. */ +extern int target_flags_explicit; +#endif + /* MIPS external variables defined in mips.c. */ /* Which ABI to use. ABI_32 (original 32, or o32), ABI_N32 (n32),