From patchwork Mon Oct 4 17:26:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix MIPS build after recent options changes From: "Joseph S. Myers" X-Patchwork-Id: 66712 Message-Id: To: gcc-patches@gcc.gnu.org Date: Mon, 4 Oct 2010 17:26:58 +0000 (UTC) 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),