From patchwork Wed Nov 17 15:31:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 71575 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 C3839B718C for ; Thu, 18 Nov 2010 02:32:41 +1100 (EST) Received: (qmail 26911 invoked by alias); 17 Nov 2010 15:32:33 -0000 Received: (qmail 26722 invoked by uid 22791); 17 Nov 2010 15:31:59 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL, BAYES_50, KAM_STOCKGEN, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from c60.cesmail.net (HELO c60.cesmail.net) (216.154.195.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Nov 2010 15:31:36 +0000 Received: from unknown (HELO delta2) ([192.168.1.50]) by c60.cesmail.net with ESMTP; 17 Nov 2010 10:31:32 -0500 Received: from 89.241.159.95 ([89.241.159.95]) by webmail.spamcop.net (Horde MIME library) with HTTP; Wed, 17 Nov 2010 10:31:32 -0500 Message-ID: <20101117103132.jm3ze7f4j4o8ws4c-nzlynne@webmail.spamcop.net> Date: Wed, 17 Nov 2010 10:31:32 -0500 From: Joern Rennecke To: gcc-patches@gcc.gnu.org Subject: RFA: Fix middle-end/46500 (targetm splitting approach) MIME-Version: 1.0 User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) 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 This patch is an alternative to the one posted at: http://gcc.gnu.org/ml/gcc-patches/2010-11/msg01769.html The approach here is to move all the hooks that take a CUMULATIVE_ARGS * argument out of targetm, into a new vector target_internalm . The latter vector is only visible to files that include the new header file target-internal.h . The hooks themselves stay the same, but since their interface is only seen by files that need tm.h anyway, we get rid of this tm.h leak (there are others remaining, at least function.h and gimple.h, but that can be handled separately once the CUMULATIVE_ARGS hooks have been taken care of). Bootstrapped on i686-pc-linux-gnu. Cross-built with --enable-werror-always for: alpha-linux-gnu hppa-linux-gnu mips-elf sh-elf arc-elf ia64-elf mmix-knuth-mmixware sparc-elf arm-eabi iq2000-elf mn10300-elf spu-elf avr-elf lm32-elf moxie-elf v850-elf bfin-elf m32c-elf pdp11-aout vax-linux-gnu cris-elf m32r-elf picochip-elf xstormy16-elf ppc-elf xtensa-elf fr30-elf m68k-elf rx-elf frv-elf mcore-elf s390-linux-gnu h8300-elf mep-elf score-elf crx-elf and m68hc11-elf required manual intervention to get past issues with pre-existing warnings. 2010-11-17 Joern Rennecke PR middle-end/46500 gcc: * targhooks.c: Include target-internal.h. * expr.c, dse.c, function.c, calls.c: Likewise. * targhooks.c: (default_pretend_outgoing_varargs_named): Use target_internalm. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * config/alpha/alpha.c (alpha_setup_incoming_varargs): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. * dse.c (get_call_args): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (assign_parm_find_data_types, assign_parms_setup_varargs): Likewise. (assign_parm_find_entry_rtl, assign_parms): Likewise. (gimplify_parameters): Likewise. * calls.c (prepare_call_address): Likewise. (initialize_argument_information, expand_call): Likewise. (emit_library_call_value_1): Likewise. * target.def (pass_by_reference): Move from target-internal.def . (setup_incoming_varargs, strict_argument_naming): Likewise. (pretend_outgoing_varargs_named, callee_copies): Likewise. (arg_partial_bytes, function_arg_advance, function_arg): Likewise. (function_incoming_arg): Likewise. * target.h: Don't include "tm.h" . * genhooks.c: Include "target-internal.def" . * config/alpha/alpha.c: Include "target-internal.h" . Define target_internalm. * config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c: Likewise. * config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c: Likewise. * config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c: Likewise. * config/sh/sh.c, config/pdp11/pdp11.c: Likewise. * config/microblaze/microblaze.c, config/avr/avr.c: Likewise. * config/crx/crx.c, config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c, config/fr30/fr30.c: Likewise. * config/lm32/lm32.c, config/moxie/moxie.c: Likewise. * config/m68hc11/m68hc11.c, config/cris/cris.c: Likewise. * config/iq2000/iq2000.c, config/mn10300/mn10300.c: Likewise. * config/ia64/ia64.c, config/m68k/m68k.c: Likewise. * config/rs6000/rs6000.c, config/picochip/picochip.c: Likewise. * config/arc/arc.c, config/mcore/mcore.c: Likewise. * config/score/score.c, config/arm/arm.c, config/pa/pa.c: Likewise. * config/pa/pa.c, config/mips/mips.c, config/vax/vax.c: Likewise. * config/h8300/h8300.c, config/v850/v850.c: Likewise. * config/mmix/mmix.c, config/bfin/bfin.c: Likewise. * target-internal.def, target-internal.h: New files. * Makefile.in (TARGET_H): Remove $(TM_H). (TARGET_INTERNAL_H): New make variable. (targhooks.o) Use $(TARGET_INTERNAL_H) instead of $(TARGET_H). (function.o, expr.o, calls.o, dse.o): Likewise. (s-tm-texi): Also check tm.texi against target-internal.def to decide what diagnostic to issue for a tm.texi mismatch. (build/genhooks.o): Depend on target-internal.def. gcc/c-family: * c-opts.c: Include "tm.h" . gcc/java: * expr.c: Include "tm.h" . gcc/fortran: * trans-types.c: Include "tm.h" . Index: targhooks.c =================================================================== --- targhooks.c (revision 166860) +++ targhooks.c (working copy) @@ -60,6 +60,7 @@ Software Foundation; either version 3, o #include "toplev.h" #include "function.h" #include "target.h" +#include "target-internal.h" #include "tm_p.h" #include "target-def.h" #include "ggc.h" @@ -194,7 +195,7 @@ hook_bool_CUMULATIVE_ARGS_false (CUMULAT bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) { - return (targetm.calls.setup_incoming_varargs + return (target_internalm.setup_incoming_varargs != default_setup_incoming_varargs); } Index: c-family/c-opts.c =================================================================== --- c-family/c-opts.c (revision 166860) +++ c-family/c-opts.c (working copy) @@ -23,6 +23,7 @@ Software Foundation; either version 3, o #include "system.h" #include "coretypes.h" #include "tree.h" +#include "tm.h" #include "c-common.h" #include "c-pragma.h" #include "flags.h" Index: java/expr.c =================================================================== --- java/expr.c (revision 166860) +++ java/expr.c (working copy) @@ -28,6 +28,7 @@ the Free Software Foundation; either ver #include "system.h" #include "coretypes.h" #include "tree.h" +#include "tm.h" #include "flags.h" #include "java-tree.h" #include "javaop.h" Index: target.def =================================================================== --- target.def (revision 166860) +++ target.def (working copy) @@ -1883,45 +1883,12 @@ HOOK_VECTOR (TARGET_CALLS, calls) bool, (const_tree type), hook_bool_const_tree_false) -/* Return true if a parameter must be passed by reference. TYPE may - be null if this is a libcall. CA may be null if this query is - from __builtin_va_arg. */ -DEFHOOK -(pass_by_reference, - "", - bool, - (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named), - hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) - DEFHOOK (expand_builtin_saveregs, "", rtx, (void), default_expand_builtin_saveregs) -/* Returns pretend_argument_size. */ -DEFHOOK -(setup_incoming_varargs, - "", - void, (CUMULATIVE_ARGS *args_so_far, enum machine_mode mode, tree type, - int *pretend_args_size, int second_time), - default_setup_incoming_varargs) - -DEFHOOK -(strict_argument_naming, - "", - bool, (CUMULATIVE_ARGS *ca), - hook_bool_CUMULATIVE_ARGS_false) - -/* Returns true if we should use - targetm.calls.setup_incoming_varargs() and/or - targetm.calls.strict_argument_naming(). */ -DEFHOOK -(pretend_outgoing_varargs_named, - "", - bool, (CUMULATIVE_ARGS *ca), - default_pretend_outgoing_varargs_named) - /* Given a complex type T, return true if a parameter of type T should be passed as two scalars. */ DEFHOOK @@ -1939,58 +1906,6 @@ HOOK_VECTOR (TARGET_CALLS, calls) bool, (enum machine_mode mode, const_tree type), must_pass_in_stack_var_size_or_pad) -/* Return true if type TYPE, mode MODE, which is passed by reference, - should have the object copy generated by the callee rather than - the caller. It is never called for TYPE requiring constructors. */ -DEFHOOK -(callee_copies, - "", - bool, - (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named), - hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) - -/* Return zero for arguments passed entirely on the stack or entirely - in registers. If passed in both, return the number of bytes passed - in registers; the balance is therefore passed on the stack. */ -DEFHOOK -(arg_partial_bytes, - "", - int, (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, bool named), - hook_int_CUMULATIVE_ARGS_mode_tree_bool_0) - -/* Update the state in CA to advance past an argument in the - argument list. The values MODE, TYPE, and NAMED describe that - argument. */ -/* ??? tm.texi still only describes the old macro. */ -DEFHOOK_UNDOC -(function_arg_advance, - "", - void, - (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, bool named), - default_function_arg_advance) - -/* Return zero if the argument described by the state of CA should - be placed on a stack, or a hard register in which to store the - argument. The values MODE, TYPE, and NAMED describe that - argument. */ -/* ??? tm.texi still only describes the old macro. */ -DEFHOOK_UNDOC -(function_arg, - "", - rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, - bool named), - default_function_arg) - -/* Likewise, but for machines with register windows. Return the - location where the argument will appear to the callee. */ -/* ??? tm.texi still only describes the old macro. */ -DEFHOOK_UNDOC -(function_incoming_arg, - "", - rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, - bool named), - default_function_incoming_arg) - DEFHOOK (function_arg_boundary, "", Index: target.h =================================================================== --- target.h (revision 166860) +++ target.h (working copy) @@ -49,7 +49,6 @@ #ifndef GCC_TARGET_H #define GCC_TARGET_H -#include "tm.h" #include "insn-modes.h" /* Types used by the record_gcc_switches() target function. */ Index: expr.c =================================================================== --- expr.c (revision 166860) +++ expr.c (working copy) @@ -49,6 +49,7 @@ Software Foundation; either version 3, o #include "tree-pass.h" #include "tree-flow.h" #include "target.h" +#include "target-internal.h" #include "timevar.h" #include "df.h" #include "diagnostic.h" @@ -1238,14 +1239,14 @@ block_move_libcall_safe_for_call_parm (v for ( ; arg != void_list_node ; arg = TREE_CHAIN (arg)) { enum machine_mode mode = TYPE_MODE (TREE_VALUE (arg)); - rtx tmp = targetm.calls.function_arg (&args_so_far, mode, - NULL_TREE, true); + rtx tmp = target_internalm.function_arg (&args_so_far, mode, + NULL_TREE, true); if (!tmp || !REG_P (tmp)) return false; - if (targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL, 1)) + if (target_internalm.arg_partial_bytes (&args_so_far, mode, NULL, 1)) return false; - targetm.calls.function_arg_advance (&args_so_far, mode, - NULL_TREE, true); + target_internalm.function_arg_advance (&args_so_far, mode, + NULL_TREE, true); } } return true; Index: dse.c =================================================================== --- dse.c (revision 166860) +++ dse.c (working copy) @@ -47,6 +47,7 @@ Software Foundation; either version 3, o #include "optabs.h" #include "dbgcnt.h" #include "target.h" +#include "target-internal.h" /* This file contains three techniques for performing Dead Store Elimination (dse). @@ -2322,7 +2323,7 @@ get_call_args (rtx call_insn, tree fn, r { enum machine_mode mode = TYPE_MODE (TREE_VALUE (arg)); rtx reg, link, tmp; - reg = targetm.calls.function_arg (&args_so_far, mode, NULL_TREE, true); + reg = target_internalm.function_arg (&args_so_far, mode, NULL_TREE, true); if (!reg || !REG_P (reg) || GET_MODE (reg) != mode || GET_MODE_CLASS (mode) != MODE_INT) return false; @@ -2356,7 +2357,8 @@ get_call_args (rtx call_insn, tree fn, r if (tmp) args[idx] = tmp; - targetm.calls.function_arg_advance (&args_so_far, mode, NULL_TREE, true); + target_internalm.function_arg_advance (&args_so_far, mode, NULL_TREE, + true); } if (arg != void_list_node || idx != nargs) return false; Index: fortran/trans-types.c =================================================================== --- fortran/trans-types.c (revision 166860) +++ fortran/trans-types.c (working copy) @@ -27,6 +27,7 @@ Software Foundation; either version 3, o #include "system.h" #include "coretypes.h" #include "tree.h" +#include "tm.h" #include "langhooks.h" /* For iso-c-bindings.def. */ #include "target.h" #include "ggc.h" Index: function.c =================================================================== --- function.c (revision 166860) +++ function.c (working copy) @@ -57,6 +57,7 @@ Software Foundation; either version 3, o #include "integrate.h" #include "langhooks.h" #include "target.h" +#include "target-internal.h" #include "cfglayout.h" #include "gimple.h" #include "tree-pass.h" @@ -2106,7 +2107,7 @@ pass_by_reference (CUMULATIVE_ARGS *ca, } } - return targetm.calls.pass_by_reference (ca, mode, type, named_arg); + return target_internalm.pass_by_reference (ca, mode, type, named_arg); } /* Return true if TYPE, which is passed by reference, should be callee @@ -2118,7 +2119,7 @@ reference_callee_copied (CUMULATIVE_ARGS { if (type && TREE_ADDRESSABLE (type)) return false; - return targetm.calls.callee_copies (ca, mode, type, named_arg); + return target_internalm.callee_copies (ca, mode, type, named_arg); } /* Structures to communicate between the subroutines of assign_parms. @@ -2291,7 +2292,7 @@ assign_parm_find_data_types (struct assi data->named_arg = 1; /* No variadic parms. */ else if (DECL_CHAIN (parm)) data->named_arg = 1; /* Not the last non-variadic parm. */ - else if (targetm.calls.strict_argument_naming (&all->args_so_far)) + else if (target_internalm.strict_argument_naming (&all->args_so_far)) data->named_arg = 1; /* Only variadic ones are unnamed. */ else data->named_arg = 0; /* Treat as variadic. */ @@ -2356,7 +2357,7 @@ assign_parms_setup_varargs (struct assig { int varargs_pretend_bytes = 0; - targetm.calls.setup_incoming_varargs (&all->args_so_far, + target_internalm.setup_incoming_varargs (&all->args_so_far, data->promoted_mode, data->passed_type, &varargs_pretend_bytes, no_rtl); @@ -2385,10 +2386,11 @@ assign_parm_find_entry_rtl (struct assig return; } - entry_parm = targetm.calls.function_incoming_arg (&all->args_so_far, - data->promoted_mode, - data->passed_type, - data->named_arg); + entry_parm + = target_internalm.function_incoming_arg (&all->args_so_far, + data->promoted_mode, + data->passed_type, + data->named_arg); if (entry_parm == 0) data->promoted_mode = data->passed_mode; @@ -2409,12 +2411,12 @@ assign_parm_find_entry_rtl (struct assig #endif if (!in_regs && !data->named_arg) { - if (targetm.calls.pretend_outgoing_varargs_named (&all->args_so_far)) + if (target_internalm.pretend_outgoing_varargs_named (&all->args_so_far)) { - rtx tem; - tem = targetm.calls.function_incoming_arg (&all->args_so_far, - data->promoted_mode, - data->passed_type, true); + rtx tem + = target_internalm.function_incoming_arg (&all->args_so_far, + data->promoted_mode, + data->passed_type, true); in_regs = tem != NULL; } } @@ -2429,10 +2431,10 @@ assign_parm_find_entry_rtl (struct assig { int partial; - partial = targetm.calls.arg_partial_bytes (&all->args_so_far, - data->promoted_mode, - data->passed_type, - data->named_arg); + partial = target_internalm.arg_partial_bytes (&all->args_so_far, + data->promoted_mode, + data->passed_type, + data->named_arg); data->partial = partial; /* The caller might already have allocated stack space for the @@ -3363,8 +3365,9 @@ assign_parms (tree fndecl) set_decl_incoming_rtl (parm, data.entry_parm, data.passed_pointer); /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode, - data.passed_type, data.named_arg); + target_internalm.function_arg_advance (&all.args_so_far, + data.promoted_mode, + data.passed_type, data.named_arg); assign_parm_adjust_stack_rtl (&data); @@ -3553,8 +3556,9 @@ gimplify_parameters (void) continue; /* Update info on where next arg arrives in registers. */ - targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode, - data.passed_type, data.named_arg); + target_internalm.function_arg_advance (&all.args_so_far, + data.promoted_mode, + data.passed_type, data.named_arg); /* ??? Once upon a time variable_size stuffed parameter list SAVE_EXPRs (amongst others) onto a pending sizes list. This Index: calls.c =================================================================== --- calls.c (revision 166860) +++ calls.c (working copy) @@ -39,6 +39,7 @@ Software Foundation; either version 3, o #include "sbitmap.h" #include "langhooks.h" #include "target.h" +#include "target-internal.h" #include "debug.h" #include "cgraph.h" #include "except.h" @@ -228,7 +229,8 @@ prepare_call_address (tree fndecl, rtx f It is zero if this call doesn't want a structure value. NEXT_ARG_REG is the rtx that results from executing - targetm.calls.function_arg (&args_so_far, VOIDmode, void_type_node, true) + target_internalm.function_arg (&args_so_far, VOIDmode, void_type_node, + true) just after all the args have had their registers assigned. This could be whatever you like, but normally it is the first arg-register beyond those used for args in this call, @@ -1138,23 +1140,24 @@ initialize_argument_information (int num args[i].unsignedp = unsignedp; args[i].mode = mode; - args[i].reg = targetm.calls.function_arg (args_so_far, mode, type, - argpos < n_named_args); + args[i].reg = target_internalm.function_arg (args_so_far, mode, type, + argpos < n_named_args); /* If this is a sibling call and the machine has register windows, the register window has to be unwinded before calling the routine, so arguments have to go into the incoming registers. */ - if (targetm.calls.function_incoming_arg != targetm.calls.function_arg) + if (target_internalm.function_incoming_arg + != target_internalm.function_arg) args[i].tail_call_reg - = targetm.calls.function_incoming_arg (args_so_far, mode, type, - argpos < n_named_args); + = target_internalm.function_incoming_arg (args_so_far, mode, type, + argpos < n_named_args); else args[i].tail_call_reg = args[i].reg; if (args[i].reg) args[i].partial - = targetm.calls.arg_partial_bytes (args_so_far, mode, type, - argpos < n_named_args); + = target_internalm.arg_partial_bytes (args_so_far, mode, type, + argpos < n_named_args); args[i].pass_on_stack = targetm.calls.must_pass_in_stack (mode, type); @@ -1204,8 +1207,8 @@ initialize_argument_information (int num /* Increment ARGS_SO_FAR, which has info about which arg-registers have been used, etc. */ - targetm.calls.function_arg_advance (args_so_far, TYPE_MODE (type), - type, argpos < n_named_args); + target_internalm.function_arg_advance (args_so_far, TYPE_MODE (type), + type, argpos < n_named_args); } } @@ -2231,26 +2234,26 @@ expand_call (tree exp, rtx target, int i /* Now possibly adjust the number of named args. Normally, don't include the last named arg if anonymous args follow. We do include the last named arg if - targetm.calls.strict_argument_naming() returns nonzero. + target_internalm.strict_argument_naming() returns nonzero. (If no anonymous args follow, the result of list_length is actually one too large. This is harmless.) - If targetm.calls.pretend_outgoing_varargs_named() returns - nonzero, and targetm.calls.strict_argument_naming() returns zero, + If target_internalm.pretend_outgoing_varargs_named() returns + nonzero, and target_internalm.strict_argument_naming() returns zero, this machine will be able to place unnamed args that were passed in registers into the stack. So treat all args as named. This allows the insns emitting for a specific argument list to be independent of the function declaration. - If targetm.calls.pretend_outgoing_varargs_named() returns zero, + If target_internalm.pretend_outgoing_varargs_named() returns zero, we do not have any reliable way to pass unnamed args in registers, so we must force them into memory. */ if (type_arg_types != 0 - && targetm.calls.strict_argument_naming (&args_so_far)) + && target_internalm.strict_argument_naming (&args_so_far)) ; else if (type_arg_types != 0 - && ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far)) + && ! target_internalm.pretend_outgoing_varargs_named (&args_so_far)) /* Don't include the last named arg. */ --n_named_args; else @@ -2861,14 +2864,14 @@ expand_call (tree exp, rtx target, int i /* Set up next argument register. For sibling calls on machines with register windows this should be the incoming register. */ if (pass == 0) - next_arg_reg = targetm.calls.function_incoming_arg (&args_so_far, - VOIDmode, - void_type_node, - true); + next_arg_reg = target_internalm.function_incoming_arg (&args_so_far, + VOIDmode, + void_type_node, + true); else - next_arg_reg = targetm.calls.function_arg (&args_so_far, - VOIDmode, void_type_node, - true); + next_arg_reg + = target_internalm.function_arg (&args_so_far, VOIDmode, + void_type_node, true); /* All arguments and registers used for the call must be set up by now! */ @@ -3455,10 +3458,10 @@ emit_library_call_value_1 (int retval, r argvec[count].mode = Pmode; argvec[count].partial = 0; - argvec[count].reg = targetm.calls.function_arg (&args_so_far, - Pmode, NULL_TREE, true); - gcc_assert (targetm.calls.arg_partial_bytes (&args_so_far, Pmode, - NULL_TREE, 1) == 0); + argvec[count].reg + = target_internalm.function_arg (&args_so_far, Pmode, NULL_TREE, true); + gcc_assert (target_internalm.arg_partial_bytes (&args_so_far, Pmode, + NULL_TREE, 1) == 0); locate_and_pad_parm (Pmode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA @@ -3472,7 +3475,8 @@ emit_library_call_value_1 (int retval, r || reg_parm_stack_space > 0) args_size.constant += argvec[count].locate.size.constant; - targetm.calls.function_arg_advance (&args_so_far, Pmode, (tree) 0, true); + target_internalm.function_arg_advance (&args_so_far, Pmode, (tree) 0, + true); count++; } @@ -3531,11 +3535,11 @@ emit_library_call_value_1 (int retval, r argvec[count].value = val; argvec[count].mode = mode; - argvec[count].reg = targetm.calls.function_arg (&args_so_far, mode, - NULL_TREE, true); + argvec[count].reg + = target_internalm.function_arg (&args_so_far, mode, NULL_TREE, true); argvec[count].partial - = targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL_TREE, 1); + = target_internalm.arg_partial_bytes (&args_so_far, mode, NULL_TREE, 1); locate_and_pad_parm (mode, NULL_TREE, #ifdef STACK_PARMS_IN_REG_PARM_AREA @@ -3552,7 +3556,8 @@ emit_library_call_value_1 (int retval, r || reg_parm_stack_space > 0) args_size.constant += argvec[count].locate.size.constant; - targetm.calls.function_arg_advance (&args_so_far, mode, (tree) 0, true); + target_internalm.function_arg_advance (&args_so_far, mode, (tree) 0, + true); } /* If this machine requires an external definition for library @@ -3868,8 +3873,8 @@ emit_library_call_value_1 (int retval, r build_function_type (tfom, NULL_TREE), original_args_size.constant, args_size.constant, struct_value_size, - targetm.calls.function_arg (&args_so_far, - VOIDmode, void_type_node, true), + target_internalm.function_arg (&args_so_far, + VOIDmode, void_type_node, true), valreg, old_inhibit_defer_pop + 1, call_fusage, flags, & args_so_far); Index: genhooks.c =================================================================== --- genhooks.c (revision 166860) +++ genhooks.c (working copy) @@ -34,6 +34,7 @@ #define DEFHOOK(NAME, DOC, TYPE, PARAMS, #define DEFHOOK_UNDOC(NAME, DOC, TYPE, PARAMS, INIT) \ { "*", #TYPE, HOOK_PREFIX #NAME, #PARAMS, #INIT }, #include "target.def" +#include "target-internal.def" #undef DEFHOOK }; Index: config/frv/frv.c =================================================================== --- config/frv/frv.c (revision 166860) +++ config/frv/frv.c (working copy) @@ -46,6 +46,7 @@ the Free Software Foundation; either ver #include "ggc.h" #include #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "targhooks.h" #include "integrate.h" @@ -545,6 +546,8 @@ #define TARGET_DEFAULT_TARGET_FLAGS \ struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #define FRV_SYMBOL_REF_TLS_P(RTX) \ (GET_CODE (RTX) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (RTX) != 0) Index: config/s390/s390.c =================================================================== --- config/s390/s390.c (revision 166860) +++ config/s390/s390.c (working copy) @@ -46,6 +46,7 @@ Software Foundation; either version 3, o #include "integrate.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "debug.h" #include "langhooks.h" @@ -10660,4 +10661,6 @@ s390_loop_unroll_adjust (unsigned nunrol struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-s390.h" Index: config/m32c/m32c.c =================================================================== --- config/m32c/m32c.c (revision 166860) +++ config/m32c/m32c.c (working copy) @@ -44,6 +44,7 @@ #include "function.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm_p.h" #include "langhooks.h" @@ -4850,4 +4851,6 @@ m32c_output_compare (rtx insn, rtx *oper struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-m32c.h" Index: config/spu/spu.c =================================================================== --- config/spu/spu.c (revision 166860) +++ config/spu/spu.c (working copy) @@ -41,6 +41,7 @@ #include "hashtab.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "reload.h" @@ -491,6 +492,8 @@ #define TARGET_ADDR_SPACE_LEGITIMATE_ADD struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + static void spu_option_init_struct (struct gcc_options *opts) { Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 166860) +++ config/sparc/sparc.c (working copy) @@ -47,6 +47,7 @@ the Free Software Foundation; either ver #include "tm_p.h" #include "debug.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "cfglayout.h" #include "gimple.h" @@ -652,6 +653,8 @@ enum processor_type sparc_cpu; struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* Implement TARGET_HANDLE_OPTION. */ static bool Index: config/mep/mep.c =================================================================== --- config/mep/mep.c (revision 166860) +++ config/mep/mep.c (working copy) @@ -47,6 +47,7 @@ Software Foundation; either version 3, o #include "toplev.h" #include "integrate.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "df.h" @@ -7459,4 +7460,6 @@ mep_asm_init_sections (void) struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-mep.h" Index: config/m32r/m32r.c =================================================================== --- config/m32r/m32r.c (revision 166860) +++ config/m32r/m32r.c (working copy) @@ -41,6 +41,7 @@ #include "df.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm-constrs.h" @@ -208,6 +209,8 @@ static void m32r_trampoline_init (rtx, t #define TARGET_TRAMPOLINE_INIT m32r_trampoline_init struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ Index: config/rx/rx.c =================================================================== --- config/rx/rx.c (revision 166860) +++ config/rx/rx.c (working copy) @@ -48,6 +48,7 @@ #include "tm_p.h" #include "debug.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" @@ -2882,4 +2883,6 @@ rx_memory_move_cost (enum machine_mode m struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* #include "gt-rx.h" */ Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 166860) +++ config/i386/i386.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "basic-block.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "cgraph.h" @@ -34703,5 +34704,7 @@ #define TARGET_VECTORIZE_AUTOVECTORIZE_V #define TARGET_ASM_CODE_END ix86_code_end struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; #include "gt-i386.h" Index: config/sh/sh.c =================================================================== --- config/sh/sh.c (revision 166860) +++ config/sh/sh.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "dwarf2.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "basic-block.h" @@ -600,6 +601,8 @@ #define TARGET_BRANCH_TARGET_REGISTER_CA #define SYMBOL_FLAG_FUNCVEC_FUNCTION (SYMBOL_FLAG_MACH_DEP << 0) struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ Index: config/pdp11/pdp11.c =================================================================== --- config/pdp11/pdp11.c (revision 166860) +++ config/pdp11/pdp11.c (working copy) @@ -39,6 +39,7 @@ the Free Software Foundation; either ver #include "toplev.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -1925,3 +1926,5 @@ pdp11_function_arg_advance (CUMULATIVE_A } struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; Index: config/microblaze/microblaze.c =================================================================== --- config/microblaze/microblaze.c (revision 166860) +++ config/microblaze/microblaze.c (working copy) @@ -44,6 +44,7 @@ #include "ggc.h" #include "hashtab.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm_p.h" #include "gstab.h" @@ -3052,5 +3053,7 @@ #define TARGET_ASM_FUNCTION_END_PROLOGUE #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; #include "gt-microblaze.h" Index: config/avr/avr.c =================================================================== --- config/avr/avr.c (revision 166860) +++ config/avr/avr.c (working copy) @@ -42,6 +42,7 @@ #include "ggc.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "params.h" #include "df.h" @@ -219,6 +220,8 @@ static GTY(()) rtx zero_reg_rtx; #define TARGET_OPTION_OPTIMIZATION_TABLE avr_option_optimization_table struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; static void avr_option_override (void) Index: config/crx/crx.c =================================================================== --- config/crx/crx.c (revision 166860) +++ config/crx/crx.c (working copy) @@ -48,6 +48,7 @@ #include "basic-block.h" #include "df.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" /*****************************************************************************/ @@ -207,6 +208,8 @@ static void crx_function_arg_advance (CU struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /*****************************************************************************/ /* TARGET HOOK IMPLEMENTATIONS */ Index: config/xtensa/xtensa.c =================================================================== --- config/xtensa/xtensa.c (revision 166860) +++ config/xtensa/xtensa.c (working copy) @@ -46,6 +46,7 @@ Software Foundation; either version 3, o #include "libfuncs.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "gimple.h" @@ -277,6 +278,8 @@ static void xtensa_trampoline_init (rtx, struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* Functions to test Xtensa immediate operand validity. */ Index: config/stormy16/stormy16.c =================================================================== --- config/stormy16/stormy16.c (revision 166860) +++ config/stormy16/stormy16.c (working copy) @@ -42,6 +42,7 @@ #include "except.h" #include "function.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm_p.h" #include "langhooks.h" @@ -2686,4 +2687,6 @@ xstormy16_return_in_memory (const_tree t struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-stormy16.h" Index: config/lm32/lm32.c =================================================================== --- config/lm32/lm32.c (revision 166860) +++ config/lm32/lm32.c (working copy) @@ -46,6 +46,7 @@ #include "libfuncs.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "tm-constrs.h" @@ -121,6 +122,8 @@ static void lm32_function_arg_advance (C struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* Current frame information calculated by lm32_compute_frame_size. */ static struct lm32_frame_info current_frame_info; Index: config/moxie/moxie.c =================================================================== --- config/moxie/moxie.c (revision 166860) +++ config/moxie/moxie.c (working copy) @@ -43,6 +43,7 @@ #include "function.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm_p.h" #include "langhooks.h" @@ -590,4 +591,6 @@ moxie_trampoline_init (rtx m_tramp, tree struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-moxie.h" Index: config/m68hc11/m68hc11.c =================================================================== --- config/m68hc11/m68hc11.c (revision 166860) +++ config/m68hc11/m68hc11.c (working copy) @@ -58,6 +58,7 @@ the Free Software Foundation; either ver #include "ggc.h" #include "reload.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -312,6 +313,8 @@ enum reg_class m68hc11_tmp_regs_class = #define TARGET_OPTION_OVERRIDE m68hc11_option_override struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; static void m68hc11_option_override (void) Index: config/cris/cris.c =================================================================== --- config/cris/cris.c (revision 166860) +++ config/cris/cris.c (working copy) @@ -42,6 +42,7 @@ the Free Software Foundation; either ver #include "debug.h" #include "output.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "ggc.h" #include "optabs.h" @@ -250,6 +251,8 @@ static rtx cris_libcall_value (enum mach struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* Helper for cris_load_multiple_op and cris_ret_movem_op. */ bool Index: config/iq2000/iq2000.c =================================================================== --- config/iq2000/iq2000.c (revision 166860) +++ config/iq2000/iq2000.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "tm_p.h" #include "debug.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "df.h" @@ -267,6 +268,8 @@ static bool iq2000_print_operand_punct_v #define TARGET_TRAMPOLINE_INIT iq2000_trampoline_init struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Return nonzero if we split the address into high and low parts. */ Index: config/mn10300/mn10300.c =================================================================== --- config/mn10300/mn10300.c (revision 166860) +++ config/mn10300/mn10300.c (working copy) @@ -42,6 +42,7 @@ #include "toplev.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -2513,3 +2514,5 @@ mn10300_adjust_sched_cost (rtx insn, rtx #define TARGET_SCHED_ADJUST_COST mn10300_adjust_sched_cost struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; Index: config/ia64/ia64.c =================================================================== --- config/ia64/ia64.c (revision 166860) +++ config/ia64/ia64.c (working copy) @@ -47,6 +47,7 @@ the Free Software Foundation; either ver #include "sched-int.h" #include "timevar.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "tm_p.h" #include "hashtab.h" @@ -633,6 +634,8 @@ #define TARGET_SCHED_FIRST_CYCLE_MULTIPA #define TARGET_PREFERRED_RELOAD_CLASS ia64_preferred_reload_class struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; typedef enum { Index: config/m68k/m68k.c =================================================================== --- config/m68k/m68k.c (revision 166860) +++ config/m68k/m68k.c (working copy) @@ -39,6 +39,7 @@ the Free Software Foundation; either ver #include "reload.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "debug.h" #include "flags.h" @@ -303,6 +304,8 @@ #define TARGET_SCHED_FIRST_CYCLE_MULTIPA }; struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Base flags for 68k ISAs. */ #define FL_FOR_isa_00 FL_ISA_68000 Index: config/rs6000/rs6000.c =================================================================== --- config/rs6000/rs6000.c (revision 166860) +++ config/rs6000/rs6000.c (working copy) @@ -47,6 +47,7 @@ #include "hashtab.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "reload.h" @@ -1703,6 +1704,8 @@ #define TARGET_DEFAULT_TARGET_FLAGS \ #define TARGET_FUNCTION_VALUE rs6000_function_value struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. Index: config/picochip/picochip.c =================================================================== --- config/picochip/picochip.c (revision 166860) +++ config/picochip/picochip.c (working copy) @@ -47,6 +47,7 @@ the Free Software Foundation; either ver #include "hashtab.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "langhooks.h" #include "reload.h" @@ -345,6 +346,8 @@ #define TARGET_SCHED_FIRST_CYCLE_MULTIPA #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Only return a value in memory if it is greater than 4 bytes. Index: config/arc/arc.c =================================================================== --- config/arc/arc.c (revision 166860) +++ config/arc/arc.c (working copy) @@ -41,6 +41,7 @@ the Free Software Foundation; either ver #include "df.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" /* Which cpu we're compiling for. */ @@ -172,6 +173,8 @@ static void arc_option_override (void); #define TARGET_TRAMPOLINE_INIT arc_trampoline_init struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Implement TARGET_HANDLE_OPTION. */ Index: config/mcore/mcore.c =================================================================== --- config/mcore/mcore.c (revision 166860) +++ config/mcore/mcore.c (working copy) @@ -43,6 +43,7 @@ #include "diagnostic-core.h" #include "toplev.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -261,6 +262,8 @@ static void mcore_option_override #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Adjust the stack and return the number of bytes taken to do it. */ static void Index: config/score/score.c =================================================================== --- config/score/score.c (revision 166860) +++ config/score/score.c (working copy) @@ -44,6 +44,7 @@ #include "hashtab.h" #include "debug.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "integrate.h" #include "langhooks.h" @@ -1233,3 +1234,5 @@ score_block_move (rtx *ops) } struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 166860) +++ config/arm/arm.c (working copy) @@ -50,6 +50,7 @@ #include "integrate.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "debug.h" #include "langhooks.h" @@ -583,6 +584,8 @@ #define TARGET_VECTORIZE_SUPPORT_VECTOR_ arm_builtin_support_vector_misalignment struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Obstack for minipool constant handling. */ static struct obstack minipool_obstack; Index: config/pa/pa.c =================================================================== --- config/pa/pa.c (revision 166860) +++ config/pa/pa.c (working copy) @@ -46,6 +46,7 @@ the Free Software Foundation; either ver #include "predict.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -388,6 +389,8 @@ static GTY((length ("n_deferred_plabels" #define TARGET_CAN_ELIMINATE pa_can_eliminate struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Parse the -mfixed-range= option string. */ Index: config/mips/mips.c =================================================================== --- config/mips/mips.c (revision 166860) +++ config/mips/mips.c (working copy) @@ -50,6 +50,7 @@ the Free Software Foundation; either ver #include "hashtab.h" #include "debug.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "integrate.h" #include "langhooks.h" @@ -16625,5 +16626,7 @@ #define TARGET_DEFAULT_TARGET_FLAGS \ #define TARGET_SHIFT_TRUNCATION_MASK mips_shift_truncation_mask struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; #include "gt-mips.h" Index: config/vax/vax.c =================================================================== --- config/vax/vax.c (revision 166860) +++ config/vax/vax.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "tm-constrs.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" static void vax_option_override (void); @@ -125,6 +126,8 @@ static int vax_return_pops_args (tree, t #define TARGET_OPTION_OVERRIDE vax_option_override struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Set global variables as needed for the options enabled. */ Index: config/h8300/h8300.c =================================================================== --- config/h8300/h8300.c (revision 166860) +++ config/h8300/h8300.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "tm_p.h" #include "ggc.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -5964,3 +5965,5 @@ h8300_trampoline_init (rtx m_tramp, tree #define TARGET_OPTION_OPTIMIZATION_TABLE h8300_option_optimization_table struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; Index: config/v850/v850.c =================================================================== --- config/v850/v850.c (revision 166860) +++ config/v850/v850.c (working copy) @@ -41,6 +41,7 @@ #include "integrate.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -3207,4 +3208,6 @@ v850_issue_rate (void) struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-v850.h" Index: config/mmix/mmix.c =================================================================== --- config/mmix/mmix.c (revision 166860) +++ config/mmix/mmix.c (working copy) @@ -44,6 +44,7 @@ the Free Software Foundation; either ver #include "tm_p.h" #include "integrate.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "df.h" @@ -265,6 +266,8 @@ static void mmix_trampoline_init (rtx, t struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + /* Functions that are expansions for target macros. See Target Macros in `Using and Porting GCC'. */ Index: config/bfin/bfin.c =================================================================== --- config/bfin/bfin.c (revision 166860) +++ config/bfin/bfin.c (working copy) @@ -38,6 +38,7 @@ #include "function.h" #include "input.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "expr.h" #include "diagnostic-core.h" @@ -6697,3 +6698,5 @@ bfin_expand_builtin (tree exp, rtx targe #define TARGET_TRAMPOLINE_INIT bfin_trampoline_init struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; --- /dev/null 2010-11-16 11:27:06.961993111 +0000 +++ target-internal.def 2010-11-17 11:10:40.291074192 +0000 @@ -0,0 +1,145 @@ +/* Target hook definitions. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING3. If not see + . + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + +/* The following macros should be provided by the including file: + + DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT): Define a function-valued hook. + DEFHOOKPOD(DOC, TYPE, NAME, INIT): Define a piece-of-data 'hook'. */ + +/* Defaults for optional macros: + DEFHOOKPODX(NAME, TYPE, INIT): Like DEFHOOKPOD, but share documentation + with the previous 'hook'. */ +#ifndef DEFHOOKPODX +#define DEFHOOKPODX(NAME, TYPE, INIT) DEFHOOKPOD (NAME, 0, TYPE, INIT) +#endif + +/* HOOKSTRUCT(FRAGMENT): Declarator fragments to encapsulate all the + members into a struct gcc_target, which in turn contains several + sub-structs. */ +#ifndef HOOKSTRUCT +#define HOOKSTRUCT(FRAGMENT) +#endif +/* HOOK_VECTOR: Start a struct declaration, which then gets its own initializer. + HOOK_VECTOR_END: Close a struct declaration, providing a member declarator + name for nested use. */ +#ifndef HOOK_VECTOR_1 +#define HOOK_VECTOR_1(NAME, FRAGMENT) HOOKSTRUCT(FRAGMENT) +#endif +#define HOOK_VECTOR(INIT_NAME, SNAME) HOOK_VECTOR_1 (INIT_NAME, struct SNAME {) +#define HOOK_VECTOR_END(DECL_NAME) HOOK_VECTOR_1(,} DECL_NAME ;) + +HOOK_VECTOR (TARGET_INTERNAL_INITIALIZER, gcc_target_internal) + +/* See target.def for an explanation of the fields. */ + +#undef HOOK_PREFIX +#define HOOK_PREFIX "TARGET_" + +/* Return true if a parameter must be passed by reference. TYPE may + be null if this is a libcall. CA may be null if this query is + from __builtin_va_arg. */ +DEFHOOK +(pass_by_reference, + "", + bool, + (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named), + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) + +/* Returns pretend_argument_size. */ +DEFHOOK +(setup_incoming_varargs, + "", + void, (CUMULATIVE_ARGS *args_so_far, enum machine_mode mode, tree type, + int *pretend_args_size, int second_time), + default_setup_incoming_varargs) + +DEFHOOK +(strict_argument_naming, + "", + bool, (CUMULATIVE_ARGS *ca), + hook_bool_CUMULATIVE_ARGS_false) + +/* Returns true if we should use + targetm.calls.setup_incoming_varargs() and/or + targetm.calls.strict_argument_naming(). */ +DEFHOOK +(pretend_outgoing_varargs_named, + "", + bool, (CUMULATIVE_ARGS *ca), + default_pretend_outgoing_varargs_named) + +/* Return true if type TYPE, mode MODE, which is passed by reference, + should have the object copy generated by the callee rather than + the caller. It is never called for TYPE requiring constructors. */ +DEFHOOK +(callee_copies, + "", + bool, + (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, bool named), + hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false) + +/* Return zero for arguments passed entirely on the stack or entirely + in registers. If passed in both, return the number of bytes passed + in registers; the balance is therefore passed on the stack. */ +DEFHOOK +(arg_partial_bytes, + "", + int, (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, bool named), + hook_int_CUMULATIVE_ARGS_mode_tree_bool_0) + +/* Update the state in CA to advance past an argument in the + argument list. The values MODE, TYPE, and NAMED describe that + argument. */ +/* ??? tm.texi still only describes the old macro. */ +DEFHOOK_UNDOC +(function_arg_advance, + "", + void, + (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, bool named), + default_function_arg_advance) + +/* Return zero if the argument described by the state of CA should + be placed on a stack, or a hard register in which to store the + argument. The values MODE, TYPE, and NAMED describe that + argument. */ +/* ??? tm.texi still only describes the old macro. */ +DEFHOOK_UNDOC +(function_arg, + "", + rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, + bool named), + default_function_arg) + +/* Likewise, but for machines with register windows. Return the + location where the argument will appear to the callee. */ +/* ??? tm.texi still only describes the old macro. */ +DEFHOOK_UNDOC +(function_incoming_arg, + "", + rtx, (CUMULATIVE_ARGS *ca, enum machine_mode mode, const_tree type, + bool named), + default_function_incoming_arg) + +/* Empty macro arguments are undefined in C90, so use an empty macro. */ +#define C90_EMPTY_HACK +/* Close the 'struct gcc_target_internal' definition. */ +HOOK_VECTOR_END (C90_EMPTY_HACK) --- /dev/null 2010-11-16 11:27:06.961993111 +0000 +++ target-internal.h 2010-11-17 12:31:47.143073957 +0000 @@ -0,0 +1,58 @@ +/* Data structure definitions for a generic GCC target. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING3. If not see + . + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! */ + + +/* This file contains a data structure that describes aspects of a + GCC target that require tm.h as context. + Hooks that should never been added to struct gcc_target can be + moved here. + + This structure has its initializer declared in target-def.h in the + form of large macro TARGET_INTERNAL_INITIALIZER that expands to many + smaller macros. + + The smaller macros each initialize one component of the structure, + and each has a default. Each target should have a file that + includes target-internal.h and target-def.h, and overrides any + inappropriate defaults by undefining the relevant macro and defining a + suitable replacement. That file should then contain the definition of + "target_internalm" like so: + + struct gcc_target target_internalm = TARGET_INTERNAL_INITIALIZER; */ + +#ifndef GCC_TARGET_INTERNAL_H +#define GCC_TARGET_INTERNAL_H + +#include "tm.h" +#include "insn-modes.h" + +/* The target structure. This holds all the backend hooks. */ +#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME; +#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME) PARAMS; +#define DEFHOOK_UNDOC DEFHOOK +#define HOOKSTRUCT(FRAGMENT) FRAGMENT + +#include "target-internal.def" + +extern struct gcc_target_internal target_internalm; + +#endif /* GCC_TARGET_INTERNALH */ Index: Makefile.in =================================================================== --- Makefile.in (revision 166860) +++ Makefile.in (working copy) @@ -861,7 +861,8 @@ REVISION_s := "\"$(if $(DEVPHASE_c), $( VEC_H = vec.h statistics.h EXCEPT_H = except.h $(HASHTAB_H) vecprim.h vecir.h TOPLEV_H = toplev.h $(INPUT_H) bversion.h $(DIAGNOSTIC_CORE_H) -TARGET_H = $(TM_H) target.h target.def insn-modes.h +TARGET_H = target.h target.def insn-modes.h +TARGET_INTERNAL_H = $(TM_H) $(TARGET_H) target-internal.h target-internal.def MACHMODE_H = machmode.h mode-classes.def insn-modes.h HOOKS_H = hooks.h $(MACHMODE_H) HOSTHOOKS_DEF_H = hosthooks-def.h $(HOOKS_H) @@ -2817,7 +2818,7 @@ opts-common.o : opts-common.c $(OPTS_H) coretypes.h intl.h $(DIAGNOSTIC_H) $(TM_H) targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) $(FUNCTION_H) output.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) \ - $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) $(GGC_H) gt-targhooks.h \ + $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_INTERNAL_H) $(GGC_H) gt-targhooks.h \ $(OPTABS_H) $(RECOG_H) reload.h hard-reg-set.h bversion.h: s-bversion; @true @@ -2890,8 +2891,8 @@ function.o : function.c $(CONFIG_H) $(SY $(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \ $(OPTABS_H) $(LIBFUNCS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ output.h $(EXCEPT_H) $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ - gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \ - $(TREE_PASS_H) $(DF_H) $(TIMEVAR_H) vecprim.h + gt-function.h $(TARGET_INTERNAL_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) \ + $(PREDICT_H) $(TREE_PASS_H) $(DF_H) $(TIMEVAR_H) vecprim.h statistics.o : statistics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TREE_PASS_H) $(TREE_DUMP_H) $(HASHTAB_H) statistics.h $(FUNCTION_H) stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ @@ -2910,8 +2911,8 @@ except.o : except.c $(CONFIG_H) $(SYSTEM expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \ $(LIBFUNCS_H) $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \ - typeclass.h hard-reg-set.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) hard-reg-set.h $(EXCEPT_H) \ - reload.h langhooks.h intl.h $(TM_P_H) $(TARGET_H) \ + typeclass.h hard-reg-set.h $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) hard-reg-set.h \ + $(EXCEPT_H) reload.h langhooks.h intl.h $(TM_P_H) $(TARGET_INTERNAL_H) \ tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \ $(TREE_PASS_H) $(DF_H) $(DIAGNOSTIC_H) vecprim.h $(SSAEXPAND_H) dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ @@ -2925,7 +2926,7 @@ builtins.o : builtins.c $(CONFIG_H) $(SY tree-mudflap.h realmpfr.h $(BUILTINS_DEF) $(MACHMODE_H) \ $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) value-prof.h calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ + $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_INTERNAL_H) \ $(LIBFUNCS_H) $(REGS_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) output.h \ $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) $(CGRAPH_H) $(EXCEPT_H) sbitmap.h \ $(DBGCNT_H) $(TREE_FLOW_H) @@ -3092,8 +3093,8 @@ dce.o : dce.c $(CONFIG_H) $(SYSTEM_H) co dse.o : dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(TM_P_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ $(RECOG_H) $(EXPR_H) $(DF_H) cselib.h $(DBGCNT_H) $(TIMEVAR_H) \ - $(TREE_PASS_H) alloc-pool.h $(ALIAS_H) dse.h $(OPTABS_H) $(TARGET_H) \ - $(BITMAP_H) + $(TREE_PASS_H) alloc-pool.h $(ALIAS_H) dse.h $(OPTABS_H) \ + $(TARGET_INTERNAL_H) $(BITMAP_H) fwprop.o : fwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) insn-config.h $(RECOG_H) $(FLAGS_H) $(OBSTACK_H) $(BASIC_BLOCK_H) \ output.h $(DF_H) alloc-pool.h $(TIMEVAR_H) $(TREE_PASS_H) $(TARGET_H) \ @@ -3711,6 +3712,7 @@ s-tm-texi: build/genhooks$(build_exeext) @if cmp -s $(srcdir)/doc/tm.texi tm.texi; then \ $(STAMP) $@; \ elif test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/tm.texi.in \ + && test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/target-internal.def \ && test $(srcdir)/doc/tm.texi -nt $(srcdir)/doc/target.def; then \ echo >&2 ; \ echo You should edit $(srcdir)/doc/tm.texi.in rather than $(srcdir)/doc/tm.texi . >&2 ; \ @@ -3912,7 +3914,8 @@ build/genpreds.o : genpreds.c $(RTL_BASE coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h $(OBSTACK_H) build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \ coretypes.h $(GTM_H) errors.h $(READ_MD_H) gensupport.h -build/genhooks.o : genhooks.c target.def $(BCONFIG_H) $(SYSTEM_H) errors.h +build/genhooks.o : genhooks.c target.def target-internal.def $(BCONFIG_H) \ + $(SYSTEM_H) errors.h # Compile the programs that generate insn-* from the machine description. # They are compiled with $(COMPILER_FOR_BUILD), and associated libraries, Index: config/alpha/alpha.c =================================================================== --- config/alpha/alpha.c (revision 166860) +++ config/alpha/alpha.c (working copy) @@ -47,6 +47,7 @@ the Free Software Foundation; either ver #include "integrate.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" #include "debug.h" #include "langhooks.h" @@ -6145,7 +6146,7 @@ alpha_setup_incoming_varargs (CUMULATIVE CUMULATIVE_ARGS cum = *pcum; /* Skip the current argument. */ - targetm.calls.function_arg_advance (&cum, mode, type, true); + target_internalm.function_arg_advance (&cum, mode, type, true); #if TARGET_ABI_UNICOSMK /* On Unicos/Mk, the standard subroutine __T3E_MISMATCH stores all register @@ -11160,5 +11161,7 @@ #define TARGET_DEFAULT_TARGET_FLAGS \ struct gcc_target targetm = TARGET_INITIALIZER; +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; + #include "gt-alpha.h" Index: config/fr30/fr30.c =================================================================== --- config/fr30/fr30.c (revision 166860) +++ config/fr30/fr30.c (working copy) @@ -44,6 +44,7 @@ #include "toplev.h" #include "tm_p.h" #include "target.h" +#include "target-internal.h" #include "target-def.h" /*}}}*/ @@ -206,6 +207,8 @@ #define MUST_SAVE_REGISTER(regno) \ #define TARGET_OPTION_OPTIMIZATION_TABLE fr30_option_optimization_table struct gcc_target targetm = TARGET_INITIALIZER; + +struct gcc_target_internal target_internalm = TARGET_INTERNAL_INITIALIZER; /* Worker function for TARGET_CAN_ELIMINATE. */ @@ -481,7 +484,7 @@ fr30_setup_incoming_varargs (CUMULATIVE_ /* ??? This run-time test as well as the code inside the if statement is probably unnecessary. */ - if (targetm.calls.strict_argument_naming (arg_regs_used_so_far)) + if (target_internalm.strict_argument_naming (arg_regs_used_so_far)) /* If TARGET_STRICT_ARGUMENT_NAMING returns true, then the last named arg must not be treated as an anonymous arg. */ arg_regs_used_so_far += fr30_num_arg_regs (mode, type);