gcc/gcc/doc/tm.texi

11271 lines
515 KiB
Plaintext
Raw Normal View History

@c Copyright (C) 1988-2014 Free Software Foundation, Inc.
1996-09-25 01:21:45 +02:00
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@node Target Macros
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
@chapter Target Description Macros and Functions
1996-09-25 01:21:45 +02:00
@cindex machine description macros
@cindex target description macros
@cindex macros, target description
@cindex @file{tm.h} macros
In addition to the file @file{@var{machine}.md}, a machine description
includes a C header file conventionally given the name
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
@file{@var{machine}.h} and a C source file named @file{@var{machine}.c}.
The header file defines numerous macros that convey the information
about the target machine that does not fit into the scheme of the
@file{.md} file. The file @file{tm.h} should be a link to
@file{@var{machine}.h}. The header file @file{config.h} includes
@file{tm.h} and most compiler source files include @file{config.h}. The
source file defines a variable @code{targetm}, which is a structure
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
containing pointers to functions and data relating to the target
machine. @file{@var{machine}.c} should also contain their definitions,
if they are not defined elsewhere in GCC, and other functions called
through the macros defined in the @file{.h} file.
1996-09-25 01:21:45 +02:00
@menu
* Target Structure:: The @code{targetm} variable.
1996-09-25 01:21:45 +02:00
* Driver:: Controlling how the driver runs the compilation passes.
* Run-time Target:: Defining @samp{-m} options like @option{-m68000} and @option{-m68020}.
* Per-Function Data:: Defining data structures for per-function information.
1996-09-25 01:21:45 +02:00
* Storage Layout:: Defining sizes and alignments of data.
* Type Layout:: Defining sizes and properties of basic user data types.
* Registers:: Naming and describing the hardware registers.
* Register Classes:: Defining the classes of hardware registers.
* Stack and Calling:: Defining which way the stack grows and by how much.
* Varargs:: Defining the varargs macros.
1996-09-25 01:21:45 +02:00
* Trampolines:: Code set up at run time to enter a nested function.
* Library Calls:: Controlling how library routines are implicitly called.
* Addressing Modes:: Defining addressing modes valid for memory operands.
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
* Anchored Addresses:: Defining how @option{-fsection-anchors} should work.
1996-09-25 01:21:45 +02:00
* Condition Code:: Defining how insns update the condition code.
* Costs:: Defining relative costs of different operations.
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
* Scheduling:: Adjusting the behavior of the instruction scheduler.
1996-09-25 01:21:45 +02:00
* Sections:: Dividing storage into text, data, and other sections.
* PIC:: Macros for position independent code.
1996-09-25 01:21:45 +02:00
* Assembler Format:: Defining how to write insns and pseudo-ops to output.
* Debugging Info:: Defining the format of debugging output.
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
* Floating Point:: Handling floating point for cross-compilers.
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
* Mode Switching:: Insertion of mode-switching instructions.
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
* Target Attributes:: Defining target-specific uses of @code{__attribute__}.
targhooks.h (default_emutls_var_fields, [...]): Declare. * targhooks.h (default_emutls_var_fields, default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. From-SVN: r134729
2008-04-27 17:35:19 +02:00
* Emulated TLS:: Emulated TLS support.
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
* MIPS Coprocessors:: MIPS coprocessor support and how to customize it.
* PCH Target:: Validity checking for precompiled headers.
* C++ ABI:: Controlling C++ ABI changes.
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
* Named Address Spaces:: Adding support for named address spaces
1996-09-25 01:21:45 +02:00
* Misc:: Everything else.
@end menu
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
@node Target Structure
@section The Global @code{targetm} Variable
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
@cindex target hooks
@cindex target functions
@deftypevar {struct gcc_target} targetm
The target @file{.c} file must define the global @code{targetm} variable
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
which contains pointers to functions and data relating to the target
machine. The variable is declared in @file{target.h};
@file{target-def.h} defines the macro @code{TARGET_INITIALIZER} which is
used to initialize the variable, and macros for the default initializers
for elements of the structure. The @file{.c} file should override those
macros for which the default definition is inappropriate. For example:
@smallexample
#include "target.h"
#include "target-def.h"
/* @r{Initialize the GCC target structure.} */
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
#undef TARGET_COMP_TYPE_ATTRIBUTES
#define TARGET_COMP_TYPE_ATTRIBUTES @var{machine}_comp_type_attributes
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
struct gcc_target targetm = TARGET_INITIALIZER;
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
@end smallexample
@end deftypevar
Where a macro should be defined in the @file{.c} file in this manner to
form part of the @code{targetm} structure, it is documented below as a
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
``Target Hook'' with a prototype. Many macros will change in future
from being defined in the @file{.h} file to being part of the
@code{targetm} structure.
Makefile.in (TARGET_H, [...]): New. * Makefile.in (TARGET_H, TARGET_DEF_H): New. (c-decl.o, tree.o, c-typeck.o, $(out_object_file)): Update. * c-decl.c (duplicate_decls): Use function pointer. * c-typeck.c (common_type): Similarly. * tree.c (valid_machine_attribute): Similarly. (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New function. * tree.h (merge_machine_type_attributes): Rename merge_type_attributes. (merge_machine_decl_attributes): Rename merge_decl_attributes. (merge_dllimport_decl_attributes): New prototype. * target.h: New. * target-def.h: New. doc: (Joseph Myers) * doc/gcc.texi, doc/tm.texi: Update documentation. cp: Make-lang.in: Update dependencies. * spew.c: Include target.h. (duplicate_decls): Call target function. * decl2.c: include target.h (import_export_class): Use existence of target function pointer. * typeck.c: Include target.h. (qualify_type_recursive): Rename variable. Call target function. (type_after_usual_arithmetic_conversions): Similarly. (common_type): Similarly. config: * 1750a/1750a.c, a29k/29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c, avr/avr.c, c4x/c4x.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c, dsp16xx/dsp16xx.c, elxsi/elxsi.c, fr30/fr30.c, i370/i370.c, i386/i386.c, i860/i860.c, i960/i960.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c, m68k/m68k.c, m88k/m88k.c, mips/mips.c, mn10200/mn10200.c, mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c, pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c, v850/v850.c, vax/vax.c, we32k/we32k.c) : Include target.h and target-def.h. Define target. * arc/arc-protos.h (arc_valid_machine_decl_attribute): Remove. * arc/arc.c (arc_valid_machine_decl_attribute): Rename arc_valid_decl_attribute, make static. * arc/arc.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/arm-protos.h (arm_valid_machine_decl_attribute, arm_valid_type_attribute_p, arm_pe_valid_machine_decl_attribute, arm_pe_merge_machine_decl_attributes): Remove. * arm/arm.c (arm_valid_machine_decl_attribute_p): Rename arm_valid_decl_attribute_p, make static. (arm_pe_valid_decl_attribute_p): Move from pe.c. * arm/pe.c (arm_pe_valid_machine_decl_attribute_p): Move to arm.c. (arm_pe_merge_machine_decl_attributes): Move to tree.c. * arm/arm.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * arm/coff.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/elf.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): New. (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * avr/avr-protos.h (valid_machine_type_attribute, valid_machine_decl_attribute): Remove. * avr/avr.c (valid_machine_type_attribute, valid_machine_decl_attribute): Rename and make static. * avr/avr.h (VALID_MACHINE_TYPE_ATTRIBUTE, VALID_MACHINE_DECL_ATTRIBUTE): Remove. * c4x/c4x-protos.h (c4x_valid_type_attribute_p): Remove. * c4x/c4x.c (c4x_valid_type_attribute_p): Make static. * c4x/c4x.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * d30v/d30v.h: Remove obsolete comments. * h8300/h8300-protos.h (h8300_valid_machine_decl_attribute): Remove. * h8300/h8300.c (h8300_valid_machine_decl_attribute): Rename, make static. * h8300/h8300.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * i386/cygwin.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. (i386_pe_merge_decl_attributes, MERGE_MACHINE_DECL_ATTRIBUTES, i386_pe_valid_type_attributes_p): Remove. * i386/i386-protos.h (ix86_valid_decl_attribute_p, ix86_valid_type_attribute_p): Remove. * i386/i386.c (ix86_valid_decl_attribute_p): Remove. (ix86_valid_type_attribute_p): Make static. * i386/i386.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/winnt.c (i386_pe_merge_decl_attributes): Move to tree.c. * ia64/ia64-protos.h (ia64_valid_type_attribute): Remove. * ia64/ia64.c (ia64_valid_type_attribute): Make static. * ia64/ia64.h (VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * m32r/m32r-protos.h (m32r_valid_machine_decl_attribute): Remove. * m32r/m32r.c (m32r_valid_decl_attribute): Make static. * m32r/m32r.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * m68hc11/m68hc11-protos.h (m68hc11_valid_decl_attribute_p, m68hc11_valid_type_attribute_p): Remove. * m68hc11/m68hc11.c (m68hc11_valid_decl_attribute_p): Remove. (m68hc11_valid_type_attribute_p): Make static. * m68hc11/m68hc11.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * mcore/mcore-protos.h (mcore_valid_machine_decl_attribute, mcore_merge_machine_decl_attribute): Remove. * mcore/mcore.c (mcore_valid_machine_decl_attribute): Rename, make static. (mcore_merge_machine_decl_attributes): Move to tree.c. * mcore/mcore.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define. * ns32k/ns32k-protos.h (ns32k_valid_decl_attribute_p, ns32k_valid_type_attribute_p): Remove. * ns32k/ns32k.c (ns32k_valid_decl_attribute_p): Remove. (ns32k_valid_type_attribute_p): Make static. * ns32k/ns32k.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * rs6000/rs6000-protos.h (rs6000_valid_decl_attribute_p, rs6000_valid_type_attribute_p): Remove. * rs6000/rs6000.c (rs6000_valid_decl_attribute_p): Remove. (rs6000_valid_type_attribute_p): Make static. * rs6000/rs6000.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * sh/sh-protos.h (sh_valid_machine_decl_attribute): Remove. * sh/sh.c (sh_valid_machine_decl_attribute): Rename, make static. * sh/sh.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. * v850/v850-protos.h (v850_valid_machine_decl_attribute): Remove. * v850/v850.c (v850_valid_machine_decl_attribute): Rename, make static. * v850/v850.h (VALID_MACHINE_DECL_ATTRIBUTE): Remove. From-SVN: r43585
2001-06-26 20:09:27 +02:00
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
Similarly, there is a @code{targetcm} variable for hooks that are
specific to front ends for C-family languages, documented as ``C
Target Hook''. This is declared in @file{c-family/c-target.h}, the
initializer @code{TARGETCM_INITIALIZER} in
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
@file{c-family/c-target-def.h}. If targets initialize @code{targetcm}
themselves, they should set @code{target_has_targetcm=yes} in
@file{config.gcc}; otherwise a default definition is used.
Similarly, there is a @code{targetm_common} variable for hooks that
are shared between the compiler driver and the compilers proper,
documented as ``Common Target Hook''. This is declared in
@file{common/common-target.h}, the initializer
@code{TARGETM_COMMON_INITIALIZER} in
@file{common/common-target-def.h}. If targets initialize
@code{targetm_common} themselves, they should set
@code{target_has_targetm_common=yes} in @file{config.gcc}; otherwise a
default definition is used.
1996-09-25 01:21:45 +02:00
@node Driver
@section Controlling the Compilation Driver, @file{gcc}
@cindex driver
@cindex controlling the compilation driver
@c prevent bad page break with this line
You can control the compilation driver.
@defmac DRIVER_SELF_SPECS
A list of specs for the driver itself. It should be a suitable
initializer for an array of strings, with no surrounding braces.
The driver applies these specs to its own command line between loading
default @file{specs} files (but not command-line specified ones) and
choosing the multilib directory or running any subcommands. It
applies them in the order given, so each spec can depend on the
options added by earlier ones. It is also possible to remove options
using @samp{%<@var{option}} in the usual way.
This macro can be useful when a port has several interdependent target
options. It provides a way of standardizing the command line so
that the other specs are easier to write.
Do not define this macro if it does not need to do anything.
@end defmac
@defmac OPTION_DEFAULT_SPECS
A list of specs used to support configure-time default options (i.e.@:
@option{--with} options) in the driver. It should be a suitable initializer
for an array of structures, each containing two strings, without the
outermost pair of surrounding braces.
The first item in the pair is the name of the default. This must match
the code in @file{config.gcc} for the target. The second item is a spec
to apply if a default with this name was specified. The string
@samp{%(VALUE)} in the spec will be replaced by the value of the default
everywhere it occurs.
The driver will apply these specs to its own command line between loading
default @file{specs} files and processing @code{DRIVER_SELF_SPECS}, using
the same mechanism as @code{DRIVER_SELF_SPECS}.
Do not define this macro if it does not need to do anything.
@end defmac
@defmac CPP_SPEC
A C string constant that tells the GCC driver program options to
pass to CPP@. It can also specify how to translate options you
give to GCC into options for GCC to pass to the CPP@.
1996-09-25 01:21:45 +02:00
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CPLUSPLUS_CPP_SPEC
This macro is just like @code{CPP_SPEC}, but is used for C++, rather
than C@. If you do not define this macro, then the value of
@code{CPP_SPEC} (if any) will be used instead.
@end defmac
@defmac CC1_SPEC
A C string constant that tells the GCC driver program options to
pass to @code{cc1}, @code{cc1plus}, @code{f771}, and the other language
front ends.
It can also specify how to translate options you give to GCC into options
for GCC to pass to front ends.
1996-09-25 01:21:45 +02:00
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CC1PLUS_SPEC
A C string constant that tells the GCC driver program options to
1996-09-25 01:21:45 +02:00
pass to @code{cc1plus}. It can also specify how to translate options you
give to GCC into options for GCC to pass to the @code{cc1plus}.
1996-09-25 01:21:45 +02:00
Do not define this macro if it does not need to do anything.
Note that everything defined in CC1_SPEC is already passed to
@code{cc1plus} so there is no need to duplicate the contents of
CC1_SPEC in CC1PLUS_SPEC@.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_SPEC
A C string constant that tells the GCC driver program options to
1996-09-25 01:21:45 +02:00
pass to the assembler. It can also specify how to translate options
you give to GCC into options for GCC to pass to the assembler.
1996-09-25 01:21:45 +02:00
See the file @file{sun3.h} for an example of this.
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_FINAL_SPEC
A C string constant that tells the GCC driver program how to
1996-09-25 01:21:45 +02:00
run any programs which cleanup after the normal assembler.
Normally, this is not needed. See the file @file{mips.h} for
an example of this.
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac AS_NEEDS_DASH_FOR_PIPED_INPUT
Define this macro, with no value, if the driver should give the assembler
an argument consisting of a single dash, @option{-}, to instruct it to
read from its standard input (which will be a pipe connected to the
output of the compiler proper). This argument is given after any
@option{-o} option specifying the name of the output file.
If you do not define this macro, the assembler is assumed to read its
standard input if given no non-option arguments. If your assembler
cannot read standard input at all, use a @samp{%@{pipe:%e@}} construct;
see @file{mips.h} for instance.
@end defmac
@defmac LINK_SPEC
A C string constant that tells the GCC driver program options to
1996-09-25 01:21:45 +02:00
pass to the linker. It can also specify how to translate options you
give to GCC into options for GCC to pass to the linker.
1996-09-25 01:21:45 +02:00
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LIB_SPEC
1996-09-25 01:21:45 +02:00
Another C string constant used much like @code{LINK_SPEC}. The difference
between the two is that @code{LIB_SPEC} is used at the end of the
command given to the linker.
If this macro is not defined, a default is provided that
loads the standard C library from the usual place. See @file{gcc.c}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LIBGCC_SPEC
Another C string constant that tells the GCC driver program
1996-09-25 01:21:45 +02:00
how and when to place a reference to @file{libgcc.a} into the
linker command line. This constant is placed both before and after
the value of @code{LIB_SPEC}.
If this macro is not defined, the GCC driver provides a default that
passes the string @option{-lgcc} to the linker.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REAL_LIBGCC_SPEC
By default, if @code{ENABLE_SHARED_LIBGCC} is defined, the
@code{LIBGCC_SPEC} is not directly used by the driver program but is
instead modified to refer to different versions of @file{libgcc.a}
depending on the values of the command line flags @option{-static},
@option{-shared}, @option{-static-libgcc}, and @option{-shared-libgcc}. On
targets where these modifications are inappropriate, define
@code{REAL_LIBGCC_SPEC} instead. @code{REAL_LIBGCC_SPEC} tells the
driver how to place a reference to @file{libgcc} on the link command
line, but, unlike @code{LIBGCC_SPEC}, it is used unmodified.
@end defmac
@defmac USE_LD_AS_NEEDED
A macro that controls the modifications to @code{LIBGCC_SPEC}
mentioned in @code{REAL_LIBGCC_SPEC}. If nonzero, a spec will be
generated that uses @option{--as-needed} or equivalent options and the
shared @file{libgcc} in place of the
static exception handler library, when linking without any of
@code{-static}, @code{-static-libgcc}, or @code{-shared-libgcc}.
@end defmac
@defmac LINK_EH_SPEC
If defined, this C string constant is added to @code{LINK_SPEC}.
When @code{USE_LD_AS_NEEDED} is zero or undefined, it also affects
the modifications to @code{LIBGCC_SPEC} mentioned in
@code{REAL_LIBGCC_SPEC}.
@end defmac
@defmac STARTFILE_SPEC
1996-09-25 01:21:45 +02:00
Another C string constant used much like @code{LINK_SPEC}. The
difference between the two is that @code{STARTFILE_SPEC} is used at
the very beginning of the command given to the linker.
If this macro is not defined, a default is provided that loads the
standard C startup file from the usual place. See @file{gcc.c}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ENDFILE_SPEC
1996-09-25 01:21:45 +02:00
Another C string constant used much like @code{LINK_SPEC}. The
difference between the two is that @code{ENDFILE_SPEC} is used at
the very end of the command given to the linker.
Do not define this macro if it does not need to do anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac THREAD_MODEL_SPEC
GCC @code{-v} will print the thread model GCC was configured to use.
However, this doesn't work on platforms that are multilibbed on thread
models, such as AIX 4.3. On such platforms, define
@code{THREAD_MODEL_SPEC} such that it evaluates to a string without
blanks that names one of the recognized thread models. @code{%*}, the
default value of this macro, will expand to the value of
@code{thread_file} set in @file{config.gcc}.
@end defmac
@defmac SYSROOT_SUFFIX_SPEC
Define this macro to add a suffix to the target sysroot when GCC is
configured with a sysroot. This will cause GCC to search for usr/lib,
et al, within sysroot+suffix.
@end defmac
@defmac SYSROOT_HEADERS_SUFFIX_SPEC
Define this macro to add a headers_suffix to the target sysroot when
GCC is configured with a sysroot. This will cause GCC to pass the
updated sysroot+headers_suffix to CPP, causing it to search for
usr/include, et al, within sysroot+headers_suffix.
@end defmac
@defmac EXTRA_SPECS
1996-09-25 01:21:45 +02:00
Define this macro to provide additional specifications to put in the
@file{specs} file that can be used in various specifications like
@code{CC1_SPEC}.
The definition should be an initializer for an array of structures,
containing a string constant, that defines the specification name, and a
string constant that provides the specification.
Do not define this macro if it does not need to do anything.
@code{EXTRA_SPECS} is useful when an architecture contains several
related targets, which have various @code{@dots{}_SPECS} which are similar
1996-09-25 01:21:45 +02:00
to each other, and the maintainer would like one central place to keep
these definitions.
For example, the PowerPC System V.4 targets use @code{EXTRA_SPECS} to
define either @code{_CALL_SYSV} when the System V calling sequence is
used or @code{_CALL_AIX} when the older AIX-based calling sequence is
used.
The @file{config/rs6000/rs6000.h} target file defines:
@smallexample
1996-09-25 01:21:45 +02:00
#define EXTRA_SPECS \
@{ "cpp_sysv_default", CPP_SYSV_DEFAULT @},
#define CPP_SYS_DEFAULT ""
@end smallexample
1996-09-25 01:21:45 +02:00
The @file{config/rs6000/sysv.h} target file defines:
@smallexample
#undef CPP_SPEC
#define CPP_SPEC \
"%@{posix: -D_POSIX_SOURCE @} \
%@{mcall-sysv: -D_CALL_SYSV @} \
%@{!mcall-sysv: %(cpp_sysv_default) @} \
1996-09-25 01:21:45 +02:00
%@{msoft-float: -D_SOFT_FLOAT@} %@{mcpu=403: -D_SOFT_FLOAT@}"
#undef CPP_SYSV_DEFAULT
#define CPP_SYSV_DEFAULT "-D_CALL_SYSV"
@end smallexample
while the @file{config/rs6000/eabiaix.h} target file defines
@code{CPP_SYSV_DEFAULT} as:
@smallexample
#undef CPP_SYSV_DEFAULT
#define CPP_SYSV_DEFAULT "-D_CALL_AIX"
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LINK_LIBGCC_SPECIAL_1
1996-09-25 01:21:45 +02:00
Define this macro if the driver program should find the library
@file{libgcc.a}. If you do not define this macro, the driver program will pass
the argument @option{-lgcc} to tell the linker to do the search.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LINK_GCC_C_SEQUENCE_SPEC
The sequence in which libgcc and libc are specified to the linker.
By default this is @code{%G %L %G}.
@end defmac
@defmac LINK_COMMAND_SPEC
A C string constant giving the complete command line need to execute the
linker. When you do this, you will need to update your port each time a
change is made to the link command line within @file{gcc.c}. Therefore,
define this macro only if you need to completely redefine the command
line for invoking the linker and there is no other way to accomplish
the effect you need. Overriding this macro may be avoidable by overriding
@code{LINK_GCC_C_SEQUENCE_SPEC} instead.
@end defmac
@deftypevr {Common Target Hook} bool TARGET_ALWAYS_STRIP_DOTDOT
True if @file{..} components should always be removed from directory names computed relative to GCC's internal directories, false (default) if such components should be preserved and directory names containing them passed to other tools such as the linker.
@end deftypevr
@defmac MULTILIB_DEFAULTS
1996-09-25 01:21:45 +02:00
Define this macro as a C expression for the initializer of an array of
string to tell the driver program which options are defaults for this
target and thus do not need to be handled specially when using
@code{MULTILIB_OPTIONS}.
Do not define this macro if @code{MULTILIB_OPTIONS} is not defined in
the target makefile fragment or if none of the options listed in
@code{MULTILIB_OPTIONS} are set by default.
@xref{Target Fragment}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac RELATIVE_PREFIX_NOT_LINKDIR
Define this macro to tell @command{gcc} that it should only translate
a @option{-B} prefix into a @option{-L} linker option if the prefix
1996-09-25 01:21:45 +02:00
indicates an absolute file name.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MD_EXEC_PREFIX
1996-09-25 01:21:45 +02:00
If defined, this macro is an additional prefix to try after
@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched
when the compiler is built as a cross
compiler. If you define @code{MD_EXEC_PREFIX}, then be sure to add it
to the list of directories used to find the assembler in @file{configure.in}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STANDARD_STARTFILE_PREFIX
1996-09-25 01:21:45 +02:00
Define this macro as a C string constant if you wish to override the
standard choice of @code{libdir} as the default prefix to
1996-09-25 01:21:45 +02:00
try when searching for startup files such as @file{crt0.o}.
@code{STANDARD_STARTFILE_PREFIX} is not searched when the compiler
is built as a cross compiler.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STANDARD_STARTFILE_PREFIX_1
Define this macro as a C string constant if you wish to override the
standard choice of @code{/lib} as a prefix to try after the default prefix
when searching for startup files such as @file{crt0.o}.
@code{STANDARD_STARTFILE_PREFIX_1} is not searched when the compiler
is built as a cross compiler.
@end defmac
@defmac STANDARD_STARTFILE_PREFIX_2
Define this macro as a C string constant if you wish to override the
standard choice of @code{/lib} as yet another prefix to try after the
default prefix when searching for startup files such as @file{crt0.o}.
@code{STANDARD_STARTFILE_PREFIX_2} is not searched when the compiler
is built as a cross compiler.
@end defmac
@defmac MD_STARTFILE_PREFIX
1996-09-25 01:21:45 +02:00
If defined, this macro supplies an additional prefix to try after the
standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the
compiler is built as a cross compiler.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MD_STARTFILE_PREFIX_1
1996-09-25 01:21:45 +02:00
If defined, this macro supplies yet another prefix to try after the
standard prefixes. It is not searched when the compiler is built as a
cross compiler.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac INIT_ENVIRONMENT
Define this macro as a C string constant if you wish to set environment
1996-09-25 01:21:45 +02:00
variables for programs called by the driver, such as the assembler and
loader. The driver passes the value of this macro to @code{putenv} to
initialize the necessary environment variables.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LOCAL_INCLUDE_DIR
1996-09-25 01:21:45 +02:00
Define this macro as a C string constant if you wish to override the
standard choice of @file{/usr/local/include} as the default prefix to
try when searching for local header files. @code{LOCAL_INCLUDE_DIR}
configure.ac: Add --with-native-system-header-dir. * configure.ac: Add --with-native-system-header-dir. Set and substitute NATIVE_SYSTEM_HEADER_DIR. Use native_system_header when setting target_header_dir. * config.gcc: Always set native_system_header_dir. (*-*-gnu*): Set native_system_header_dir. Don't use t-gnu. (i[34567]86-pc-msdosdjgpp*): Set native_system_header_dir. Don't use i386/t-djgpp. (i[34567]86-*-mingw* | x86_64-*-mingw*): Set native_system_header_dir. (spu-*-elf*): Set native_system_header_dir. * Makefile.in (NATIVE_SYSTEM_HEADER_DIR): Set to @NATIVE_SYSTEM_HEADER_DIR@. (PREPROCESSOR_DEFINES): Define NATIVE_SYSTEM_HEADER_DIR. * cppdefault.c (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. (cpp_include_defaults): Don't use SYSTEM_INCLUDE_DIR. Rename STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * system.h: Poison SYSTEM_INCLUDE_DIR, STANDARD_INCLUDE_DIR, and STANDARD_INCLUDE_COMPONENT. * config/i386/t-mingw32 (NATIVE_SYSTEM_HEADER_DIR): Remove. * config/i386/t-mingw-w32: Likewise. * config/i386/t-mingw-w64: Likewise. * config/spu/t-spu-elf: Likewise. * config/i386/t-djgpp: Remove. * config/t-gnu: Remove. * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. * config/i386/djgpp.h (STANDARD_INCLUDE_DIR): Don't define. * config/spu/spu-elf.h: Likewise. * config/vms/xm-vms.h: Likewise. * config/gnu.h: Likewise. * config/openbsd.h (INCLUDE_DEFAULTS): Change STANDARD_INCLUDE_DIR and STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_DIR and NATIVE_SYSTME_HEADER_COMPONENT. * doc/install.texi (Configuration): Document --with-native-system-header-dir. Mention it in the documentation for --with-sysroot and --with-build-sysroot. * doc/tm.texi.in (Driver): Don't document SYSTEM_INCLUDE_DIR or STANDARD_INCLUDE_DIR. Rename STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_COMPONENT. Rename uses of STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * doc/fragments.texi (Target Fragment): Don't document NATIVE_SYSTEM_HEADER_DIR. * configure, doc/tm.texi: Rebuild. Co-Authored-By: Ian Lance Taylor <iant@google.com> From-SVN: r180114
2011-10-18 01:31:25 +02:00
comes before @code{NATIVE_SYSTEM_HEADER_DIR} (set in
@file{config.gcc}, normally @file{/usr/include}) in the search order.
1996-09-25 01:21:45 +02:00
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
Cross compilers do not search either @file{/usr/local/include} or its
replacement.
@end defmac
1996-09-25 01:21:45 +02:00
configure.ac: Add --with-native-system-header-dir. * configure.ac: Add --with-native-system-header-dir. Set and substitute NATIVE_SYSTEM_HEADER_DIR. Use native_system_header when setting target_header_dir. * config.gcc: Always set native_system_header_dir. (*-*-gnu*): Set native_system_header_dir. Don't use t-gnu. (i[34567]86-pc-msdosdjgpp*): Set native_system_header_dir. Don't use i386/t-djgpp. (i[34567]86-*-mingw* | x86_64-*-mingw*): Set native_system_header_dir. (spu-*-elf*): Set native_system_header_dir. * Makefile.in (NATIVE_SYSTEM_HEADER_DIR): Set to @NATIVE_SYSTEM_HEADER_DIR@. (PREPROCESSOR_DEFINES): Define NATIVE_SYSTEM_HEADER_DIR. * cppdefault.c (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. (cpp_include_defaults): Don't use SYSTEM_INCLUDE_DIR. Rename STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * system.h: Poison SYSTEM_INCLUDE_DIR, STANDARD_INCLUDE_DIR, and STANDARD_INCLUDE_COMPONENT. * config/i386/t-mingw32 (NATIVE_SYSTEM_HEADER_DIR): Remove. * config/i386/t-mingw-w32: Likewise. * config/i386/t-mingw-w64: Likewise. * config/spu/t-spu-elf: Likewise. * config/i386/t-djgpp: Remove. * config/t-gnu: Remove. * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. * config/i386/djgpp.h (STANDARD_INCLUDE_DIR): Don't define. * config/spu/spu-elf.h: Likewise. * config/vms/xm-vms.h: Likewise. * config/gnu.h: Likewise. * config/openbsd.h (INCLUDE_DEFAULTS): Change STANDARD_INCLUDE_DIR and STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_DIR and NATIVE_SYSTME_HEADER_COMPONENT. * doc/install.texi (Configuration): Document --with-native-system-header-dir. Mention it in the documentation for --with-sysroot and --with-build-sysroot. * doc/tm.texi.in (Driver): Don't document SYSTEM_INCLUDE_DIR or STANDARD_INCLUDE_DIR. Rename STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_COMPONENT. Rename uses of STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * doc/fragments.texi (Target Fragment): Don't document NATIVE_SYSTEM_HEADER_DIR. * configure, doc/tm.texi: Rebuild. Co-Authored-By: Ian Lance Taylor <iant@google.com> From-SVN: r180114
2011-10-18 01:31:25 +02:00
@defmac NATIVE_SYSTEM_HEADER_COMPONENT
The ``component'' corresponding to @code{NATIVE_SYSTEM_HEADER_DIR}.
See @code{INCLUDE_DEFAULTS}, below, for the description of components.
If you do not define this macro, no component is used.
@end defmac
@defmac INCLUDE_DEFAULTS
1996-09-25 01:21:45 +02:00
Define this macro if you wish to override the entire default search path
for include files. For a native compiler, the default search path
usually consists of @code{GCC_INCLUDE_DIR}, @code{LOCAL_INCLUDE_DIR},
configure.ac: Add --with-native-system-header-dir. * configure.ac: Add --with-native-system-header-dir. Set and substitute NATIVE_SYSTEM_HEADER_DIR. Use native_system_header when setting target_header_dir. * config.gcc: Always set native_system_header_dir. (*-*-gnu*): Set native_system_header_dir. Don't use t-gnu. (i[34567]86-pc-msdosdjgpp*): Set native_system_header_dir. Don't use i386/t-djgpp. (i[34567]86-*-mingw* | x86_64-*-mingw*): Set native_system_header_dir. (spu-*-elf*): Set native_system_header_dir. * Makefile.in (NATIVE_SYSTEM_HEADER_DIR): Set to @NATIVE_SYSTEM_HEADER_DIR@. (PREPROCESSOR_DEFINES): Define NATIVE_SYSTEM_HEADER_DIR. * cppdefault.c (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. (cpp_include_defaults): Don't use SYSTEM_INCLUDE_DIR. Rename STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * system.h: Poison SYSTEM_INCLUDE_DIR, STANDARD_INCLUDE_DIR, and STANDARD_INCLUDE_COMPONENT. * config/i386/t-mingw32 (NATIVE_SYSTEM_HEADER_DIR): Remove. * config/i386/t-mingw-w32: Likewise. * config/i386/t-mingw-w64: Likewise. * config/spu/t-spu-elf: Likewise. * config/i386/t-djgpp: Remove. * config/t-gnu: Remove. * config/i386/mingw32.h (STANDARD_INCLUDE_DIR): Don't define. (NATIVE_SYSTEM_HEADER_COMPONENT): Rename from STANDARD_INCLUDE_COMPONENT. * config/i386/djgpp.h (STANDARD_INCLUDE_DIR): Don't define. * config/spu/spu-elf.h: Likewise. * config/vms/xm-vms.h: Likewise. * config/gnu.h: Likewise. * config/openbsd.h (INCLUDE_DEFAULTS): Change STANDARD_INCLUDE_DIR and STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_DIR and NATIVE_SYSTME_HEADER_COMPONENT. * doc/install.texi (Configuration): Document --with-native-system-header-dir. Mention it in the documentation for --with-sysroot and --with-build-sysroot. * doc/tm.texi.in (Driver): Don't document SYSTEM_INCLUDE_DIR or STANDARD_INCLUDE_DIR. Rename STANDARD_INCLUDE_COMPONENT to NATIVE_SYSTEM_HEADER_COMPONENT. Rename uses of STANDARD_INCLUDE_DIR to NATIVE_SYSTEM_HEADER_DIR. * doc/fragments.texi (Target Fragment): Don't document NATIVE_SYSTEM_HEADER_DIR. * configure, doc/tm.texi: Rebuild. Co-Authored-By: Ian Lance Taylor <iant@google.com> From-SVN: r180114
2011-10-18 01:31:25 +02:00
@code{GPLUSPLUS_INCLUDE_DIR}, and
@code{NATIVE_SYSTEM_HEADER_DIR}. In addition, @code{GPLUSPLUS_INCLUDE_DIR}
1996-09-25 01:21:45 +02:00
and @code{GCC_INCLUDE_DIR} are defined automatically by @file{Makefile},
and specify private search areas for GCC@. The directory
1996-09-25 01:21:45 +02:00
@code{GPLUSPLUS_INCLUDE_DIR} is used only for C++ programs.
The definition should be an initializer for an array of structures.
Each array element should have four elements: the directory name (a
string constant), the component name (also a string constant), a flag
for C++-only directories,
and a flag showing that the includes in the directory don't need to be
wrapped in @code{extern @samp{C}} when compiling C++. Mark the end of
the array with a null element.
The component name denotes what GNU package the include file is part of,
if any, in all uppercase letters. For example, it might be @samp{GCC}
or @samp{BINUTILS}. If the package is part of a vendor-supplied
operating system, code the component name as @samp{0}.
For example, here is the definition used for VAX/VMS:
1996-09-25 01:21:45 +02:00
@smallexample
1996-09-25 01:21:45 +02:00
#define INCLUDE_DEFAULTS \
@{ \
@{ "GNU_GXX_INCLUDE:", "G++", 1, 1@}, \
@{ "GNU_CC_INCLUDE:", "GCC", 0, 0@}, \
@{ "SYS$SYSROOT:[SYSLIB.]", 0, 0, 0@}, \
@{ ".", 0, 0, 0@}, \
@{ 0, 0, 0, 0@} \
1996-09-25 01:21:45 +02:00
@}
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
Here is the order of prefixes tried for exec files:
@enumerate
@item
Any prefixes specified by the user with @option{-B}.
1996-09-25 01:21:45 +02:00
@item
The environment variable @code{GCC_EXEC_PREFIX} or, if @code{GCC_EXEC_PREFIX}
is not set and the compiler has not been installed in the configure-time
@var{prefix}, the location in which the compiler has actually been installed.
1996-09-25 01:21:45 +02:00
@item
The directories specified by the environment variable @code{COMPILER_PATH}.
@item
The macro @code{STANDARD_EXEC_PREFIX}, if the compiler has been installed
in the configured-time @var{prefix}.
1996-09-25 01:21:45 +02:00
@item
The location @file{/usr/libexec/gcc/}, but only if this is a native compiler.
1996-09-25 01:21:45 +02:00
@item
The location @file{/usr/lib/gcc/}, but only if this is a native compiler.
@item
The macro @code{MD_EXEC_PREFIX}, if defined, but only if this is a native
compiler.
1996-09-25 01:21:45 +02:00
@end enumerate
Here is the order of prefixes tried for startfiles:
@enumerate
@item
Any prefixes specified by the user with @option{-B}.
1996-09-25 01:21:45 +02:00
@item
The environment variable @code{GCC_EXEC_PREFIX} or its automatically determined
value based on the installed toolchain location.
1996-09-25 01:21:45 +02:00
@item
The directories specified by the environment variable @code{LIBRARY_PATH}
(or port-specific name; native only, cross compilers do not use this).
1996-09-25 01:21:45 +02:00
@item
The macro @code{STANDARD_EXEC_PREFIX}, but only if the toolchain is installed
in the configured @var{prefix} or this is a native compiler.
1996-09-25 01:21:45 +02:00
@item
The location @file{/usr/lib/gcc/}, but only if this is a native compiler.
@item
The macro @code{MD_EXEC_PREFIX}, if defined, but only if this is a native
compiler.
1996-09-25 01:21:45 +02:00
@item
The macro @code{MD_STARTFILE_PREFIX}, if defined, but only if this is a
native compiler, or we have a target system root.
1996-09-25 01:21:45 +02:00
@item
The macro @code{MD_STARTFILE_PREFIX_1}, if defined, but only if this is a
native compiler, or we have a target system root.
1996-09-25 01:21:45 +02:00
@item
The macro @code{STANDARD_STARTFILE_PREFIX}, with any sysroot modifications.
If this path is relative it will be prefixed by @code{GCC_EXEC_PREFIX} and
the machine suffix or @code{STANDARD_EXEC_PREFIX} and the machine suffix.
1996-09-25 01:21:45 +02:00
@item
The macro @code{STANDARD_STARTFILE_PREFIX_1}, but only if this is a native
compiler, or we have a target system root. The default for this macro is
1996-09-25 01:21:45 +02:00
@file{/lib/}.
@item
The macro @code{STANDARD_STARTFILE_PREFIX_2}, but only if this is a native
compiler, or we have a target system root. The default for this macro is
1996-09-25 01:21:45 +02:00
@file{/usr/lib/}.
@end enumerate
@node Run-time Target
@section Run-time Target Specification
@cindex run-time target specification
@cindex predefined macros
@cindex target specifications
@c prevent bad page break with this line
Here are run-time target specifications.
@defmac TARGET_CPU_CPP_BUILTINS ()
This function-like macro expands to a block of code that defines
built-in preprocessor macros and assertions for the target CPU, using
the functions @code{builtin_define}, @code{builtin_define_std} and
@code{builtin_assert}. When the front end
calls this macro it provides a trailing semicolon, and since it has
finished command line option processing your code can use those
results freely.
@code{builtin_assert} takes a string in the form you pass to the
command-line option @option{-A}, such as @code{cpu=mips}, and creates
the assertion. @code{builtin_define} takes a string in the form
accepted by option @option{-D} and unconditionally defines the macro.
@code{builtin_define_std} takes a string representing the name of an
object-like macro. If it doesn't lie in the user's namespace,
@code{builtin_define_std} defines it unconditionally. Otherwise, it
defines a version with two leading underscores, and another version
with two leading and trailing underscores, and defines the original
only if an ISO standard was not requested on the command line. For
example, passing @code{unix} defines @code{__unix}, @code{__unix__}
and possibly @code{unix}; passing @code{_mips} defines @code{__mips},
@code{__mips__} and possibly @code{_mips}, and passing @code{_ABI64}
defines only @code{_ABI64}.
You can also test for the C dialect being compiled. The variable
@code{c_language} is set to one of @code{clk_c}, @code{clk_cplusplus}
or @code{clk_objective_c}. Note that if we are preprocessing
assembler, this variable will be @code{clk_c} but the function-like
macro @code{preprocessing_asm_p()} will return true, so you might want
tm.texi (Run-time Target): Add comment about flag_iso and strict ANSI. 2002-06-11 Eric Christopher <echristo@redhat.com> * doc/tm.texi (Run-time Target): Add comment about flag_iso and strict ANSI. * config/mips/ecoff.h (CPP_PREDEFINES): Remove. * config/mips/ecoffl.h: Ditto. * config/mips/elf64.h (SUBTARGET_CPP_SPEC): Remove. (CPP_PREDEFINES): Ditto. * config/mips/elfl64.h: Ditto. * config/mips/elfl.h: Ditto. * config/mips/iris3.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): #if 0 out until irix header consolidation. * config/mips/iris5.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): Replace with SUBTARGET_OS_CPP_BUILTINS. * config/mips/iris6.h: Ditto. (CPLUSPLUS_CPP_SPEC): Remove. * config/mips/linux.h: Ditto. * config/mips/netbsd.h: Ditto. * config/mips/openbsd.h: Ditto. * config/mips/rtems.h: Ditto. * config/mips/rtems64.h: Ditto. * config/mips/sni-svr4.h: Ditto. * config/mips/mips.h (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, ISA_MIPS32, ISA_MIPS64): New defines. (GENERATE_MULT3_SI, HAVE_SQRT_P, ISA_HAS_64BIT_REGS, ISA_HAS_BRANCHLIKELY, ISA_HAS_CONDMOVE, ISA_HAS_8CC, ISA_HAS_FP4, ISA_HAS_COND_TRAP, ISA_HAS_MADD_MSUB, ISA_HAS_NMADD_NMSUB, ISA_HAS_CLZ_CLO, ISA_HAS_DCLZ_DCLO): Use. (TARGET_CPU_CPP_BUILTINS): Define. (CPP_PREDEFINES, LONG_MAX_SPEC, CPP_FPR_SPEC, CPP_SPEC): Remove. * config/mips/mips.md (mulsi3_mult3): Use ISA_MIPS32/64. (movdicc): Remove check for ISA_MIPS32. (bunordered, bordered, bungt, bunlt, buneq, bunge, bunle, sunordered_df, sunordered_sf, sordered_df, sordered_sf, sunlt_df, sunlt_sf, sungt_df, sungt_sf, suneq_df, suneq_sf, sunge_df, sunge_sf, sunle_df, sunle_sf): New patterns. From-SVN: r54493
2002-06-11 09:26:38 +02:00
to check for that first. If you need to check for strict ANSI, the
variable @code{flag_iso} can be used. The function-like macro
@code{preprocessing_trad_p()} can be used to check for traditional
preprocessing.
@end defmac
@defmac TARGET_OS_CPP_BUILTINS ()
Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
and is used for the target operating system instead.
@end defmac
@defmac TARGET_OBJFMT_CPP_BUILTINS ()
Similarly to @code{TARGET_CPU_CPP_BUILTINS} but this macro is optional
and is used for the target object format. @file{elfos.h} uses this
macro to define @code{__ELF__}, so you probably do not need to define
it yourself.
@end defmac
@deftypevar {extern int} target_flags
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
This variable is declared in @file{options.h}, which is included before
any target-specific headers.
@end deftypevar
1996-09-25 01:21:45 +02:00
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypevr {Common Target Hook} int TARGET_DEFAULT_TARGET_FLAGS
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
This variable specifies the initial value of @code{target_flags}.
Its default setting is 0.
@end deftypevr
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
@cindex optional hardware or system features
@cindex features, optional, in system conventions
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypefn {Common Target Hook} bool TARGET_HANDLE_OPTION (struct gcc_options *@var{opts}, struct gcc_options *@var{opts_set}, const struct cl_decoded_option *@var{decoded}, location_t @var{loc})
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
This hook is called whenever the user specifies one of the
target-specific options described by the @file{.opt} definition files
(@pxref{Options}). It has the opportunity to do some option-specific
processing and should return true if the option is valid. The default
definition does nothing but return true.
target.def (handle_option): Take gcc_options and cl_decoded_option pointers and location_t. * target.def (handle_option): Take gcc_options and cl_decoded_option pointers and location_t. * doc/tm.texi.in (TARGET_HANDLE_OPTION): Update documentation. * doc/tm.texi: Regenerate. * hooks.c (hook_bool_size_t_constcharptr_int_true): Remove. * hooks.h (hook_bool_size_t_constcharptr_int_true): Don't declare. * lto-opts.c (lto_reissue_options): Generate option structure for targetm.handle_option call. * opts.c (target_handle_option): Update call to targetm.handle_option. Remove assertions about values now passed down to hook. * targhooks.c (default_target_handle_option): New. * targhooks.h (default_target_handle_option): Declare. * config/alpha/alpha.c: Include opts.h. (alpha_handle_option): Update to new hook interface. * config/arm/arm.c: Include opts.h. (arm_handle_option): Update to new hook interface. * config/arm/t-arm (arm.o): Update dependencies. * config/bfin/bfin.c: Include opts.h. (bfin_handle_option): Update to new hook interface. * config/cris/cris.c: Include opts.h. (cris_handle_option): Update to new hook interface. * config/frv/frv.c: Include opts.h. (frv_handle_option): Update to new hook interface. * config/i386/i386.c: Include opts.h. (ix86_handle_option): Update to new hook interface. (ix86_valid_target_attribute_inner_p): Generate option structure for call to ix86_handle_option. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64.c: Include opts.h. (ia64_handle_option): Update to new hook interface. * config/ia64/t-ia64 (ia64.o): Update dependencies. * config/iq2000/iq2000.c: Include opts.h. (iq2000_handle_option): Update to new hook interface. * config/m32c/m32c.c: Include opts.h. (m32c_handle_option): Update to new hook interface. * config/m32r/m32r.c: Include opts.h. (m32r_handle_option): Update to new hook interface. * config/m68k/m68k.c: Include opts.h. (m68k_handle_option): Update to new hook interface. * config/mep/mep.c: Include opts.h. (mep_handle_option): Update to new hook interface. * config/microblaze/microblaze.c: Include opts.h. (microblaze_handle_option): Update to new hook interface. * config/mips/mips.c: Include opts.h. (mips_handle_option): Update to new hook interface. * config/mn10300/mn10300.c: Include opts.h. (mn10300_handle_option): Update to new hook interface. * config/pa/pa.c: Include opts.h. (pa_handle_option): Update to new hook interface. * config/pdp11/pdp11.c: Include opts.h. (pdp11_handle_option): Update to new hook interface. * config/rs6000/rs6000.c: Include opts.h. (rs6000_handle_option): Update to new hook interface. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c: Include opts.h. (rx_handle_option): Update to new hook interface. * config/s390/s390.c: Include opts.h. (s390_handle_option): Update to new hook interface. * config/score/score.c: Include opts.h. (score_handle_option): Update to new hook interface. * config/sh/sh.c: Include opts.h. (sh_handle_option): Update to new hook interface. * config/sparc/sparc.c: Include opts.h. (sparc_handle_option): Update to new hook interface. * config/v850/v850.c: Include opts.h. (v850_handle_option): Update to new hook interface. From-SVN: r171308
2011-03-22 23:23:02 +01:00
@var{decoded} specifies the option and its arguments. @var{opts} and
@var{opts_set} are the @code{gcc_options} structures to be used for
storing option state, and @var{loc} is the location at which the
option was passed (@code{UNKNOWN_LOCATION} except for options passed
via attributes).
config.gcc (extra_options): New variable for listing option files. * config.gcc (extra_options): New variable for listing option files. Add ${cpu_type}/${cpu_type}.opt to it if that file exists. * configure.ac (extra_opt_files): New AC_SUBST variable. (tm_file_list, tm_include_list): Include options.h first. * configure: Regenerate. * Makefile.in (extra_opt_files, ALL_OPT_FILES): New variables. (s-options): Use $(ALL_OPT_FILES) instead of $(lang_opt_files) (s-options-h): New rule. (options.h): Depend on it. (TEXI_GCCINT_FILES): Add options.texi. * hooks.h (hook_bool_size_t_constcharptr_int_true): Declare. * hooks.c (hook_bool_size_t_constcharptr_int_true): New function. * target.h (gcc_target): Add default_target_flags and handle_option. * target-def.h (TARGET_DEFAULT_TARGET_FLAGS) (TARGET_HANDLE_OPTION): New macros. (TARGET_INITIALIZER): Include them. * opt-functions.awk (opt_args, nth_arg): New functions. (switch_flags): Handle the "Target" flag. (var_args): Delete. (var_name): Use opt_args and nth_arg. (var_set, var_ref): Likewise. Handle "Mask" and "InverseMask". * opth-gen.awk: Declare target_flags. Declare MASK_* and TARGET_* macros for the "Mask" and "InverseMask" options. * opts.h (cl_var_cond): New enum. (cl_option): Replace the "has_set_value" and "set_value" fields with "var_cond" and "var_value". (CL_TARGET): New macro. (option_enabled, print_filtered_help): Declare. (decode_options): Move definition. * opts.c (handle_option): Search for the original option before removing any "no-" prefix. Handle CL_TARGET. Adjust for the new var_cond and var_value fields. Use targetm.handle_option to handle target options. (decode_options): Set target_flags to targetm.default_target_flags. (print_filtered_help): Make global. Handle CL_TARGET. (option_enabled): New function. * toplev.c (target_switches): Guard with #ifdef TARGET_SWITCHES. (display_target_options, set_target_switch, print_switch_values) (default_pch_valid_p): Guard uses of target_switches with #ifdef TARGET_SWITCHES. Also... (display_target_options): Display the CL_TARGET entries in cl_options. (set_target_option): Don't complain about the "" option when TARGET_SWITCHES is undefined. (print_switch_values): Use option_enabled. (default_pch_valid_p): Check cl_options[] when looking for something that has changed the value of target_flags. * c.opt: Remove documentation from top of file. * doc/gccint.texi: Add an "Options" chapter. Include options.texi. * doc/sourecebuild.texi: Refer to the new options documentation instead of c.opt. Document machine-specific .opt files. * doc/tm.texi (target_flags): Say that this variable is declared by options.h. (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Document. (TARGET_SWITCHES, TARGET_OPTIONS): Refer to the option files as an alternative. * doc/options.texi: New file. From-SVN: r96448
2005-03-14 21:18:43 +01:00
@end deftypefn
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
@deftypefn {C Target Hook} bool TARGET_HANDLE_C_OPTION (size_t @var{code}, const char *@var{arg}, int @var{value})
This target hook is called whenever the user specifies one of the
target-specific C language family options described by the @file{.opt}
definition files(@pxref{Options}). It has the opportunity to do some
option-specific processing and should return true if the option is
valid. The arguments are like for @code{TARGET_HANDLE_OPTION}. The
default definition does nothing but return false.
In general, you should use @code{TARGET_HANDLE_OPTION} to handle
options. However, if processing an option requires routines that are
only available in the C (and related language) front ends, then you
should use @code{TARGET_HANDLE_C_OPTION} instead.
@end deftypefn
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
@deftypefn {C Target Hook} tree TARGET_OBJC_CONSTRUCT_STRING_OBJECT (tree @var{string})
NS/CF String format syntax parsing. gcc: PR target/44981 * doc/extend.tex (format): Document NSString extension. (format_arg): Likewise. (Darwin Format Checks): New section. * doc/tm.texi: Document string object hooks (generated). * doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Rename. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. * target.def (objc_construct_string_object): Rename, amend documentation. (string_object_ref_type_p): New hook. (check_string_object_format_arg): New hook. * c-parser.c (c_parser_attributes): Allow objective-c class names as attribute identifiers. * config/darwin-c.c (darwin_cfstring_ref_p): New. (darwin_check_cfstring_format_arg): New. (darwin_additional_format_types): New. * config/darwin-protos.h (darwin_cfstring_ref_p) New. (darwin_check_cfstring_format_arg): New. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Renamed. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_N_FORMAT_TYPES): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. gcc/c-family: PR target/44981 * c-format.c (format_type): New type gcc_objc_string_format_type. (valid_stringptr_type_p): New. (handle_format_arg_attribute): Use valid_stringptr_type_p (). (check_format_string): Pass expected type, use valid_stringptr_type_p (), check that the format string types are consistent with the format specification. (decode_format_attr): Warn if NSString is used outside objective-c. (format_types_orig): Add NSString. (format_name): New. (format_flags): New. (check_format_arg): Handle format strings requiring an external parser. first_target_format_type: New variable. (handle_format_attribute): Set up first_target_format_type, pass the expected format arg string type to check_format_string(). * c-common.h (FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL): New flag. * stub-objc.c (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/objc: PR target/44981 * objc-act.c (objc_build_string_object): Amend for renamed hook. (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/testsuite: PR target/44981 * gcc.dg/darwin-cfstring-format-1.c: New. * gcc.dg/warn-nsstring.c: New. * objc.dg/fsf-nsstring-format-1.m: New. * obj-c++.dg/fsf-nsstring-format-1.mm: New. * obj-c++.dg/torture/strings/const-cfstring-1.mm: Update for darwin10 linker warning. From-SVN: r166398
2010-11-06 11:48:18 +01:00
Targets may provide a string object type that can be used within and between C, C++ and their respective Objective-C dialects. A string object might, for example, embed encoding and length information. These objects are considered opaque to the compiler and handled as references. An ideal implementation makes the composition of the string object match that of the Objective-C @code{NSString} (@code{NXString} for GNUStep), allowing efficient interworking between C-only and Objective-C code. If a target implements string objects then this hook should return a reference to such an object constructed from the normal `C' string representation provided in @var{string}. At present, the hook is used by Objective-C only, to obtain a common-format string object when the target provides one.
@end deftypefn
@deftypefn {C Target Hook} void TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE (const char *@var{classname})
Declare that Objective C class @var{classname} is referenced by the current TU.
@end deftypefn
@deftypefn {C Target Hook} void TARGET_OBJC_DECLARE_CLASS_DEFINITION (const char *@var{classname})
Declare that Objective C class @var{classname} is defined by the current TU.
@end deftypefn
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
@deftypefn {C Target Hook} bool TARGET_STRING_OBJECT_REF_TYPE_P (const_tree @var{stringref})
NS/CF String format syntax parsing. gcc: PR target/44981 * doc/extend.tex (format): Document NSString extension. (format_arg): Likewise. (Darwin Format Checks): New section. * doc/tm.texi: Document string object hooks (generated). * doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Rename. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. * target.def (objc_construct_string_object): Rename, amend documentation. (string_object_ref_type_p): New hook. (check_string_object_format_arg): New hook. * c-parser.c (c_parser_attributes): Allow objective-c class names as attribute identifiers. * config/darwin-c.c (darwin_cfstring_ref_p): New. (darwin_check_cfstring_format_arg): New. (darwin_additional_format_types): New. * config/darwin-protos.h (darwin_cfstring_ref_p) New. (darwin_check_cfstring_format_arg): New. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Renamed. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_N_FORMAT_TYPES): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. gcc/c-family: PR target/44981 * c-format.c (format_type): New type gcc_objc_string_format_type. (valid_stringptr_type_p): New. (handle_format_arg_attribute): Use valid_stringptr_type_p (). (check_format_string): Pass expected type, use valid_stringptr_type_p (), check that the format string types are consistent with the format specification. (decode_format_attr): Warn if NSString is used outside objective-c. (format_types_orig): Add NSString. (format_name): New. (format_flags): New. (check_format_arg): Handle format strings requiring an external parser. first_target_format_type: New variable. (handle_format_attribute): Set up first_target_format_type, pass the expected format arg string type to check_format_string(). * c-common.h (FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL): New flag. * stub-objc.c (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/objc: PR target/44981 * objc-act.c (objc_build_string_object): Amend for renamed hook. (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/testsuite: PR target/44981 * gcc.dg/darwin-cfstring-format-1.c: New. * gcc.dg/warn-nsstring.c: New. * objc.dg/fsf-nsstring-format-1.m: New. * obj-c++.dg/fsf-nsstring-format-1.mm: New. * obj-c++.dg/torture/strings/const-cfstring-1.mm: Update for darwin10 linker warning. From-SVN: r166398
2010-11-06 11:48:18 +01:00
If a target implements string objects then this hook should return @code{true} if @var{stringref} is a valid reference to such an object.
@end deftypefn
tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi.in: Document C target hooks as separate from general target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r172035
2011-04-06 13:08:17 +02:00
@deftypefn {C Target Hook} void TARGET_CHECK_STRING_OBJECT_FORMAT_ARG (tree @var{format_arg}, tree @var{args_list})
NS/CF String format syntax parsing. gcc: PR target/44981 * doc/extend.tex (format): Document NSString extension. (format_arg): Likewise. (Darwin Format Checks): New section. * doc/tm.texi: Document string object hooks (generated). * doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Rename. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. * target.def (objc_construct_string_object): Rename, amend documentation. (string_object_ref_type_p): New hook. (check_string_object_format_arg): New hook. * c-parser.c (c_parser_attributes): Allow objective-c class names as attribute identifiers. * config/darwin-c.c (darwin_cfstring_ref_p): New. (darwin_check_cfstring_format_arg): New. (darwin_additional_format_types): New. * config/darwin-protos.h (darwin_cfstring_ref_p) New. (darwin_check_cfstring_format_arg): New. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT) Renamed. (TARGET_STRING_OBJECT_REF_TYPE_P): New. (TARGET_N_FORMAT_TYPES): New. (TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): New. gcc/c-family: PR target/44981 * c-format.c (format_type): New type gcc_objc_string_format_type. (valid_stringptr_type_p): New. (handle_format_arg_attribute): Use valid_stringptr_type_p (). (check_format_string): Pass expected type, use valid_stringptr_type_p (), check that the format string types are consistent with the format specification. (decode_format_attr): Warn if NSString is used outside objective-c. (format_types_orig): Add NSString. (format_name): New. (format_flags): New. (check_format_arg): Handle format strings requiring an external parser. first_target_format_type: New variable. (handle_format_attribute): Set up first_target_format_type, pass the expected format arg string type to check_format_string(). * c-common.h (FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL): New flag. * stub-objc.c (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/objc: PR target/44981 * objc-act.c (objc_build_string_object): Amend for renamed hook. (objc_string_ref_type_p): New. (objc_check_format_arg): New. gcc/testsuite: PR target/44981 * gcc.dg/darwin-cfstring-format-1.c: New. * gcc.dg/warn-nsstring.c: New. * objc.dg/fsf-nsstring-format-1.m: New. * obj-c++.dg/fsf-nsstring-format-1.mm: New. * obj-c++.dg/torture/strings/const-cfstring-1.mm: Update for darwin10 linker warning. From-SVN: r166398
2010-11-06 11:48:18 +01:00
If a target implements string objects then this hook should should provide a facility to check the function arguments in @var{args_list} against the format specifiers in @var{format_arg} where the type of @var{format_arg} is one recognized as a valid string reference type.
CFStrings for Darwin. gcc: Based on the CFString implementation in FSF apple/trunk branch. * target.def (objc_construct_string): New Hook. * doc/tm.texi (objc_construct_string): Document. * doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING): New. * config/t-darwin: Amend build rules for darwin.o. * config/darwin.opt: Add cfstrings flags. * config/darwin-c.c: Define __CONSTANT_CFSTRINGS__. (darwin_objc_construct_string): New. * config/i386/darwin.h (SUBTARGET_INIT_BUILTINS): Define. * config/i386/i386.c (ix86_init_builtins): Add SUBTARGET_INIT_BUILTINS. * config/darwin-protos.h (darwin_init_cfstring_builtins): New prototype. (darwin_fold_builtin): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_objc_construct_string): Likewise. (darwin_cfstring_p): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS) Update for CFString. * config/darwin.c (darwin_running_cxx): New var. (machopic_select_section): Return cfstring_constant_object_section. (darwin_override_options): Set darwin_running_cxx. (add_builtin_field_decl): New. (darwin_init_cfstring_builtins): New. (darwin_build_constant_cfstring): New. (darwin_fold_builtin): New. (cfstring_hash): New. (cfstring_eq): New. (darwin_enter_string_into_cfstring_table): New. * config/darwin-sections.def (cfstring_constant_object_section): New. * config/darwin.h (TARGET_FOLD_BUILTIN): Define. (TARGET_OBJC_CONSTRUCT_STRING): Define. gcc/objc: Based on the CFString implementation in FSF apple/trunk branch. * objc/objc-act.c (objc_build_string_object): Handle CFStrings. From-SVN: r165820
2010-10-22 12:28:57 +02:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE (void)
This target function is similar to the hook @code{TARGET_OPTION_OVERRIDE}
but is called when the optimize level is changed via an attribute or
pragma or when it is reset at the end of the code affected by the
attribute or pragma. It is not called at the beginning of compilation
when @code{TARGET_OPTION_OVERRIDE} is called so if you want to perform these
actions then, you should have @code{TARGET_OPTION_OVERRIDE} call
@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}.
@end deftypefn
@defmac C_COMMON_OVERRIDE_OPTIONS
tm.texi.in (OVERRIDE_OPTIONS): Remove documentation. * doc/tm.texi.in (OVERRIDE_OPTIONS): Remove documentation. (C_COMMON_OVERRIDE_OPTIONS): Don't refer to OVERRIDE_OPTIONS. * doc/tm.texi: Regenerate. * system.h (OVERRIDE_OPTIONS): Poison. * target.def (override): Default to hook_void_void. * targhooks.c (default_target_option_override): Remove. * genmodes.c, machmode.def: Update comments mentioning OVERRIDE_OPTIONS. * config/alpha/alpha-modes.def: Update comment mentioning alpha_override_options. * config/alpha/alpha-protos.h (override_options): Remove. * config/alpha/alpha.c (override_options): Rename to alpha_option_override. Call SUBTARGET_OVERRIDE_OPTIONS. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/alpha/alpha.h (OVERRIDE_OPTIONS): Remove. * config/alpha/vms.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/arc/arc-protos.h (arc_init): Remove. * config/arc/arc.c (TARGET_OPTION_OVERRIDE): Define. (arc_init): Rename to arc_option_override. Make static. * config/arc/arc.h (ARC_EXTENSION_CPU): Correct comment. (OVERRIDE_OPTIONS): Remove. * config/arm/arm-protos.h (arm_override_options): Remove. * config/arm/arm.c (TARGET_OPTION_OVERRIDE): Define. (arm_override_options): Rename to arm_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/arm/arm.h (OVERRIDE_OPTIONS): Remove. * config/arm/arm.md: Update comment referring to arm_override_options. * config/arm/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/avr/avr-protos.h (avr_override_options): Remove. * config/avr/avr.c (TARGET_OPTION_OVERRIDE): Define. (avr_override_options): Rename to avr_option_override. Make static. * config/avr/avr.h (OVERRIDE_OPTIONS): Remove. * config/bfin/bfin-protos.h (override_options): Remove (twice). * config/bfin/bfin.c (override_options): Rename to bfin_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/bfin/bfin.h (OVERRIDE_OPTIONS): Remove. * config/cris/cris-protos.h (cris_override_options): Remove. * config/cris/cris.c (TARGET_OPTION_OVERRIDE): Define. (cris_override_options): Rename to cris_option_override. Make static. * config/cris/cris.h (OVERRIDE_OPTIONS): Remove. * config/frv/frv-protos.h (frv_override_options): Remove. * config/frv/frv.c (TARGET_OPTION_OVERRIDE): Define. (frv_override_options): Rename to frv_option_override. Make static. * config/frv/frv.h (OVERRIDE_OPTIONS): Remove. * config/h8300/h8300-protos.h (h8300_init_once): Remove. * config/h8300/h8300.c (h8300_init_once): Rename to h8300_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/h8300/h8300.h (OVERRIDE_OPTIONS): Remove. * config/i386/i386-protos.h (override_options): Remove. * config/i386/i386.c (override_options): Rename to ix86_option_override_internal. Make static. Comments referring to this function and callers changed. (ix86_option_override): New. (TARGET_OPTION_OVERRIDE): Define. * config/i386/i386.h (OVERRIDE_OPTION): Remove. * config/i386/linux64.h (DEFAULT_PCC_STRUCT_RETURN): Update comment. * config/ia64/ia64.c (ia64_file_start): Update comment referring to ia64_override_options. * config/iq2000/iq2000-protos.h (override_options): Remove. * config/iq2000/iq2000.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to iq2000_option_override. Make static. * config/iq2000/iq2000.h (OVERRIDE_OPTIONS): Remove. * config/lm32/lm32-protos.h (lm32_override_options): Remove. * config/lm32/lm32.c (TARGET_OPTION_OVERRIDE): Define. (lm32_override_options): Rename to lm32_option_override. Make static. * config/lm32/lm32.h (OVERRIDE_OPTIONS): Remove. * config/m32r/m32r.c (TARGET_OPTION_OVERRIDE): Define. (m32r_option_override): New. (m32r_init): Update comment. * config/m32r/m32r.h (OVERRIDE_OPTIONS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_override_options): Remove. * config/m68hc11/m68hc11.c (TARGET_OPTION_OVERRIDE): Define. (m68hc11_override_options): Rename to m68hc11_option_override. Make static. Return void. * config/m68hc11/m68hc11.h (OVERRIDE_OPTIONS): Remove. * config/m68k/m68k-protos.h (override_options): Remove. * config/m68k/m68k.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to m68k_option_override. Make static. * config/m68k/m68k.h (OVERRIDE_OPTIONS): Remove. * config/mcore/mcore-protos.h (mcore_override_options): Remove. * config/mcore/mcore.c (TARGET_OPTION_OVERRIDE): Define. (mcore_override_options): Rename to mcore_option_override. Make static. * config/mcore/mcore.h (OVERRIDE_OPTIONS): Remove. * config/mep/mep-protos.h (mep_override_options): Remove. * config/mep/mep.c (TARGET_OPTION_OVERRIDE): Define. (mep_override_options): Rename to mep_option_override. Make static. * config/mep/mep.h (OVERRIDE_OPTIONS): Remove. * config/mmix/mmix-protos.h (mmix_override_options): Remove. * config/mmix/mmix.c (TARGET_OPTION_OVERRIDE): Define. (mmix_override_options): Rename to mmix_option_override. Make static. * config/mmix/mmix.h (OVERRIDE_OPTIONS): Remove. * config/mn10300/mn10300-protos.h (mn10300_override_options): Remove. * config/mn10300/mn10300.c (TARGET_OPTION_OVERRIDE): Define. (mn10300_override_options): Rename to mn10300_option_override. Make static. * config/mn10300/mn10300.h (OVERRIDE_OPTIONS): Remove. * config/moxie/moxie-protos.h (moxie_override_options): Remove. * config/moxie/moxie.c (moxie_override_options): Rename to moxie_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/moxie/moxie.h (OVERRIDE_OPTIONS): Remove. * config/picochip/picochip-protos.h (picochip_override_options): Remove. Update comment referring to picochip_override_options. * config/picochip/picochip.c (TARGET_OPTION_OVERRIDE): Define. (picochip_override_options): Rename to picochip_option_override. Make static. Update comment and definition of TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE. * config/picochip/picochip.h (OVERRIDE_OPTIONS): Remove. * config/rs6000/aix43.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix51.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix52.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix53.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/aix61.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/rs6000/linux64.h (OPTION_TARGET_CPU_DEFAULT): Define instead of OVERRIDE_OPTIONS. * config/rs6000/rs6000-modes.def: Update comment referring to rs6000_override_options. * config/rs6000/rs6000-protos.h (rs6000_override_options): Remove. * config/rs6000/rs6000.c (TARGET_OPTION_OVERRIDE): Define. (rs6000_override_options): Rename to rs6000_option_override_internal. Make static. Commented referring to rs6000_override_options and OVERRIDE_OPTIONS updated. (rs6000_option_override): New. * config/rs6000/rs6000.h (OPTION_TARGET_CPU_DEFAULT): Define instead of OVERRIDE_OPTIONS. * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Update comment. * config/s390/s390-protos.h (override_options): Remove. * config/s390/s390.c (override_options): Rename to s390_option_override. Make static. (TARGET_OPTION_OVERRIDE): Define. * config/s390/s390.h (OVERRIDE_OPTIONS): Remove. * config/score/score-protos.h (score_override_options): Remove. * config/score/score.c (TARGET_OPTION_OVERRIDE): Define. (score_override_options): Rename to score_option_override. Make static. * config/score/score.h (OVERRIDE_OPTIONS): Remove. Update comment referring to override_options. * config/score/score3.c (score3_override_options): Rename to score3_option_override. * config/score/score3.h (score3_override_options): Rename to score3_option_override. * config/score/score7.c (score7_override_options): Rename to score7_option_override. * config/score/score7.h (score7_override_options): Rename to score7_option_override. * config/sh/sh.c: Update comments referring to OVERRIDE_OPTIONS. * config/sparc/sparc.c (TARGET_OPTION_OVERRIDE): Define. (sparc_override_options): Rename to sparc_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/sparc/sparc.h (OVERRIDE_OPTIONS): Remove. * config/sparc/vxworks.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/spu/spu-protos.h (spu_override_options): Remove. * config/spu/spu.c (TARGET_OPTION_OVERRIDE): Define. (spu_override_options): Rename to spu_option_override. Make static. * config/spu/spu.h (OVERRIDE_OPTIONS): Remove. * config/vax/elf.h (SUBTARGET_OVERRIDE_OPTIONS): Define instead of OVERRIDE_OPTIONS. * config/vax/vax-protos.h (override_options): Remove. * config/vax/vax.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to vax_option_override. Make static. Call SUBTARGET_OVERRIDE_OPTIONS. * config/vax/vax.h (OVERRIDE_OPTIONS): Remove. * config/vxworks.c: Update comment referring to OVERRIDE_OPTIONS. * config/vxworks.h: Update comment referring to OVERRIDE_OPTIONS. * config/xtensa/xtensa-protos.h (override_options): Remove. * config/xtensa/xtensa.c (TARGET_OPTION_OVERRIDE): Define. (override_options): Rename to xtensa_option_override. Make static. * config/xtensa/xtensa.h (OVERRIDE_OPTIONS): Remove. From-SVN: r164334
2010-09-16 13:59:39 +02:00
This is similar to the @code{TARGET_OPTION_OVERRIDE} hook
but is only used in the C
language frontends (C, Objective-C, C++, Objective-C++) and so can be
used to alter option flag variables which only exist in those
frontends.
@end defmac
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypevr {Common Target Hook} {const struct default_options *} TARGET_OPTION_OPTIMIZATION_TABLE
1996-09-25 01:21:45 +02:00
Some machines may desire to change what optimizations are performed for
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
various optimization levels. This variable, if defined, describes
options to enable at particular sets of optimization levels. These
options are processed once
1996-09-25 01:21:45 +02:00
just after the optimization level is determined and before the remainder
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
of the command options have been parsed, so may be overridden by other
options passed explicitly.
1996-09-25 01:21:45 +02:00
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
This processing is run once at program startup and when the optimization
options are changed via @code{#pragma GCC optimize} or by using the
@code{optimize} attribute.
target.h (enum opt_levels, [...]): New. * target.h (enum opt_levels, struct default_options): New. * target.def (handle_ofast): Remove hook. (target_option.optimization): Change to target_option.optimization_table. * doc/tm.texi.in (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (CAN_DEBUG_WITHOUT_FP): Remove. * doc/tm.texi: Regenerate. * opts.c (maybe_default_option, maybe_default_options, default_options_table): New. (default_options_optimization): Take extra parameters. Don't assert that global_options and global_options_set are in use. Use maybe_default_options. (decode_options): Pass extra parameters to default_options_optimization. * common.opt (falign-loops): Use value 0 with Var. (frerun-cse-after-loop, ftree-ter): Remove Init. * system.h (CAN_DEBUG_WITHOUT_FP, TARGET_HANDLE_OFAST, TARGET_OPTION_OPTIMIZATION): Remove. * targhooks.c (empty_optimization_table): New. * targhooks.h (empty_optimization_table): Declare. * toplev.c (process_options): Don't set flag_rerun_cse_after_loop. * config/alpha/alpha.c (alpha_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/alpha/alpha.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/arm/arm.c (arm_option_optimization: Change to arm_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/arm/arm.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/avr/avr.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/cris/cris.c (cris_option_optimization): Change to cris_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.c (crx_option_optimization): Change to crx_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/crx/crx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/fr30/fr30.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/frv/frv.c (frv_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/frv/frv.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/h8300/h8300.c (h8300_option_optimization): Change to h8300_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/h8300/h8300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/i386/i386.c (ix86_option_optimization): Change to ix86_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/ia64/ia64.c (ia64_option_optimization): Change to ia64_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/ia64/ia64.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define as initializer. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/iq2000/iq2000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/lm32/lm32.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/m32r/m32r.c (m32r_option_optimization): Change to m32r_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/m32r/m32r.h (SUBTARGET_OPTIMIZATION_OPTIONS, CAN_DEBUG_WITHOUT_FP): Remove. * config/mcore/mcore.c (mcore_option_optimization): Change to mcore_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.c (mep_option_optimization): Change to mep_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mep/mep.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/microblaze/microblaze.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mips/mips.c (mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mips/mips.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mmix/mmix.c (mmix_option_optimization): Change to mmix_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/mmix/mmix.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/mn10300/mn10300.c (mn10300_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/mn10300/mn10300.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pa/pa.c (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/pa/pa.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/pdp11/pdp11.c (pdp11_option_optimization): Change to pdp11_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/picochip/picochip.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rs6000/rs6000.c (rs6000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rs6000/rs6000.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/rx/rx.c (rx_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/rx/rx.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/s390/s390.c (s390_option_optimization): Change to s390_option_optimization_table. (s390_option_override): Update comment. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/s390/s390.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/score/score.c (score_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/score/score.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/sh/sh.c (sh_option_optimization): Change to sh_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. (sh_option_override): Set MASK_SAVE_ALL_TARGET_REGS here. (sh_option_override, expand_block_move, multcosts, find_barrier, barrier_align): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.h (CAN_DEBUG_WITHOUT_FP): Remove. (LOOP_ALIGN, TRAMPOLINE_ALIGNMENT, MOVE_BY_PIECES_P, STORE_BY_PIECES_P, SH_DYNAMIC_SHIFT_COST): Use optimize_size instead of TARGET_SMALLCODE. * config/sh/sh.opt (mspace): Make into an alias for -Os. * config/sparc/sparc.c (sparc_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/sparc/sparc.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): New. * config/stormy16/stormy16.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/v850/v850.c (v850_option_optimization): Change to v850_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/v850/v850.h (CAN_DEBUG_WITHOUT_FP): Remove. * config/xtensa/xtensa.c (xtensa_option_optimization): Change to xtensa_option_optimization_table. (TARGET_OPTION_OPTIMIZATION): Change to TARGET_OPTION_OPTIMIZATION_TABLE. * config/xtensa/xtensa.h (CAN_DEBUG_WITHOUT_FP): Remove. From-SVN: r165823
2010-10-22 14:14:45 +02:00
@end deftypevr
1996-09-25 01:21:45 +02:00
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypefn {Common Target Hook} void TARGET_OPTION_INIT_STRUCT (struct gcc_options *@var{opts})
target.def (target_option.init_struct): New hook. * target.def (target_option.init_struct): New hook. * doc/tm.texi.in (TARGET_OPTION_INIT_STRUCT): New @hook. * doc/tm.texi: Regenerate. * hooks.c (hook_void_gcc_optionsp): New. * hooks.h (hook_void_gcc_optionsp): Declare. * langhooks-def.h (lhd_init_options_struct): Remove. (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define to hook_void_gcc_optionsp. * langhooks.c (lhd_init_options_struct): Remove. * opts.c (init_options_struct): Also call targetm.target_option.init_struct. * config/i386/i386.c (ix86_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (ix86_option_optimization): Move some settings to ix86_option_init_struct. * config/pdp11/pdp11.c (pdp11_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (pdp11_option_optimization): Move some settings to pdp11_option_init_struct. * config/rs6000/rs6000.c (rs6000_option_optimization): Replace by rs6000_option_init_struct. Use options structure pointer. (TARGET_OPTION_OPTIMIZATION): Replace by TARGET_OPTION_INIT_STRUCT. * config/s390/s390.c (s390_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (s390_option_optimization): Don't set flag_asynchronous_unwind_tables here. * config/sh/sh.c (sh_option_init_struct, TARGET_OPTION_INIT_STRUCT): New. (sh_option_optimization): Don't set flag_finite_math_only here. * config/spu/spu.c (spu_option_optimization): Replace by spu_option_optimization. Use options structure pointer. (TARGET_OPTION_OPTIMIZATION): Replace by TARGET_OPTION_INIT_STRUCT. From-SVN: r165519
2010-10-15 21:19:05 +02:00
Set target-dependent initial values of fields in @var{opts}.
@end deftypefn
params.c: Include common/common-target.h. * params.c: Include common/common-target.h. Don't include tm.h. (lang_independent_params): Move from toplev.c. (global_init_params): New. * params.h (global_init_params): Declare. * target.def (default_params): Move to common-target.def. * toplev.c (lang_independent_options): Remove. (lang_independent_params): Move to params.c. (general_init): Use global_init_params. * common/common-target.def (option_default_params): Move from target.def. * common/config/ia64/ia64-common.c: Include params.h. (ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move from ia64.c. * common/config/rs6000/rs6000-common.c: Include params.h. (rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move from rs6000.c. * common/config/sh/sh-common.c: Include params.h. (sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move from sh.c. * common/config/spu/spu-common.c: Include params.h. (spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move from spu.c. * config/ia64/ia64.c (ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move to ia64-common.c. * config/rs6000/rs6000.c (rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move to rs6000-common.c. * config/sh/sh.c (sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move to sh-common.c. * config/spu/spu.c (spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): Move to spu-common.c. * Makefile.in (OBJS): Remove params.o. (OBJS-libcommon-target): Add params.o. (params.o, $(common_out_object_file)): Update dependencies. * doc/tm.texi: Regenerate. From-SVN: r175330
2011-06-23 12:41:42 +02:00
@deftypefn {Common Target Hook} void TARGET_OPTION_DEFAULT_PARAMS (void)
params.c (set_param_value_internal): New. * params.c (set_param_value_internal): New. (set_param_value): Use set_param_value_internal. (maybe_set_param_value, set_default_param_value): New. * params.h (PARAM_VALUE, PARAM_SET_P): Make into rvalues. (maybe_set_param_value, set_default_param_value): Declare. * config/arm/arm.c (arm_option_override): Use maybe_set_param_value. * config/i386/i386.c (ix86_option_override_internal): Use maybe_set_param_value. * config/ia64/ia64.c (ia64_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (ia64_option_optimization): Move some code to ia64_option_default_params. * config/picochip/picochip.c (picochip_option_override): Use maybe_set_param_value. * config/rs6000/rs6000.c (rs6000_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (rs6000_option_override_internal): Use maybe_set_param_value. (rs6000_option_optimization): Move some code to rs6000_option_default_params. * config/s390/s390.c (s390_option_override): Use maybe_set_param_value. * config/sh/sh.c (sh_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (sh_option_optimization): Move some code to sh_option_default_params. * config/sparc/sparc.c (sparc_option_override): Use maybe_set_param_value. * config/spu/spu.c (spu_option_default_params, TARGET_OPTION_DEFAULT_PARAMS): New. (spu_option_optimization): Move some code to spu_option_default_params. (spu_option_override): Use maybe_set_param_value. * doc/tm.texi.in (TARGET_OPTION_DEFAULT_PARAMS): New @hook. * doc/tm.texi: Regenerate. * ggc-common.c (init_ggc_heuristics): Use set_default_param_value. * opts.c (init_options_once): Use PARAM_VALUE not direct access to compiler_params. (default_options_optimization): Use maybe_set_param_value. (finish_options): Use maybe_set_param_value. * target.def (target_option.default_params): New hook. * toplev.c (general_init): Call targetm.target_option.default_params. From-SVN: r165303
2010-10-11 14:28:40 +02:00
Set target-dependent default values for @option{--param} settings, using calls to @code{set_default_param_value}.
@end deftypefn
tm.texi.in (SWITCHABLE_TARGET): Document. gcc/ * doc/tm.texi.in (SWITCHABLE_TARGET): Document. * doc/tm.texi: Regenerate. * Makefile.in (OBJS-common): Add target-globals.o. (gtype-desc.o): Depend on $(IPA_PROP_H), $(LTO_STREAMER_H) and target-globals.h. (target-globals.o): New rule. (GTFILES): Include $(srcdir)/target-globals.h. * defaults.h (SWITCHABLE_TARGET): Define. * gengtype.c (open_base_files): Add target-globals.h to the list of includes. * target-globals.h: New file. * target-globals.c: Likewise. * Makefile.in (target-globals.o): Depend on $(FLAGS_H). * flags.h (target_flag_state): New structure. (default_target_flag_state): Declare. (this_target_flag_state): Declare as a variable or define as a macro. (align_loops_log): Redefine as a macro. (align_loops_max_skip, align_jumps_log): Likewise. (align_jumps_max_skip, align_labels_log): Likewise. (align_labels_max_skip, align_functions_log): Likewise. * toplev.c (default_target_flag_state): New variable. (this_target_flag_state): New conditional variable. (align_loops_log): Delete. (align_loops_max_skip, align_jumps_log): Likewise. (align_jumps_max_skip, align_labels_log): Likewise. (align_labels_max_skip, align_functions_log): Likewise. * target-globals.h (this_target_flag_state): Declare. (target_globals): Add a flag_state field. (restore_target_globals): Copy the flag_state field to this_target_flag_state. * target-globals.c: Include flags.h. (default_target_globals): Initialize the flag_state field. (save_target_globals): Likewise. From-SVN: r162086
2010-07-12 20:53:01 +02:00
@defmac SWITCHABLE_TARGET
Some targets need to switch between substantially different subtargets
during compilation. For example, the MIPS target has one subtarget for
the traditional MIPS architecture and another for MIPS16. Source code
can switch between these two subarchitectures using the @code{mips16}
and @code{nomips16} attributes.
Such subtargets can differ in things like the set of available
registers, the set of available instructions, the costs of various
operations, and so on. GCC caches a lot of this type of information
in global variables, and recomputing them for each subtarget takes a
significant amount of time. The compiler therefore provides a facility
for maintaining several versions of the global variables and quickly
switching between them; see @file{target-globals.h} for details.
Define this macro to 1 if your target needs this facility. The default
is 0.
@end defmac
@deftypefn {Target Hook} bool TARGET_FLOAT_EXCEPTIONS_ROUNDING_SUPPORTED_P (void)
Returns true if the target supports IEEE 754 floating-point exceptions and rounding modes, false otherwise. This is intended to relate to the @code{float} and @code{double} types, but not necessarily @code{long double}. By default, returns true if the @code{adddf3} instruction pattern is available and false otherwise, on the assumption that hardware floating point supports exceptions and rounding modes but software floating point does not.
@end deftypefn
@node Per-Function Data
@section Defining data structures for per-function information.
@cindex per-function data
@cindex data structures
If the target needs to store information on a per-function basis, GCC
provides a macro and a couple of variables to allow this. Note, just
using statics to store the information is a bad idea, since GCC supports
nested functions, so you can be halfway through encoding one function
when another one comes along.
GCC defines a data structure called @code{struct function} which
contains all of the data specific to an individual function. This
structure contains a field called @code{machine} whose type is
@code{struct machine_function *}, which can be used by targets to point
to their own specific data.
If a target needs per-function specific data it should define the type
@code{struct machine_function} and also the macro @code{INIT_EXPANDERS}.
This macro should be used to initialize the function pointer
@code{init_machine_status}. This pointer is explained below.
One typical use of per-function, target specific data is to create an
RTX to hold the register containing the function's return address. This
RTX can then be used to implement the @code{__builtin_return_address}
function, for level 0.
Note---earlier implementations of GCC used a single data area to hold
all of the per-function information. Thus when processing of a nested
function began the old per-function data had to be pushed onto a
stack, and when the processing was finished, it had to be popped off the
stack. GCC used to provide function pointers called
@code{save_machine_status} and @code{restore_machine_status} to handle
the saving and restoring of the target specific information. Since the
single data area approach is no longer used, these pointers are no
longer supported.
@defmac INIT_EXPANDERS
Macro called to initialize any target specific information. This macro
is called once per function, before generation of any RTL has begun.
The intention of this macro is to allow the initialization of the
function pointer @code{init_machine_status}.
@end defmac
@deftypevar {void (*)(struct function *)} init_machine_status
If this function pointer is non-@code{NULL} it will be called once per
function, before function compilation starts, in order to allow the
target to perform any target specific initialization of the
@code{struct function} structure. It is intended that this would be
used to initialize the @code{machine} of that structure.
@code{struct machine_function} structures are expected to be freed by GC@.
Generally, any memory that they reference must be allocated by using
utils.c (init_gnat_to_gnu): Use typed GC allocation. gcc/ada: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. From-SVN: r160425
2010-06-08 09:25:24 +02:00
GC allocation, including the structure itself.
@end deftypevar
1996-09-25 01:21:45 +02:00
@node Storage Layout
@section Storage Layout
@cindex storage layout
Note that the definitions of the macros in this table which are sizes or
alignments measured in bits do not need to be constant. They can be C
expressions that refer to static variables, such as the @code{target_flags}.
@xref{Run-time Target}.
@defmac BITS_BIG_ENDIAN
1996-09-25 01:21:45 +02:00
Define this macro to have the value 1 if the most significant bit in a
byte has the lowest number; otherwise define it to have the value zero.
This means that bit-field instructions count from the most significant
bit. If the machine has no bit-field instructions, then this must still
be defined, but it doesn't matter which value it is defined to. This
macro need not be a constant.
This macro does not affect the way structure fields are packed into
bytes or words; that is controlled by @code{BYTES_BIG_ENDIAN}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BYTES_BIG_ENDIAN
1996-09-25 01:21:45 +02:00
Define this macro to have the value 1 if the most significant byte in a
word has the lowest number. This macro need not be a constant.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac WORDS_BIG_ENDIAN
1996-09-25 01:21:45 +02:00
Define this macro to have the value 1 if, in a multiword object, the
most significant word has the lowest number. This applies to both
memory locations and registers; see @code{REG_WORDS_BIG_ENDIAN} if the
order of words in memory is not the same as the order in registers. This
1996-09-25 01:21:45 +02:00
macro need not be a constant.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REG_WORDS_BIG_ENDIAN
On some machines, the order of words in a multiword object differs between
registers in memory. In such a situation, define this macro to describe
the order of words in a register. The macro @code{WORDS_BIG_ENDIAN} controls
the order of words in memory.
@end defmac
@defmac FLOAT_WORDS_BIG_ENDIAN
1996-09-25 01:21:45 +02:00
Define this macro to have the value 1 if @code{DFmode}, @code{XFmode} or
@code{TFmode} floating point numbers are stored in memory with the word
containing the sign bit at the lowest address; otherwise define it to
have the value 0. This macro need not be a constant.
You need not define this macro if the ordering is the same as for
multi-word integers.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BITS_PER_WORD
Number of bits in a word. If you do not define this macro, the default
is @code{BITS_PER_UNIT * UNITS_PER_WORD}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MAX_BITS_PER_WORD
1996-09-25 01:21:45 +02:00
Maximum number of bits in a word. If this is undefined, the default is
@code{BITS_PER_WORD}. Otherwise, it is the constant value that is the
largest value that @code{BITS_PER_WORD} can have at run-time.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac UNITS_PER_WORD
tree-complex.c (expand_vector_operation): New, extracted from expand_vector_operations_1. gcc: 2004-04-27 Paolo Bonzini <bonzini@gnu.org> * tree-complex.c (expand_vector_operation): New, extracted from expand_vector_operations_1. (tree_vec_extract): Build a NOP_EXPR. (expand_vec_parallel): Do not care about returning the correct type. (expand_vector_operations_1): Call expand_vector_operation. Build the VIEW_CONVERT_EXPR on the left side of MODIFY_EXPRs. * tree-complex.c (gate_expand_vector_operations): New. (pass_lower_vector_ssa): Use it. * tree-optimize.c (init_tree_optimization_passes): Include pass_lower_vector_ssa. * tree-vect-transform.c (vect_min_worthwhile_factor): New. (vectorizable_operation): Use it. * tree-vectorizer.c (get_vectype_for_scalar_type): Accept integer modes for the vector type. * defaults.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Do not cope with UNITS_PER_SIMD_WORD == 0. * tree-vectorizer.c (get_vectype_for_scalar_type): Check if the scalar type is not bigger than UNITS_PER_SIMD_WORD. (vectorize_loops): Do not check that UNITS_PER_SIMD_WORD > 0. * config/i386/i386.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. * config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise. * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise. * config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise. * config/alpha/alpha.h (UNITS_PER_SIMD_WORD): Remove. * config/bfin/bfin.h (UNITS_PER_SIMD_WORD): Remove. * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): Remove. * doc/tm.texi (UNITS_PER_WORD): Rephrase more accurately. (UNITS_PER_SIMD_WORD): New. gcc/testsuite: 2004-04-27 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/tree-ssa/gen-vect-11.c, gcc.dg/tree-ssa/gen-vect-11a.c, gcc.dg/tree-ssa/gen-vect-11b.c, gcc.dg/tree-ssa/gen-vect-11c.c, gcc.dg/tree-ssa/gen-vect-2.c, gcc.dg/tree-ssa/gen-vect-25.c, gcc.dg/tree-ssa/gen-vect-26.c, gcc.dg/tree-ssa/gen-vect-28.c, gcc.dg/tree-ssa/gen-vect-32.c: New. * gcc.dg/vect/vect-82.c, gcc.dg/vect/vect-83.c: Fix dg-final. * gcc.dg/vect/vect-82_64.c, gcc.dg/vect/vect-83_64.c: Remove xfail, don't run on PPC32. CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: tree-complex.c tree-optimize.c tree-vect-analyze.c defaults.h CVS: tree-vect-transform.c tree-vectorizer.c ChangeLog CVS: testsuite/ChangeLog config/alpha/alpha.h config/bfin/bfin.h CVS: config/i386/i386.h config/ia64/ia64.h config/mips/mips.h CVS: config/rs6000/rs6000.h CVS: config/sparc/sparc.h doc/tm.texi CVS: testsuite/gcc.dg/vect/vect-82.c CVS: testsuite/gcc.dg/vect/vect-82_64.c CVS: testsuite/gcc.dg/vect/vect-83.c CVS: testsuite/gcc.dg/vect/vect-83_64.c CVS: Added Files: CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11a.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11b.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-11c.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-2.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-25.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-26.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-28.c CVS: testsuite/gcc.dg/tree-ssa/gen-vect-32.c CVS: ---------------------------------------------------------------------- From-SVN: r98818
2005-04-27 11:12:05 +02:00
Number of storage units in a word; normally the size of a general-purpose
register, a power of two from 1 or 8.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MIN_UNITS_PER_WORD
1996-09-25 01:21:45 +02:00
Minimum number of units in a word. If this is undefined, the default is
@code{UNITS_PER_WORD}. Otherwise, it is the constant value that is the
smallest value that @code{UNITS_PER_WORD} can have at run-time.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac POINTER_SIZE
1996-09-25 01:21:45 +02:00
Width of a pointer, in bits. You must specify a value no wider than the
width of @code{Pmode}. If it is not equal to the width of @code{Pmode},
you must define @code{POINTERS_EXTEND_UNSIGNED}. If you do not specify
a value the default is @code{BITS_PER_WORD}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac POINTERS_EXTEND_UNSIGNED
A C expression that determines how pointers should be extended from
@code{ptr_mode} to either @code{Pmode} or @code{word_mode}. It is
greater than zero if pointers should be zero-extended, zero if they
should be sign-extended, and negative if some other sort of conversion
is needed. In the last case, the extension is done by the target's
@code{ptr_extend} instruction.
You need not define this macro if the @code{ptr_mode}, @code{Pmode}
and @code{word_mode} are all the same width.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PROMOTE_MODE (@var{m}, @var{unsignedp}, @var{type})
1996-09-25 01:21:45 +02:00
A macro to update @var{m} and @var{unsignedp} when an object whose type
is @var{type} and which has the specified mode and signedness is to be
stored in a register. This macro is only called when @var{type} is a
scalar type.
On most RISC machines, which only have operations that operate on a full
register, define this macro to set @var{m} to @code{word_mode} if
@var{m} is an integer mode narrower than @code{BITS_PER_WORD}. In most
cases, only integer modes should be widened because wider-precision
floating-point operations are usually more expensive than their narrower
counterparts.
For most machines, the macro definition does not change @var{unsignedp}.
However, some machines, have instructions that preferentially handle
either signed or unsigned quantities of certain modes. For example, on
the DEC Alpha, 32-bit loads from memory and 32-bit add instructions
sign-extend the result to 64 bits. On such machines, set
@var{unsignedp} according to which kind of extension is more efficient.
Do not define this macro if it would never modify @var{m}.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_PROMOTE_FUNCTION_MODE (const_tree @var{type}, machine_mode @var{mode}, int *@var{punsignedp}, const_tree @var{funtype}, int @var{for_return})
expr.c (store_constructor): Use promote_decl_mode. 2009-04-17 Paolo Bonzini <bonzini@gnu.org> * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * explow.c (promote_function_mode): Just call the target hook. * targhooks.c (default_promote_function_mode, default_promote_function_mode_always_promote): New. * targhooks.h (default_promote_function_mode, default_promote_function_mode_always_promote): Declare. * target.h (promote_function_args, promote_function_return): Remove. (promote_function_mode): New. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): New. (TARGET_CALLS): Adjust. * system.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, PROMOTE_FUNCTION_MODE): Poison. * config/s390/s390.h (PROMOTE_FUNCTION_MODE): Move... * config/s390/s390.c (s390_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sparc/sparc.h (PROMOTE_FUNCTION_MODE): Move... * config/sparc/sparc.c (sparc_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sh/sh-protos.h (sh_promote_function_mode): New. * config/sh/sh.c (sh_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/cris/cris.h (PROMOTE_FUNCTION_MODE): Move... * config/cris/cris.c (cris_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/mmix/mmix.h (PROMOTE_FUNCTION_MODE): Move... * config/mmix/mmix.c (mmix_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Move... * config/arm/arm.c (arm_promote_function_mode): ... here, without complex type handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/pa/pa.c (pa_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/alpha/alpha.c (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): Define equivalently. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/picochip/picochip.c: Likewise. * config/arc/arc.c: Likewise. * config/mcore/mcore.c: Likewise. * config/score/score.c: Likewise. * config/mips/mips.c: Likewise. * config/bfin/bfin.c: Likewise. * config/ia64/ia64.c: Likewise (disabled though). * config/frv/frv.h: Remove pointless remark. * doc/tm.texi (PROMOTE_FUNCTION_MODE, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Consolidate into... (TARGET_PROMOTE_FUNCTION_MODE): ... this. From-SVN: r150336
2009-08-02 00:03:34 +02:00
Like @code{PROMOTE_MODE}, but it is applied to outgoing function arguments or
function return values. The target hook should return the new mode
and possibly change @code{*@var{punsignedp}} if the promotion should
change signedness. This function is called only for scalar @emph{or
pointer} types.
@var{for_return} allows to distinguish the promotion of arguments and
return values. If it is @code{1}, a return value is being promoted and
@code{TARGET_FUNCTION_VALUE} must perform the same promotions done here.
If it is @code{2}, the returned mode should be that of the register in
which an incoming parameter is copied, or the outgoing result is computed;
then the hook should return the same mode as @code{promote_mode}, though
the signedness may be different.
@var{type} can be NULL when promoting function arguments of libcalls.
expr.c (store_constructor): Use promote_decl_mode. 2009-04-17 Paolo Bonzini <bonzini@gnu.org> * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * expr.c (store_constructor): Use promote_decl_mode. Remove now write-only variable unsignedp. (expand_expr_real_1): Use promote_decl_mode. * expr.h (promote_function_mode, promote_decl_mode): New. (promote_mode): Remove last argument. * function.c (assign_temp): Drop last argument of promote_mode. (assign_parm_find_data_types): Use promote_function_mode. (assign_parm_setup_reg): Likewise. (expand_function_end): Use promote_function_mode. * calls.c (initialize_argument_information): Use promote_function_mode. (precompute_arguments): Use promote_mode instead of checking if only PROMOTE_FUNCTION_MODE is defined. (expand_call): When making sibcall decisions, use promote_function_mode. Below, remove an if for targetm.calls.promote_function_return and and use promote_function_mode. (emit_library_call_value_1): Use promote_function_mode, fix bug where promote_mode was passed FOR_CALL == 0 for a return value in an assertion. * cfgexpand.c (expand_one_register_var): Use promote_decl_mode. * explow.c (promote_function_mode, promote_decl_mode): New. (promote_mode): Keep only the FOR_CALL == 0 case. * combine.c (setup_incoming_promotion): Remove test of promote_function_args. Use promote_function_mode. * stmt.c (expand_value_return): Use promote_decl_mode. (expand_decl): Use promote_decl_mode. * explow.c (promote_function_mode): Just call the target hook. * targhooks.c (default_promote_function_mode, default_promote_function_mode_always_promote): New. * targhooks.h (default_promote_function_mode, default_promote_function_mode_always_promote): Declare. * target.h (promote_function_args, promote_function_return): Remove. (promote_function_mode): New. * target-def.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): New. (TARGET_CALLS): Adjust. * system.h (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, PROMOTE_FUNCTION_MODE): Poison. * config/s390/s390.h (PROMOTE_FUNCTION_MODE): Move... * config/s390/s390.c (s390_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sparc/sparc.h (PROMOTE_FUNCTION_MODE): Move... * config/sparc/sparc.c (sparc_promote_function_mode): ... here, with pointer handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/sh/sh-protos.h (sh_promote_function_mode): New. * config/sh/sh.c (sh_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/cris/cris.h (PROMOTE_FUNCTION_MODE): Move... * config/cris/cris.c (cris_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/mmix/mmix.h (PROMOTE_FUNCTION_MODE): Move... * config/mmix/mmix.c (mmix_promote_function_mode): ... here. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS): Remove. * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Move... * config/arm/arm.c (arm_promote_function_mode): ... here, without complex type handling. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/pa/pa.c (pa_promote_function_mode): New. (TARGET_PROMOTE_FUNCTION_MODE): Define. (TARGET_PROMOTE_FUNCTION_RETURN): Remove. * config/alpha/alpha.c (TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Remove. (TARGET_PROMOTE_FUNCTION_MODE): Define equivalently. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/picochip/picochip.c: Likewise. * config/arc/arc.c: Likewise. * config/mcore/mcore.c: Likewise. * config/score/score.c: Likewise. * config/mips/mips.c: Likewise. * config/bfin/bfin.c: Likewise. * config/ia64/ia64.c: Likewise (disabled though). * config/frv/frv.h: Remove pointless remark. * doc/tm.texi (PROMOTE_FUNCTION_MODE, TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN): Consolidate into... (TARGET_PROMOTE_FUNCTION_MODE): ... this. From-SVN: r150336
2009-08-02 00:03:34 +02:00
The default is to not promote arguments and return values. You can
also define the hook to @code{default_promote_function_mode_always_promote}
if you would like to apply the same rules given by @code{PROMOTE_MODE}.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac PARM_BOUNDARY
1996-09-25 01:21:45 +02:00
Normal alignment required for function parameters on the stack, in
bits. All stack parameters receive at least this much alignment
regardless of data type. On most machines, this is the same as the
size of an integer.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_BOUNDARY
Define this macro to the minimum alignment enforced by hardware for the
stack pointer on this machine. The definition is a C expression for the
desired alignment (measured in bits). This value is used as a default
if @code{PREFERRED_STACK_BOUNDARY} is not defined. On most machines,
this should be the same as @code{PARM_BOUNDARY}.
@end defmac
@defmac PREFERRED_STACK_BOUNDARY
Define this macro if you wish to preserve a certain alignment for the
stack pointer, greater than what the hardware enforces. The definition
is a C expression for the desired alignment (measured in bits). This
macro must evaluate to a value equal to or larger than
@code{STACK_BOUNDARY}.
@end defmac
1996-09-25 01:21:45 +02:00
[multiple changes] 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * builtins.c (expand_builtin_setjmp_receiver): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (expand_builtin_apply_args_1): Likewise. (expand_builtin_longjmp): Need DRAP for stack alignment. (expand_builtin_apply): Likewise. * caller-save.c (setup_save_areas): Call assign_stack_local_1 instead of assign_stack_local to allow alignment reduction. * calls.c (emit_call_1): Need DRAP for stack alignment if return pops. (expand_call): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * stmt.c (expand_nl_goto_receiver): Likewise. * cfgexpand.c (get_decl_align_unit): Estimate stack variable alignment and store to stack_alignment_estimated and max_used_stack_slot_alignment. (expand_one_var): Likewise. (expand_stack_alignment): New function. (tree_expand_cfg): Initialize max_used_stack_slot_alignment and stack_alignment_estimated fields in rtl_data. Call expand_stack_alignment at end. * defaults.h (INCOMING_STACK_BOUNDARY): New. (MAX_STACK_ALIGNMENT): Likewise. (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise. (SUPPORTS_STACK_ALIGNMENT): Likewise. * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for stack alignment when generating virtual registers. * function.c (assign_stack_local): Renamed to ... (assign_stack_local_1): This. Add a parameter to indicate if it is OK to reduce alignment. (assign_stack_local): Use it. (instantiate_new_reg): Instantiate virtual incoming args rtx to vDRAP if stack realignment and DRAP is needed. (assign_parms): Collect parameter/return type alignment and contribute to stack_alignment_estimated. (locate_and_pad_parm): Likewise. (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * function.h (rtl_data): Add new field drap_reg, max_used_stack_slot_alignment, stack_alignment_estimated, stack_realign_needed, need_drap, stack_realign_processed and stack_realign_finalized. (stack_realign_fp): New macro. (stack_realign_drap): Likewise. * global.c (compute_regsets): Frame pointer is needed when stack is realigned. Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * reload1.c (update_eliminables): Frame pointer is needed when stack is realigned. (init_elim_table): Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * rtl.h (assign_stack_local_1): Declare new funtion. * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New. (TARGET_GET_DRAP_RTX): Likewise. (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and TARGET_GET_DRAP_RTX. * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx. * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace STACK_BOUNDARY with MAX_STACK_ALIGNMENT. 2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com> H.J. Lu <hongjiu.lu@intel.com> * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg, vdrap_reg, stack_realign and drap_reg_saved. (add_cfi): Don't allow redefining CFA when DRAP is used. (reg_save): Handle stack alignment. (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack alignment. Don't generate DWARF information for (set fp sp) when DRAP is used. (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg to INVALID_REGNUM. (int_loc_descriptor): Move prototype forward. Also define if DWARF2_UNWIND_INFO is true. (output_cfa_loc): Handle DW_CFA_expression. (build_cfa_aligned_loc): New. (based_loc_descr): Update assert for stack realign. For local variables, use sp+offset when stack is aligned without drap and fp+offset when stack is aligned with drap. For arguments, use cfa+offset when drap is used to align stack. 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_force_align_arg_pointer_string): Break long line. (ix86_gen_andsp): New. (ix86_user_incoming_stack_boundary): Likewise. (ix86_default_incoming_stack_boundary): Likewise. (ix86_incoming_stack_boundary): Likewise. (ix86_can_eliminate): Likewise. (find_drap_reg): Likewise. (ix86_update_stack_boundary): Likewise. (ix86_get_drap_rtx): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): Likewise. (TARGET_GET_DRAP_RTX): Likewise. (override_options): Overide option value for new options. (ix86_function_ok_for_sibcall): Remove check for force_align_arg_pointer. (ix86_handle_cconv_attribute): Likewise. (ix86_function_regparm): Likewise. (setup_incoming_varargs_64): Don't set stack_alignment_needed here. (ix86_va_start): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (ix86_select_alt_pic_regnum): Check DRAP register. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_compute_frame_layout): Compute frame layout wrt stack realignment. (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx. (ix86_expand_prologue): Decide if stack realignment is needed and generate prologue code accordingly. (ix86_expand_epilogue): Generate epilogue code wrt stack realignment is really needed or not. * config/i386/i386.h (MAIN_STACK_BOUNDARY): New. (ABI_STACK_BOUNDARY): Likewise. (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise. (STACK_REALIGN_DEFAULT): Likewise. (INCOMING_STACK_BOUNDARY): Likewise. (MAX_STACK_ALIGNMENT): Likewise. (ix86_incoming_stack_boundary): Likewise. (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed. (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG. (CAN_ELIMINATE): Defined with ix86_can_eliminate. (machine_function): Remove force_align_arg_pointer. * config/i386/i386.md (BX_REG): New. (R13_REG): Likewise. * config/i386/i386.opt (mforce_drap): New. (mincoming-stack-boundary): Likewise. (mstackrealign): Add Init(-1). * config/i386/i386-protos.h (ix86_can_eliminate): New 2008-07-30 H.J. Lu <hongjiu.lu@intel.com> * doc/extend.texi: Update force_align_arg_pointer. * doc/invoke.texi: Document -mincoming-stack-boundary. Update -mstackrealign. * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro. (INCOMING_STACK_BOUNDARY): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): New target hook. (TARGET_GET_DRAP_RTX): Likewise. From-SVN: r138335
2008-07-30 21:20:43 +02:00
@defmac INCOMING_STACK_BOUNDARY
Define this macro if the incoming stack boundary may be different
from @code{PREFERRED_STACK_BOUNDARY}. This macro must evaluate
to a value equal to or larger than @code{STACK_BOUNDARY}.
@end defmac
@defmac FUNCTION_BOUNDARY
1996-09-25 01:21:45 +02:00
Alignment required for a function entry point, in bits.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BIGGEST_ALIGNMENT
Biggest alignment that any data type can require on this machine, in
bits. Note that this is not the biggest alignment that is supported,
just the biggest alignment that, when violated, may cause a fault.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MALLOC_ABI_ALIGNMENT
Alignment, in bits, a C conformant malloc implementation has to
provide. If not defined, the default value is @code{BITS_PER_WORD}.
@end defmac
@defmac ATTRIBUTE_ALIGNED_VALUE
Alignment used by the @code{__attribute__ ((aligned))} construct. If
not defined, the default value is @code{BIGGEST_ALIGNMENT}.
@end defmac
@defmac MINIMUM_ATOMIC_ALIGNMENT
1997-08-11 17:56:58 +02:00
If defined, the smallest alignment, in bits, that can be given to an
object that can be referenced in one operation, without disturbing any
nearby object. Normally, this is @code{BITS_PER_UNIT}, but may be larger
on machines that don't have byte or half-word store operations.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac BIGGEST_FIELD_ALIGNMENT
tree.h (TYPE_USER_ALIGN, [...]): Define. * tree.h (TYPE_USER_ALIGN, DECL_USER_ALIGN): Define. (struct tree_type, struct tree_decl): Add user_align member. * stor-layout.c (layout_decl): Set DECL_USER_ALIGN. (place_union_field): If BIGGEST_FIELD_ALIGNMENT is defined and DECL_USER_ALIGN 0, cap alignment to this value. (place_field): Likewise. (finalize_type_size): Set TYPE_USER_ALIGN. (layout_type): Likewise. (initialize_sizetypes): Likewise. * c-common.c (decl_attributes): Set TYPE_USER_ALIGN resp. DECL_USER_ALIGN to 1. * c-decl.c (duplicate_decls): Set DECL_USER_ALIGN. (xfer_tag): Set TYPE_USER_ALIGN. (finish_struct): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (finish_enum): Likewise. * stmt.c (expand_decl): Set DECL_USER_ALIGN. (expand_anon_union_decl): Likewise. * tree.c (make_node): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (build_index_type): Set TYPE_USER_ALIGN. (build_range_type): Likewise. (build_common_tree_nodes_2): Likewise. * tm.texi (BIGGEST_FIELD_ALIGNMENT): Document the changed meaning. ch/: * decl.c (init_decl_processing): Set TYPE_USER_ALIGN. (layout_enum): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. * typeck.c (layout_chill_range_type): Set TYPE_USER_ALIGN. (apply_chill_field_layout): Set DECL_USER_ALIGN. (layout_chill_struct_type): Set TYPE_USER_ALIGN. cp/: * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. (check_bitfield_decl, check_field_decl): Likewise. (build_vtbl_or_vbase_field, build_base_field): Likewise. (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. (xfer_tag, finish_enum): Likewise. * decl2.c (finish_builtin_type): Likewise. * init.c (init_init_processing): Likewise. * pt.c (instantiate_class_template): Likewise. * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. * cp-tree.h (struct lang_type): Add user_align member. (CLASSTYPE_USER_ALIGN): Define. f/: * com.c (ffecom_transform_common_): Set DECL_USER_ALIGN. (ffecom_transform_equiv_, ffecom_decl_field): Likewise. (ffecom_init_0): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (duplicate_decls): Set DECL_USER_ALIGN. java/: * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN. * parse.y (java_complete_class): Set DECL_USER_ALIGN. * parse.c: Rebuilt. From-SVN: r34541
2000-06-14 07:30:09 +02:00
Biggest alignment that any structure or union field can require on this
machine, in bits. If defined, this overrides @code{BIGGEST_ALIGNMENT} for
structure and union fields only, unless the field alignment has been set
by the @code{__attribute__ ((aligned (@var{n})))} construct.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ADJUST_FIELD_ALIGN (@var{field}, @var{computed})
1996-09-25 01:21:45 +02:00
An expression for the alignment of a structure field @var{field} if the
alignment computed in the usual way (including applying of
@code{BIGGEST_ALIGNMENT} and @code{BIGGEST_FIELD_ALIGNMENT} to the
alignment) is @var{computed}. It overrides alignment only if the
field alignment has not been set by the
@code{__attribute__ ((aligned (@var{n})))} construct.
@end defmac
1996-09-25 01:21:45 +02:00
[multiple changes] 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * builtins.c (expand_builtin_setjmp_receiver): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (expand_builtin_apply_args_1): Likewise. (expand_builtin_longjmp): Need DRAP for stack alignment. (expand_builtin_apply): Likewise. * caller-save.c (setup_save_areas): Call assign_stack_local_1 instead of assign_stack_local to allow alignment reduction. * calls.c (emit_call_1): Need DRAP for stack alignment if return pops. (expand_call): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * stmt.c (expand_nl_goto_receiver): Likewise. * cfgexpand.c (get_decl_align_unit): Estimate stack variable alignment and store to stack_alignment_estimated and max_used_stack_slot_alignment. (expand_one_var): Likewise. (expand_stack_alignment): New function. (tree_expand_cfg): Initialize max_used_stack_slot_alignment and stack_alignment_estimated fields in rtl_data. Call expand_stack_alignment at end. * defaults.h (INCOMING_STACK_BOUNDARY): New. (MAX_STACK_ALIGNMENT): Likewise. (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise. (SUPPORTS_STACK_ALIGNMENT): Likewise. * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for stack alignment when generating virtual registers. * function.c (assign_stack_local): Renamed to ... (assign_stack_local_1): This. Add a parameter to indicate if it is OK to reduce alignment. (assign_stack_local): Use it. (instantiate_new_reg): Instantiate virtual incoming args rtx to vDRAP if stack realignment and DRAP is needed. (assign_parms): Collect parameter/return type alignment and contribute to stack_alignment_estimated. (locate_and_pad_parm): Likewise. (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * function.h (rtl_data): Add new field drap_reg, max_used_stack_slot_alignment, stack_alignment_estimated, stack_realign_needed, need_drap, stack_realign_processed and stack_realign_finalized. (stack_realign_fp): New macro. (stack_realign_drap): Likewise. * global.c (compute_regsets): Frame pointer is needed when stack is realigned. Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * reload1.c (update_eliminables): Frame pointer is needed when stack is realigned. (init_elim_table): Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * rtl.h (assign_stack_local_1): Declare new funtion. * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New. (TARGET_GET_DRAP_RTX): Likewise. (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and TARGET_GET_DRAP_RTX. * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx. * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace STACK_BOUNDARY with MAX_STACK_ALIGNMENT. 2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com> H.J. Lu <hongjiu.lu@intel.com> * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg, vdrap_reg, stack_realign and drap_reg_saved. (add_cfi): Don't allow redefining CFA when DRAP is used. (reg_save): Handle stack alignment. (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack alignment. Don't generate DWARF information for (set fp sp) when DRAP is used. (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg to INVALID_REGNUM. (int_loc_descriptor): Move prototype forward. Also define if DWARF2_UNWIND_INFO is true. (output_cfa_loc): Handle DW_CFA_expression. (build_cfa_aligned_loc): New. (based_loc_descr): Update assert for stack realign. For local variables, use sp+offset when stack is aligned without drap and fp+offset when stack is aligned with drap. For arguments, use cfa+offset when drap is used to align stack. 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_force_align_arg_pointer_string): Break long line. (ix86_gen_andsp): New. (ix86_user_incoming_stack_boundary): Likewise. (ix86_default_incoming_stack_boundary): Likewise. (ix86_incoming_stack_boundary): Likewise. (ix86_can_eliminate): Likewise. (find_drap_reg): Likewise. (ix86_update_stack_boundary): Likewise. (ix86_get_drap_rtx): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): Likewise. (TARGET_GET_DRAP_RTX): Likewise. (override_options): Overide option value for new options. (ix86_function_ok_for_sibcall): Remove check for force_align_arg_pointer. (ix86_handle_cconv_attribute): Likewise. (ix86_function_regparm): Likewise. (setup_incoming_varargs_64): Don't set stack_alignment_needed here. (ix86_va_start): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (ix86_select_alt_pic_regnum): Check DRAP register. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_compute_frame_layout): Compute frame layout wrt stack realignment. (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx. (ix86_expand_prologue): Decide if stack realignment is needed and generate prologue code accordingly. (ix86_expand_epilogue): Generate epilogue code wrt stack realignment is really needed or not. * config/i386/i386.h (MAIN_STACK_BOUNDARY): New. (ABI_STACK_BOUNDARY): Likewise. (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise. (STACK_REALIGN_DEFAULT): Likewise. (INCOMING_STACK_BOUNDARY): Likewise. (MAX_STACK_ALIGNMENT): Likewise. (ix86_incoming_stack_boundary): Likewise. (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed. (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG. (CAN_ELIMINATE): Defined with ix86_can_eliminate. (machine_function): Remove force_align_arg_pointer. * config/i386/i386.md (BX_REG): New. (R13_REG): Likewise. * config/i386/i386.opt (mforce_drap): New. (mincoming-stack-boundary): Likewise. (mstackrealign): Add Init(-1). * config/i386/i386-protos.h (ix86_can_eliminate): New 2008-07-30 H.J. Lu <hongjiu.lu@intel.com> * doc/extend.texi: Update force_align_arg_pointer. * doc/invoke.texi: Document -mincoming-stack-boundary. Update -mstackrealign. * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro. (INCOMING_STACK_BOUNDARY): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): New target hook. (TARGET_GET_DRAP_RTX): Likewise. From-SVN: r138335
2008-07-30 21:20:43 +02:00
@defmac MAX_STACK_ALIGNMENT
Biggest stack alignment guaranteed by the backend. Use this macro
to specify the maximum alignment of a variable on stack.
If not defined, the default value is @code{STACK_BOUNDARY}.
@c FIXME: The default should be @code{PREFERRED_STACK_BOUNDARY}.
@c But the fix for PR 32893 indicates that we can only guarantee
@c maximum stack alignment on stack up to @code{STACK_BOUNDARY}, not
@c @code{PREFERRED_STACK_BOUNDARY}, if stack alignment isn't supported.
@end defmac
@defmac MAX_OFILE_ALIGNMENT
1996-09-25 01:21:45 +02:00
Biggest alignment supported by the object file format of this machine.
Use this macro to limit the alignment which can be specified using the
@code{__attribute__ ((aligned (@var{n})))} construct. If not defined,
the default value is @code{BIGGEST_ALIGNMENT}.
On systems that use ELF, the default (in @file{config/elfos.h}) is
the largest supported 32-bit ELF section alignment representable on
system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. 2014-05-23 Richard Biener <rguenther@suse.de> * system.h: Define __STDC_FORMAT_MACROS before including inttypes.h. * hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT, HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC, HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED, HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX, HOST_WIDEST_INT_C): Remove. (PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define if C99 inttypes.h is not available. * coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t. * gcov-io.h (gcov_type, gcov_type_unsigned): Likewise. * gcov-io.c (gcov_histo_index): Drop non-64bit hwi case. * cfgloop.h (struct niter_desc): Use uint64_t for niter field. * bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters. (struct output_info): Likewise. (print_statistics): Adjust. (dump_bitmap_statistics): Likewise. * bt-load.c (migrate_btr_defs): Print with PRId64. * cfg.c (dump_edge_info, dump_bb_info): Likewise. (MAX_SAFE_MULTIPLIER): Adjust. * cfghooks.c (dump_bb_for_graph): Print with PRId64. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee, dump_cgraph_node): Likewise. * final.c (dump_basic_block_info): Likewise. * gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise. * gcov.c (format_gcov): Likewise. * ipa-cp.c (good_cloning_opportunity_p): Likewise. Use int64_t for calculation. (get_clone_agg_value): Use HOST_WIDE_INT for offset. * ipa-inline.c (compute_max_insns): Use int64_t for calcuation. (inline_small_functions, dump_overall_stats, dump_inline_stats): Use PRId64 for dumping. * ipa-profile.c (dump_histogram, ipa_profile): Likewise. * ira-color.c (struct allocno_hard_regs): Use int64_t for cost. (add_allocno_hard_regs): Adjust. * loop-doloop.c (doloop_modify): Print using PRId64. * loop-iv.c (inverse): Compute in uint64_t. (determine_max_iter, iv_number_of_iterations): Likewise. * loop-unroll.c (decide_peel_completely, decide_peel_simple): Print using PRId64. * lto-streamer-out.c (write_symbol): Use uint64_t. * mcf.c (CAP_INFINITY): Use int64_t maximum. (dump_fixup_edge, create_fixup_graph, cancel_negative_cycle, find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64. * modulo-sched.c (const_iteration_count): Use int64_t. (sms_schedule): Dump using PRId64. * predict.c (dump_prediction): Likewise. * pretty-print.h (pp_widest_integer): Remove. * profile.c (get_working_sets, is_edge_inconsistent, is_inconsistent, read_profile_edge_counts): Dump using PRId64. * tree-pretty-print.c (pp_double_int): Remove case handling HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT. * tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t and adjust users. (pass_optimize_bswap::execute): Remove restriction on hosts. * tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT. * tree-streamer-out.c (streamer_write_tree_header): Likewise. * tree.c (widest_int_cst_value): Remove. * tree.h (widest_int_cst_value): Likewise. * value-prof.c (dump_histogram_value): Print using PRId64. * gengtype.c (main): Also inject int64_t. * ggc-page.c (struct max_alignment): Use int64_t. * alloc-pool.c (struct allocation_object_def): Likewise. * ira-conflicts.c (build_conflict_bit_table): Use uint64_t for computation. * doc/tm.texi.in: Remove reference to HOST_WIDEST_INT. * doc/tm.texi: Regenerated. * gengtype-lex.l (IWORD): Handle [u]int64_t. * config/sh/sh.c (expand_cbranchdi4): Use gcov_type. * config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value, mmix_output_register_setting): Use [u]int64_t in prototypes. * config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting, mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str, mmix_output_octa, mmix_output_shifted_value): Adjust. (mmix_intval): Adjust. Remove unreachable case. * config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use int64_t. lto/ * lto.c (lto_parse_hex): Use int64_t. (lto_resolution_read): Likewise. From-SVN: r210931
2014-05-26 12:42:43 +02:00
a 32-bit host e.g. @samp{(((uint64_t) 1 << 28) * 8)}.
On 32-bit ELF the largest supported section alignment in bits is
@samp{(0x80000000 * 8)}, but this is not representable on 32-bit hosts.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DATA_ALIGNMENT (@var{type}, @var{basic-align})
If defined, a C expression to compute the alignment for a variable in
the static store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
1996-09-25 01:21:45 +02:00
macro is used instead of that alignment to align the object.
If this macro is not defined, then @var{basic-align} is used.
@findex strcpy
One use of this macro is to increase alignment of medium-size data to
make it all fit in fewer cache lines. Another is to cause character
arrays to be word-aligned so that @code{strcpy} calls that copy
constants to character arrays can be done inline.
@end defmac
1996-09-25 01:21:45 +02:00
re PR target/56564 (movdqa on possibly-8-byte-aligned struct with -O3) PR target/56564 * varasm.c (align_variable): Don't use DATA_ALIGNMENT or CONSTANT_ALIGNMENT if !decl_binds_to_current_def_p (decl). Use DATA_ABI_ALIGNMENT for that case instead if defined. (get_variable_align): New function. (get_variable_section, emit_bss, emit_common, assemble_variable_contents, place_block_symbol): Use get_variable_align instead of DECL_ALIGN. (assemble_noswitch_variable): Add align argument, use it instead of DECL_ALIGN. (assemble_variable): Adjust caller. Use get_variable_align instead of DECL_ALIGN. * config/i386/i386.h (DATA_ALIGNMENT): Adjust x86_data_alignment caller. (DATA_ABI_ALIGNMENT): Define. * config/i386/i386-protos.h (x86_data_alignment): Adjust prototype. * config/i386/i386.c (x86_data_alignment): Add opt argument. If opt is false, only return the psABI mandated alignment increase. * config/c6x/c6x.h (DATA_ALIGNMENT): Renamed to... (DATA_ABI_ALIGNMENT): ... this. * config/mmix/mmix.h (DATA_ALIGNMENT): Renamed to... (DATA_ABI_ALIGNMENT): ... this. * config/mmix/mmix.c (mmix_data_alignment): Adjust function comment. * config/s390/s390.h (DATA_ALIGNMENT): Renamed to... (DATA_ABI_ALIGNMENT): ... this. * doc/tm.texi.in (DATA_ABI_ALIGNMENT): Document. * doc/tm.texi: Regenerated. * gcc.target/i386/pr56564-1.c: New test. * gcc.target/i386/pr56564-2.c: New test. * gcc.target/i386/pr56564-3.c: New test. * gcc.target/i386/pr56564-4.c: New test. * gcc.target/i386/avx256-unaligned-load-4.c: Add -fno-common. * gcc.target/i386/avx256-unaligned-store-1.c: Likewise. * gcc.target/i386/avx256-unaligned-store-3.c: Likewise. * gcc.target/i386/avx256-unaligned-store-4.c: Likewise. * gcc.target/i386/vect-sizes-1.c: Likewise. * gcc.target/i386/memcpy-1.c: Likewise. * gcc.dg/vect/costmodel/i386/costmodel-vect-31.c (tmp): Initialize. * gcc.dg/vect/costmodel/x86_64/costmodel-vect-31.c (tmp): Likewise. From-SVN: r199898
2013-06-10 17:41:52 +02:00
@defmac DATA_ABI_ALIGNMENT (@var{type}, @var{basic-align})
Similar to @code{DATA_ALIGNMENT}, but for the cases where the ABI mandates
some alignment increase, instead of optimization only purposes. E.g.@
AMD x86-64 psABI says that variables with array type larger than 15 bytes
must be aligned to 16 byte boundaries.
If this macro is not defined, then @var{basic-align} is used.
@end defmac
@defmac CONSTANT_ALIGNMENT (@var{constant}, @var{basic-align})
1996-09-25 01:21:45 +02:00
If defined, a C expression to compute the alignment given to a constant
that is being placed in memory. @var{constant} is the constant and
@var{basic-align} is the alignment that the object would ordinarily
have. The value of this macro is used instead of that alignment to
align the object.
If this macro is not defined, then @var{basic-align} is used.
The typical use of this macro is to increase alignment for string
constants to be word aligned so that @code{strcpy} calls that copy
constants can be done inline.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LOCAL_ALIGNMENT (@var{type}, @var{basic-align})
If defined, a C expression to compute the alignment for a variable in
the local store. @var{type} is the data type, and @var{basic-align} is
the alignment that the object would ordinarily have. The value of this
macro is used instead of that alignment to align the object.
If this macro is not defined, then @var{basic-align} is used.
One use of this macro is to increase alignment of medium-size data to
make it all fit in fewer cache lines.
If the value of this macro has a type, it should be an unsigned type.
@end defmac
@deftypefn {Target Hook} HOST_WIDE_INT TARGET_VECTOR_ALIGNMENT (const_tree @var{type})
This hook can be used to define the alignment for a vector of type
@var{type}, in order to comply with a platform ABI. The default is to
require natural alignment for vector types. The alignment returned by
this hook must be a power-of-two multiple of the default alignment of
the vector element type.
@end deftypefn
@defmac STACK_SLOT_ALIGNMENT (@var{type}, @var{mode}, @var{basic-align})
If defined, a C expression to compute the alignment for stack slot.
@var{type} is the data type, @var{mode} is the widest mode available,
and @var{basic-align} is the alignment that the slot would ordinarily
have. The value of this macro is used instead of that alignment to
align the slot.
If this macro is not defined, then @var{basic-align} is used when
@var{type} is @code{NULL}. Otherwise, @code{LOCAL_ALIGNMENT} will
be used.
This macro is to set alignment of stack slot to the maximum alignment
of all possible modes which the slot may have.
If the value of this macro has a type, it should be an unsigned type.
@end defmac
@defmac LOCAL_DECL_ALIGNMENT (@var{decl})
If defined, a C expression to compute the alignment for a local
variable @var{decl}.
If this macro is not defined, then
@code{LOCAL_ALIGNMENT (TREE_TYPE (@var{decl}), DECL_ALIGN (@var{decl}))}
is used.
One use of this macro is to increase alignment of medium-size data to
make it all fit in fewer cache lines.
If the value of this macro has a type, it should be an unsigned type.
@end defmac
@defmac MINIMUM_ALIGNMENT (@var{exp}, @var{mode}, @var{align})
If defined, a C expression to compute the minimum required alignment
for dynamic stack realignment purposes for @var{exp} (a type or decl),
@var{mode}, assuming normal alignment @var{align}.
If this macro is not defined, then @var{align} will be used.
@end defmac
@defmac EMPTY_FIELD_BOUNDARY
Alignment in bits to be given to a structure bit-field that follows an
1996-09-25 01:21:45 +02:00
empty field such as @code{int : 0;}.
If @code{PCC_BITFIELD_TYPE_MATTERS} is true, it overrides this macro.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STRUCTURE_SIZE_BOUNDARY
1996-09-25 01:21:45 +02:00
Number of bits which any structure or union's size must be a multiple of.
Each structure or union's size is rounded up to a multiple of this.
If you do not define this macro, the default is the same as
@code{BITS_PER_UNIT}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STRICT_ALIGNMENT
1996-09-25 01:21:45 +02:00
Define this macro to be the value 1 if instructions will fail to work
if given data not on the nominal alignment. If instructions will merely
go slower in that case, define this macro as 0.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PCC_BITFIELD_TYPE_MATTERS
1996-09-25 01:21:45 +02:00
Define this if you wish to imitate the way many other C compilers handle
alignment of bit-fields and the structures that contain them.
1996-09-25 01:21:45 +02:00
The behavior is that the type written for a named bit-field (@code{int},
@code{short}, or other integer type) imposes an alignment for the entire
structure, as if the structure really did contain an ordinary field of
that type. In addition, the bit-field is placed within the structure so
that it would fit within such a field, not crossing a boundary for it.
Thus, on most machines, a named bit-field whose type is written as
@code{int} would not cross a four-byte boundary, and would force
four-byte alignment for the whole structure. (The alignment used may
not be four bytes; it is controlled by the other alignment parameters.)
An unnamed bit-field will not affect the alignment of the containing
structure.
1996-09-25 01:21:45 +02:00
If the macro is defined, its definition should be a C expression;
a nonzero value for the expression enables this behavior.
Note that if this macro is not defined, or its value is zero, some
bit-fields may cross more than one alignment boundary. The compiler can
1996-09-25 01:21:45 +02:00
support such references if there are @samp{insv}, @samp{extv}, and
@samp{extzv} insns that can directly reference memory.
The other known way of making bit-fields work is to define
1996-09-25 01:21:45 +02:00
@code{STRUCTURE_SIZE_BOUNDARY} as large as @code{BIGGEST_ALIGNMENT}.
Then every structure can be accessed with fullwords.
Unless the machine has bit-field instructions or you define
1996-09-25 01:21:45 +02:00
@code{STRUCTURE_SIZE_BOUNDARY} that way, you must define
@code{PCC_BITFIELD_TYPE_MATTERS} to have a nonzero value.
If your aim is to make GCC use the same conventions for laying out
bit-fields as are used by another compiler, here is how to investigate
1996-09-25 01:21:45 +02:00
what the other compiler does. Compile and run this program:
@smallexample
1996-09-25 01:21:45 +02:00
struct foo1
@{
char x;
char :0;
char y;
@};
struct foo2
@{
char x;
int :0;
char y;
@};
main ()
@{
printf ("Size of foo1 is %d\n",
sizeof (struct foo1));
printf ("Size of foo2 is %d\n",
sizeof (struct foo2));
exit (0);
@}
@end smallexample
1996-09-25 01:21:45 +02:00
If this prints 2 and 5, then the compiler's behavior is what you would
get from @code{PCC_BITFIELD_TYPE_MATTERS}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BITFIELD_NBYTES_LIMITED
Like @code{PCC_BITFIELD_TYPE_MATTERS} except that its effect is limited
to aligning a bit-field within the structure.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_ALIGN_ANON_BITFIELD (void)
When @code{PCC_BITFIELD_TYPE_MATTERS} is true this hook will determine
whether unnamed bitfields affect the alignment of the containing
structure. The hook should return true if the structure should inherit
the alignment requirements of an unnamed bitfield's type.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_NARROW_VOLATILE_BITFIELD (void)
This target hook should return @code{true} if accesses to volatile bitfields
should use the narrowest mode possible. It should return @code{false} if
these accesses should use the bitfield container type.
The default is @code{false}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_MEMBER_TYPE_FORCES_BLK (const_tree @var{field}, machine_mode @var{mode})
Return true if a structure, union or array containing @var{field} should
be accessed using @code{BLKMODE}.
If @var{field} is the only field in the structure, @var{mode} is its
mode, otherwise @var{mode} is VOIDmode. @var{mode} is provided in the
case where structures of one field would require the structure's mode to
retain the field's mode.
Normally, this is not needed.
@end deftypefn
@defmac ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
Define this macro as an expression for the alignment of a type (given
by @var{type} as a tree node) if the alignment computed in the usual
way is @var{computed} and the alignment explicitly specified was
1996-09-25 01:21:45 +02:00
@var{specified}.
The default is to use @var{specified} if it is larger; otherwise, use
the smaller of @var{computed} and @code{BIGGEST_ALIGNMENT}
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MAX_FIXED_MODE_SIZE
1996-09-25 01:21:45 +02:00
An integer expression for the size in bits of the largest integer
machine mode that should actually be used. All integer machine modes of
this size or smaller can be used for structures and unions with the
appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
(DImode)} is assumed.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_SAVEAREA_MODE (@var{save_level})
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
If defined, an expression of type @code{machine_mode} that
specifies the mode of the save area operand of a
@code{save_stack_@var{level}} named pattern (@pxref{Standard Names}).
@var{save_level} is one of @code{SAVE_BLOCK}, @code{SAVE_FUNCTION}, or
@code{SAVE_NONLOCAL} and selects which of the three named patterns is
having its mode specified.
You need not define this macro if it always returns @code{Pmode}. You
would most commonly define this macro if the
@code{save_stack_@var{level}} patterns need to support both a 32- and a
64-bit mode.
@end defmac
@defmac STACK_SIZE_MODE
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
If defined, an expression of type @code{machine_mode} that
specifies the mode of the size increment operand of an
@code{allocate_stack} named pattern (@pxref{Standard Names}).
You need not define this macro if it always returns @code{word_mode}.
You would most commonly define this macro if the @code{allocate_stack}
pattern needs to support both a 32- and a 64-bit mode.
@end defmac
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_LIBGCC_CMP_RETURN_MODE (void)
libgcc2.h (word_type): Type definition removed. 2007-07-06 Andreas Krebbel <krebbel1@de.ibm.com> * libgcc2.h (word_type): Type definition removed. (cmp_return_type, shift_count_type): Type definitions added. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * libgcc2.c (__udivmoddi4, __moddi3): Type of local variable c changed from word_type to Wtype. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. * targhooks.c (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Default implementations for the new target hooks added. * targhooks.h (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Function prototypes added. * target.h (struct gcc_target): Fields for the new target hooks added. * optabs.c (expand_binop): Use shift_count_mode when expanding shift as library call. (prepare_cmp_insn): Use cmp_return_mode when expanding comparison as library call. * doc/tm.texi (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Documentation added. * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target hooks defined. From-SVN: r126410
2007-07-06 12:47:31 +02:00
This target hook should return the mode to be used for the return value
of compare instructions expanded to libgcc calls. If not defined
@code{word_mode} is returned which is the right choice for a majority of
targets.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_LIBGCC_SHIFT_COUNT_MODE (void)
libgcc2.h (word_type): Type definition removed. 2007-07-06 Andreas Krebbel <krebbel1@de.ibm.com> * libgcc2.h (word_type): Type definition removed. (cmp_return_type, shift_count_type): Type definitions added. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * libgcc2.c (__udivmoddi4, __moddi3): Type of local variable c changed from word_type to Wtype. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. * targhooks.c (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Default implementations for the new target hooks added. * targhooks.h (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Function prototypes added. * target.h (struct gcc_target): Fields for the new target hooks added. * optabs.c (expand_binop): Use shift_count_mode when expanding shift as library call. (prepare_cmp_insn): Use cmp_return_mode when expanding comparison as library call. * doc/tm.texi (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Documentation added. * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target hooks defined. From-SVN: r126410
2007-07-06 12:47:31 +02:00
This target hook should return the mode to be used for the shift count operand
of shift instructions expanded to libgcc calls. If not defined
@code{word_mode} is returned which is the right choice for a majority of
targets.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_UNWIND_WORD_MODE (void)
Return machine mode to be used for @code{_Unwind_Word} type.
The default is to use @code{word_mode}.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_MS_BITFIELD_LAYOUT_P (const_tree @var{record_type})
This target hook returns @code{true} if bit-fields in the given
@var{record_type} are to be laid out following the rules of Microsoft
Visual C/C++, namely: (i) a bit-field won't share the same storage
unit with the previous bit-field if their underlying types have
different sizes, and the bit-field will be aligned to the highest
alignment of the underlying types of itself and of the previous
bit-field; (ii) a zero-sized bit-field will affect the alignment of
the whole enclosing structure, even if it is unnamed; except that
(iii) a zero-sized bit-field will be disregarded unless it follows
another bit-field of nonzero size. If this hook returns @code{true},
other macros that control bit-field layout are ignored.
When a bit-field is inserted into a packed record, the whole size
of the underlying type is used by one or more same-size adjacent
bit-fields (that is, if its long:3, 32 bits is used in the record,
and any additional adjacent long bit-fields are packed into the same
chunk of 32 bits. However, if the size changes, a new field of that
size is allocated). In an unpacked record, this is the same as using
alignment, but not equivalent when packing.
If both MS bit-fields and @samp{__attribute__((packed))} are used,
the latter will take precedence. If @samp{__attribute__((packed))} is
used on a single field when MS bit-fields are in use, it will take
precedence for that field, but the alignment of the rest of the structure
may affect its placement.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New. 2005-12-16 Jon Grimm <jgrimm2@us.ibm.com> Janis Johnson <janis187@us.ibm.com> Ben Elliston <bje@au.ibm.com> * target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New. (TARGET_INITIALIZER): Add TARGET_DECIMAL_FLOAT_P. * target.h (struct gcc_target): Add decimal_float_supported_p. * targhooks.c (default_scalar_mode_supported_p): Handle MODE_DECIMAL_FLOAT. * builtins.def: Add new builtins for 32, 64 and 128 bit variants of inf, nan, finite, isinf and isnan. * builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128, BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR, BT_FN_DFLOAT32, BT_FN_DFLOAT64, BT_FN_DFLOAT128, BT_FN_INT_DFLOAT32, BT_FN_INT_DFLOAT64, BT_FN_INT_DFLOAT128, BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT64_CONST_STRING, BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT32_DFLOAT32, BT_FN_DFLOAT64_DFLOAT64, BT_FN_DFLOAT128_DFLOAT128): New. * c-decl.c (declspecs_add_type): Verify combos on type qualifiers. Pedwarn if decimal floating point types are used. Error if decimal floating point is not supported by the target. (finish_declspecs): Return type from DFP typespec_word. * c-typeck.c (c_common_type): Choose the decimal floating point type with the greater precision when determining a common type. (convert_arguments): Warn if there is a mismatch between argument and prototype for decimal float types. Warn of conversions with binary float types and of precision narrowing due to prototype. * c-parser.c (reswords): Add _Decimal32, _Decimal64, _Decimal128. (c_token_starts_typename): Handle RID_DFLOAT32/64/128. (c_token_starts_declspecs): Likewise. (c_parser_attributes): Likewise. * c-common.h (enum rid): Add new enumeration values RID_DFLOAT32, RID_DFLOAT64, RID_DFLOAT128. (T_D32, TEX_D32, T_D64, TEX_D64, T_D128, TEX_D128): New macros. * c-common.c (c_common_type_for_mode): Handle decimal float modes. (shorten_compare): Convert DFP/BFP operands to a common type. (c_common_modes_and_builtins): Register built-in decimal float types if the target supports them. (handle_mode_addtribute): Handle MODE_DECIMAL_FLOAT. * builtins.c (fold_builtin_1): Handle 32, 64 and 128 bit cases of inf, nan, finite, isinf and isnan builtins. * c-cppbuiltin.c (builtin_define_decimal_float_constants): New. (builtin_define_float_constants): Assert non-decimal radix. (c_cpp_builtins): Register built-in __DEC_EVAL_METHOD__ define. Call builtin_define_decimal_float_constants for each type. * c-lex.c (interpret_float): Decode decimal float types from CPP_N flags. Use real_from_string3, which can handle binary or decimal floats. * c-tree.h (enum c_typespec_keyword): Add cts_dfloat32, cts_dfloat64, cts_dfloat128. * tree.c (build_common_tree_nodes_2): Add decimal float types. * tree.h (enum tree_index): Add new enumeration values TI_DFLOAT32_TYPE, TI_DFLOAT64_TYPE, TI_DFLOAT128_TYPE, TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE, TI_DFLOAT128_PTR_TYPE. (dfloat32_type_node): New macro. (dfloat64_type_node, dfloat128_type_node): Likewise. (dfloat32_ptr_type_node, dfloat64_ptr_type_node): Likewise. (dfloat128_ptr_type_node): Likewise. * c-pretty-print.c (pp_c_floating_constant): Append 32, 64 and 128 bit decimal floating point types with "df", "dd" and "dl". * c-format.h (enum format_lengths): Add new enumeration values FMT_LEN_H, FMT_LEN_D and FMT_LEN_DD. * c-format.c (printf_length_specs, scanf_length_specs): Add entries for H, D, DD. (print_char_table, scan_char_table): Use new entries. (asm_fprintf_char_table, gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Adjust for longer length arrays. * defaults.h (DECIMAL32_TYPE_SIZE): Define. (DECIMAL64_TYPE_SIZE): Likewise. (DECIMAL128_TYPE_SIZE): Likewise. (TARGET_DEC_EVAL_METHOD): Likewise. * doc/extend.texi (Decimal Float): New node. (Constructing Calls): Document decimal float built-ins. * doc/tm.texi: Document TARGET_DECIMAL_FLOAT_SUPPORTED_P hook. * Makefile.in (USER_H): Add $(srcdir)/ginclude/decfloat.h. * ginclude/decfloat.h: New file. Co-Authored-By: Ben Elliston <bje@au.ibm.com> Co-Authored-By: Janis Johnson <janis187@us.ibm.com> From-SVN: r108629
2005-12-16 07:38:26 +01:00
Returns true if the target supports decimal floating point.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_FIXED_POINT_SUPPORTED_P (void)
c-common.h (enum rid): Add new enumeration values of RID_SAT, RID_FRACT, and RID_ACCUM. * c-common.h (enum rid): Add new enumeration values of RID_SAT, RID_FRACT, and RID_ACCUM. RID_SAT needs to be inserted before RID_ONEWAY, so that it can be checked in declspecs_add_type. (c_common_fixed_point_type_for_size): Declare. * c-parser.c (reswords): Add _Fract, _Accum, and _Sat. (c_token_starts_typename): Handle RID_FRACT, RID_ACCUM, and RID_SAT. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_attributes): Likewise. * c-tree.h (enum c_typespec_keyword): Add cts_fract and cts_accum. (c_declspecs): Add saturating_p. * c-decl.c (build_null_declspecs): Initialize saturating_p. (declspecs_add_type): Avoid using complex with _Fract, _Accum, or _Sat. Handle RID_SAT. Avoid using void, bool, char, int, float, double, _Decimal32, _Decimal64, _Decimal128, and complex with _Sat. Handle RID_FRACT and RID_ACCUM. Make sure _Sat is used with _Fract or _Accum. (finish_declspecs): Handle cts_fract and cts_accum. * c-common.c (fixed-value.h): New include. (constant_expression_warning): Handle FIXED_CST. (overflow_warning): Likewise. (warnings_for_convert_and_check): Likewise. (c_common_fixed_point_type_for_size): New. (c_common_type_for_mode): Handle fixed-point modes to return various saturating/non-saturating, signed/unsigned types. (c_common_signed_or_unsigned_type): Support fixed-point types. (shorten_compare): Check fixed-point zero. Handle FIXED_POINT_TYPE. (c_common_truthvalue_conversion): Handle FIXED_CST. Handle FIXED_POINT_TYPE. (c_common_nodes_and_builtins): Record builtin types for fixed-point types. (handle_mode_attribute): Handle fixed-point modes. Need to check if the signness of base type and fixed-point modes are consistent. (handle_vector_size_attribute): Handle fixed-point modes. (same_scalar_type_ignoring_signedness): Handle FIXED_POINT_TYPE. (warn_for_div_by_zero): Check fixed-point zero. * c-typeck.c (c_common_type): Check FIXED_POINT_TYPE. Build a common fixed-point type based on fbit, ibit, sign, and saturation. (build_unary_op): Allow FIXED_POINT_TYPE for CONVERT_EXPR, NEGATE_EXPR, TRUTH_NOT_EXPR, PREINCREMENT_EXPR, POSTINCREMENT_EXPR, PREDECREMENT_EXPR, and POSTDECREMENT_EXPR. (convert_for_assignment): Support FIXED_POINT_TYPE. (digest_init): Handle FIXED_POINT_TYPE. (build_binary_op): Support FIXED_POINT_TYPE in *_DIV_EXPR, TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, TRUTH_AND_EXPR, TRUTH_OR_EXPR, TRUTH_XOR_EXPR, RSHIFT_EXPR, LSHIFT_EXPR, EQ_EXPR, NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR. * target-def.h (TARGET_FIXED_POINT_SUPPORTED_P): New. (TARGET_INITIALIZER): Add TARGET_FIXED_POINT_SUPPORTED_P. * target.h (gcc_target): Add fixed_point_supported_p. * targhooks.c (default_scalar_mode_supported_p): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, and MODE_UACCUM. (default_fixed_point_supported_p): Define. * targhooks.h (default_fixed_point_supported_p): Declare. * doc/tm.texi (TARGET_FIXED_POINT_SUPPORTED_P): Add. * doc/install.texi (Configuration): Add --enable-fixed-point. * configure.ac (--enable-fixed-point): New to enable fixed-point arithmetic extension to C. For mips targets, we enable it by default. * configure, config.in: Regenerate. From-SVN: r127652
2007-08-21 00:26:47 +02:00
Returns true if the target supports fixed-point arithmetic.
@end deftypefn
re PR target/34814 (SDmode function args not passed according to ABI specification) PR target/34814 * doc/tm.texi (TARGET_EXPAND_TO_RTL_HOOK): Document. (TARGET_INSTANTIATE_DECLS): Likewise. * target.h (expand_to_rtl_hook): New target hook. (instantiate_decls): Likewise. * function.c (instantiate_decl): Make non-static. Rename to... (instantiate_decl_rtl): ... this. (instantiate_expr): Use instantiate_decl_rtl. (instantiate_decls_1): Likewise. (instantiate_decls): Likewise. (instantiate_virtual_regs: Call new instantiate_decls taget hook. * function.h (instantiate_decl_rtl): Add prototype. * cfgexpand.c (target.h): New include. (tree_expand_cfg): Call new expand_to_rtl_hook target hook. * target-def.h (TARGET_EXPAND_TO_RTL_HOOK): New define. (TARGET_INSTANTIATE_DECLS): Likewise. (TARGET_INITIALIZER): New target hooks added. * config/rs6000/rs6000-protos.h (rs6000_secondary_memory_needed_rtx): New prototype. * config/rs6000/rs6000.c (tree-flow.h): New include. (machine_function): Add sdmode_stack_slot field. (rs6000_alloc_sdmode_stack_slot): New function. (rs6000_instantiate_decls): Likewise. (rs6000_secondary_memory_needed_rtx): Likewise. (rs6000_check_sdmode): Likewise. (TARGET_EXPAND_TO_RTL_HOOK): Target macro defined. (TARGET_INSTANTIATE_DECLS): Likewise. (rs6000_hard_regno_mode_ok): Allow SDmode. (num_insns_constant): Likewise. Handle _Decimal32 constants. (rs6000_emit_move): Handle SDmode. (function_arg_advance): Likewise. (function_arg): Likewise. (rs6000_gimplify_va_arg): Likewise. Add special handling of SDmode var args for 32-bit compiles. (rs6000_secondary_reload_class): Handle SDmode. (rs6000_output_function_epilogue): Likewise. (rs6000_function_value): Simplify if statement. (rs6000_libcall_value): Likewise. * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Handle SDmode. (SECONDARY_MEMORY_NEEDED_RTX): Add define. * config/rs6000/dfp.md (movsd): New define_expand and splitter. (movsd_hardfloat): New define_insn. (movsd_softfloat): Likewise. (movsd_store): Likewise. (movsd_load): Likewise. (extendsddd2): Likewise. (extendsdtd2): Likewise. (truncddsd2): Likewise. (movdd_hardfloat64): Fixup comment. (UNSPEC_MOVSD_LOAD): New constant. (UNSPEC_MOVSD_STORE): Likewise. Co-Authored-By: Janis Johnson <janis187@us.ibm.com> From-SVN: r131869
2008-01-26 18:18:35 +01:00
@deftypefn {Target Hook} void TARGET_EXPAND_TO_RTL_HOOK (void)
This hook is called just before expansion into rtl, allowing the target
to perform additional initializations or analysis before the expansion.
For example, the rs6000 port uses it to allocate a scratch stack slot
for use in copying SDmode values between memory and floating point
registers whenever the function being expanded has any SDmode
usage.
@end deftypefn
@deftypefn {Target Hook} void TARGET_INSTANTIATE_DECLS (void)
This hook allows the backend to perform additional instantiations on rtl
that are not actually in any insns yet, but will be later.
@end deftypefn
@deftypefn {Target Hook} {const char *} TARGET_MANGLE_TYPE (const_tree @var{type})
alpha.c (alpha_mangle_fundamental_type): Rename to... gcc/ * config/alpha/alpha.c (alpha_mangle_fundamental_type): Rename to... (alpha_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/arm/arm-protos.h (arm_mangle_type): Add prototype. * config/arm/arm.c (TARGET_MANGLE_TYPE): Define target hook. (arm_init_neon_builtins): Fix comment. (arm_mangle_map_entry): New. (arm_mangle_map): New. (arm_mangle_type): New. * config/i386/i386.c (ix86_mangle_fundamental_type): Rename to... (ix86_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/ia64/ia64.c (ia64_mangle_fundamental_type): Rename to... (ia64_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/rs6000/rs6000.c (rs6000_mangle_fundamental_type): Rename to... (rs6000_mangle_type): This. Use TYPE_MAIN_VARIANT. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/s390/s390.c (s390_mangle_fundamental_type): Rename to... (s390_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/sparc/sparc.c (sparc_mangle_fundamental_type): Rename to... (sparc_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * cp/mangle.c (write_type): Call mangle_type target hook on all types before mangling. Use original type, not main variant, as argument. * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename hook to... (TARGET_MANGLE_TYPE): This. * target.h (gcc_target): Rename mangle_fundamental_type to mangle_type. * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename section to... (TARGET_MANGLE_TYPE): This. Note slightly different semantics. Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com> From-SVN: r126917
2007-07-25 17:43:04 +02:00
If your target defines any fundamental types, or any types your target
uses should be mangled differently from the default, define this hook
to return the appropriate encoding for these types as part of a C++
mangled name. The @var{type} argument is the tree structure representing
the type to be mangled. The hook may be applied to trees which are
not target-specific fundamental types; it should return @code{NULL}
for all such types, as well as arguments it does not recognize. If the
return value is not @code{NULL}, it must point to a statically-allocated
string constant.
Target-specific fundamental types might be new fundamental types or
qualified versions of ordinary fundamental types. Encode new
fundamental types as @samp{@w{u @var{n} @var{name}}}, where @var{name}
is the name used for the type in source code, and @var{n} is the
length of @var{name} in decimal. Encode qualified versions of
ordinary types as @samp{@w{U @var{n} @var{name} @var{code}}}, where
@var{name} is the name used for the type qualifier in source code,
@var{n} is the length of @var{name} as above, and @var{code} is the
code used to represent the unqualified version of this type. (See
@code{write_builtin_type} in @file{cp/mangle.c} for the list of
codes.) In both cases the spaces are for clarity; do not include any
spaces in your string.
alpha.c (alpha_mangle_fundamental_type): Rename to... gcc/ * config/alpha/alpha.c (alpha_mangle_fundamental_type): Rename to... (alpha_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/arm/arm-protos.h (arm_mangle_type): Add prototype. * config/arm/arm.c (TARGET_MANGLE_TYPE): Define target hook. (arm_init_neon_builtins): Fix comment. (arm_mangle_map_entry): New. (arm_mangle_map): New. (arm_mangle_type): New. * config/i386/i386.c (ix86_mangle_fundamental_type): Rename to... (ix86_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/ia64/ia64.c (ia64_mangle_fundamental_type): Rename to... (ia64_mangle_type): This. Use TYPE_MAIN_VARIANT and restrict mangled types to VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, REAL_TYPE. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/rs6000/rs6000.c (rs6000_mangle_fundamental_type): Rename to... (rs6000_mangle_type): This. Use TYPE_MAIN_VARIANT. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/s390/s390.c (s390_mangle_fundamental_type): Rename to... (s390_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * config/sparc/sparc.c (sparc_mangle_fundamental_type): Rename to... (sparc_mangle_type): This. (TARGET_MANGLE_FUNDAMENTAL_TYPE): Don't define. (TARGET_MANGLE_TYPE): Define this instead. * cp/mangle.c (write_type): Call mangle_type target hook on all types before mangling. Use original type, not main variant, as argument. * target-def.h (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename hook to... (TARGET_MANGLE_TYPE): This. * target.h (gcc_target): Rename mangle_fundamental_type to mangle_type. * doc/tm.texi (TARGET_MANGLE_FUNDAMENTAL_TYPE): Rename section to... (TARGET_MANGLE_TYPE): This. Note slightly different semantics. Co-Authored-By: Mark Shinwell <shinwell@codesourcery.com> From-SVN: r126917
2007-07-25 17:43:04 +02:00
This hook is applied to types prior to typedef resolution. If the mangled
name for a particular type depends only on that type's main variant, you
can perform typedef resolution yourself using @code{TYPE_MAIN_VARIANT}
before mangling.
The default version of this hook always returns @code{NULL}, which is
appropriate for a target that does not define any new fundamental
types.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Type Layout
@section Layout of Source Language Data Types
These macros define the sizes and other characteristics of the standard
basic data types used in programs being compiled. Unlike the macros in
the previous section, these apply to specific features of C and related
languages, rather than to fundamental aspects of storage layout.
@defmac INT_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{int} on the
target machine. If you don't define this, the default is one word.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SHORT_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{short} on the
target machine. If you don't define this, the default is half a word.
(If this would be less than one storage unit, it is rounded up to one
unit.)
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LONG_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{long} on the
target machine. If you don't define this, the default is one word.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ADA_LONG_TYPE_SIZE
On some machines, the size used for the Ada equivalent of the type
@code{long} by a native Ada compiler differs from that used by C@. In
that situation, define this macro to be a C expression to be used for
the size of that type. If you don't define this, the default is the
value of @code{LONG_TYPE_SIZE}.
@end defmac
@defmac LONG_LONG_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{long long} on the
target machine. If you don't define this, the default is two
words. If you want to support GNU Ada on your machine, the value of this
1996-09-25 01:21:45 +02:00
macro must be at least 64.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CHAR_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{char} on the
target machine. If you don't define this, the default is
@code{BITS_PER_UNIT}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BOOL_TYPE_SIZE
A C expression for the size in bits of the C++ type @code{bool} and
C99 type @code{_Bool} on the target machine. If you don't define
this, and you probably shouldn't, the default is @code{CHAR_TYPE_SIZE}.
@end defmac
@defmac FLOAT_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{float} on the
target machine. If you don't define this, the default is one word.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DOUBLE_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{double} on the
target machine. If you don't define this, the default is two
words.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LONG_DOUBLE_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the type @code{long double} on
the target machine. If you don't define this, the default is two
words.
@end defmac
1996-09-25 01:21:45 +02:00
tree.def (FIXED_POINT_TYPE): New type. * tree.def (FIXED_POINT_TYPE): New type. (FIXED_CST): New constant. (FIXED_CONVERT_EXPR): New expr. * doc/c-tree.texi (Types): Document FIXED_POINT_TYPE. (Expressions): Document FIXED_CST and FIXED_CONVERT_EXPR. * tree.h (struct tree_base): Add saturating_flag. Remove one bit of spare for saturating_flag. (NUMERICAL_TYPE_CHECK): Support FIXED_POINT_TYPE. (NON_SAT_FIXED_POINT_TYPE_P, SAT_FIXED_POINT_TYPE_P, FIXED_POINT_TYPE_P): Define. (TYPE_SATURATING): Define. (TREE_FIXED_CST_PTR, TREE_FIXED_CST): Define. (struct tree_fixed_cst): New. (TYPE_IBIT, TYPE_FBIT): Define. (tree_node): Add fixed_cst. (enum tree_index): Add new enumeration values of TI_SAT_SFRACT_TYPE, TI_SAT_FRACT_TYPE, TI_SAT_LFRACT_TYPE, TI_SAT_LLFRACT_TYPE, TI_SAT_USFRACT_TYPE, TI_SAT_UFRACT_TYPE, TI_SAT_ULFRACT_TYPE, TI_SAT_ULLFRACT_TYPE, TI_SFRACT_TYPE, TI_FRACT_TYPE, TI_LFRACT_TYPE, TI_LLFRACT_TYPE, TI_USFRACT_TYPE, TI_UFRACT_TYPE, TI_ULFRACT_TYPE, TI_ULLFRACT_TYPE, TI_SAT_SACCUM_TYPE, TI_SAT_ACCUM_TYPE, TI_SAT_LACCUM_TYPE, TI_SAT_LLACCUM_TYPE, TI_SAT_USACCUM_TYPE, TI_SAT_UACCUM_TYPE, TI_SAT_ULACCUM_TYPE, TI_SAT_ULLACCUM_TYPE, TI_SACCUM_TYPE, TI_ACCUM_TYPE, TI_LACCUM_TYPE, TI_LLACCUM_TYPE, TI_USACCUM_TYPE, TI_UACCUM_TYPE, TI_ULACCUM_TYPE, TI_ULLACCUM_TYPE, TI_QQ_TYPE, TI_HQ_TYPE,_TYPE, TI_SQ_TYPE, TI_DQ_TYPE, TI_TQ_TYPE, TI_UQQ_TYPE, TI_UHQ_TYPE, TI_USQ_TYPE, TI_UDQ_TYPE, TI_UTQ_TYPE, TI_SAT_QQ_TYPE, TI_SAT_HQ_TYPE, TI_SAT_SQ_TYPE, TI_SAT_DQ_TYPE, TI_SAT_TQ_TYPE, TI_SAT_UQQ_TYPE, TI_SAT_UHQ_TYPE, TI_SAT_USQ_TYPE, TI_SAT_UDQ_TYPE, TI_SAT_UTQ_TYPE, TI_HA_TYPE, TI_SA_TYPE, TI_DA_TYPE, TI_TA_TYPE, TI_UHA_TYPE, TI_USA_TYPE, TI_UDA_TYPE, TI_UTA_TYPE, TI_SAT_HA_TYPE, TI_SAT_SA_TYPE, TI_SAT_DA_TYPE, TI_SAT_TA_TYPE, TI_SAT_UHA_TYPE, TI_SAT_USA_TYPE, TI_SAT_UDA_TYPE, TI_SAT_UTA_TYPE. (sat_short_fract_type_node, sat_fract_type_node, sat_long_fract_type_node, sat_long_long_fract_type_node, sat_unsigned_short_fract_type_node, sat_unsigned_fract_type_node, sat_unsigned_long_fract_type_node, sat_unsigned_long_long_fract_type_node, short_fract_type_node, fract_type_node, long_fract_type_node, long_long_fract_type_node, unsigned_short_fract_type_node, unsigned_fract_type_node, unsigned_long_fract_type_node, unsigned_long_long_fract_type_node, sat_short_accum_type_node, sat_accum_type_node, sat_long_accum_type_node, sat_long_long_accum_type_node, sat_unsigned_short_accum_type_node, sat_unsigned_accum_type_node, sat_unsigned_long_accum_type_node, sat_unsigned_long_long_accum_type_node, short_accum_type_node, accum_type_node, long_accum_type_node, long_long_accum_type_node, unsigned_short_accum_type_node, unsigned_accum_type_node, unsigned_long_accum_type_node, unsigned_long_long_accum_type_node, qq_type_node, hq_type_node, sq_type_node, dq_type_node, tq_type_node, uqq_type_node, uhq_type_node, usq_type_node, udq_type_node, utq_type_node, sat_qq_type_node, sat_hq_type_node, sat_sq_type_node, sat_dq_type_node, sat_tq_type_node, sat_uqq_type_node, sat_uhq_type_node, sat_usq_type_node, sat_udq_type_node, sat_utq_type_node, ha_type_node, sa_type_node, da_type_node, ta_type_node, uha_type_node, usa_type_node, uda_type_node, uta_type_node, sat_ha_type_node, sat_sa_type_node, sat_da_type_node, sat_ta_type_node, sat_uha_type_node, sat_usa_type_node, sat_uda_type_node, sat_uta_type_node): New macro. (make_fract_type, make_accum_type): Declare. (make_signed_fract_type, make_unsigned_fract_type, make_sat_signed_fract_type, make_sat_unsigned_fract_type, make_signed_accum_type, make_unsigned_accum_type, make_sat_signed_accum_type, make_sat_unsigned_accum_type, make_or_reuse_signed_fract_type, make_or_reuse_unsigned_fract_type, make_or_reuse_sat_signed_fract_type, make_or_reuse_sat_unsigned_fract_type, make_or_reuse_signed_accum_type, make_or_reuse_unsigned_accum_type, make_or_reuse_sat_signed_accum_type, make_or_reuse_sat_unsigned_accum_type): New macro. (fixed_zerop): Declare. * defaults.h (SHORT_FRACT_TYPE_SIZE, FRACT_TYPE_SIZE, LONG_FRACT_TYPE_SIZE, LONG_LONG_FRACT_TYPE_SIZE, SHORT_ACCUM_TYPE_SIZE, ACCUM_TYPE_SIZE, LONG_ACCUM_TYPE_SIZE, LONG_LONG_ACCUM_TYPE_SIZE): Define. * treestruct.def: Add TS_FIXED_CST. * Makefile.in (c-pretty-print.o): Add dependence on fixed-value.h. (tree.o): Likewise. (tree-dump.o): Likewise. (print-tree.o): Likewise. (tree-pretty-print.o): Likewise. (fold-const.o): Likewise. * tree-complex.c (some_nonzerop): Handle FIXED_CST. * tree-gimple.c (is_gimple_formal_tmp_rhs): Handle FIXED_CST. (is_gimple_min_invariant): Handle FIXED_CST. * stor-layout.c (int_mode_for_mode): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (layout_type): Handle FIXED_POINT_TYPE. (make_fract_type, make_accum_type): New functions. * tree-browser.c (browse_tree): Handle FIXED_POINT_TYPE. * tree-dump.c (fixed-value.h): New include. (dump_fixed): New function. (dequeue_and_dump): Handle FIXED_POINT_TYPE and FIXED_CST. * tree-inline.c (remap_type_1): Handle FIXED_POINT_TYPE. (estimate_num_insns_1): Handle FIXED_CST and FIXED_CONVERT_EXPR. * tree-pretty-print.c (fixed-value.h): New include. (dump_generic_node): Handle FIXED_POINT_TYPE, FIXED_CST, and FIXED_CONVERT_EXPR. * tree-scalar-evolution.c (get_scalar_evolution): Handle FIXED_CST. * tree-ssa-loop-im.c (for_each_index): Handle FIXED_CST. * tree-ssa-pre.c (poolify_tree): Handle FIXED_CST. * tree-ssa-reassoc.c (break_up_subtract_bb): We can do reassociation for non-saturating fixed-point types. (reassociate_bb): Likewise. * emit-rtl.c (fixed-value.h): New include. (fconst0, fconst1): New array. (init_emit_once): Initialize fconst0 and fconst1 for fixed-point modes. * tree-vect-generic.c expand_vector_operation): Support MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, and MODE_VECTOR_UACCUM. (type_for_widest_vector_mode): Add one parameter for the saturating flag. Check scalar FRACT, UFRACT, ACCUM, and UACCUM mode to select their vector mode. Pass the satp parameter to type_for_mode for fixed-point types. (expand_vector_operations_1): Pass the saturating flag to type_for_widest_vector_mode. Support MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, and MODE_VECTOR_UACCUM. * tree-vect-transform.c (vect_is_simple_cond): Support FIXED_CST. (vectorizable_condition): Likewise. * tree.c (fixed-value.h): New include. (tree_code_size): Support FIXED_CST. (build_fixed): New function. (build_one_cst): Support FIXED_POINT_TYPE for accum types. (fixed_zerop): New function. (tree_node_structure): Support FIXED_CST. (type_contains_placeholder_1): Support FIXED_POINT_TYPE. (build_type_attribute_qual_variant): Handle FIXED_POINT_TYPE. (type_hash_eq): Handle FIXED_POINT_TYPE. (simple_cst_equal): Support FIXED_CST. (iterative_hash_expr): Handle FIXED_CST. (get_unwidened): Make sure type is not FIXED_POINT_TYPE. (get_narrower): Likewise. (variably_modified_type_p): Handle FIXED_POINT_TYPE. (make_or_reuse_fract_type, make_or_reuse_accum_type): New functions. (build_common_tree_nodes_2): Use MAKE_FIXED_TYPE_NODE_FAMILY and MAKE_FIXED_MODE_NODE macros to initialize fixed-point type nodes. (build_vector_type_for_mode): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_zerop): Support FIXED_CST. (walk_tree): Handle FIXED_CST and FIXED_POINT_TYPE. * dwarf2out.c (base_type_die): Use DW_ATE_signed_fixed or DW_ATE_unsigned_fixed to describe FIXED_POINT_TYPE. (is_base_type): Handle FIXED_POINT_TYPE. (add_type_attribute): Handle FIXED_POINT_TYPE. (gen_type_die_with_usage): Handle FIXED_POINT_TYPE. * print-tree.c (fixed-value.h): New include. (print_node_brief): Support FIXED_CST. (print_node): Support FIXED_POINT_TYPE and FIXED_CST. * c-pretty-print.c (fixed-value.h): New include. (pp_c_type_specifier): Handle FIXED_POINT_TYPE. Need to pass TYPE_SATURATING to c_common_type_for_mode for fixed-point modes. (pp_c_direct_abstract_declarator): Handle FIXED_POINT_TYPE. Support fixed-point types for inner items in VECTOR_TYPE. (pp_c_direct_declarator): Likewise. (pp_c_declarator): Likewise. (pp_c_fixed_constant): New function. (pp_c_constant): Handle FIXED_CST. (pp_c_primary_expression): Likewise. (pp_c_expression): Likewise. * fold-const.c (fixed-value.h): New include. (negate_expr_p): Return true for FIXED_CST. (fold_negate_expr): Support FIXED_CST. (split_tree): Support FIXED_CST. (const_binop): Support FIXED_CST. (fold_convert_const_int_from_fixed): New function to convert from fixed to int. (fold_convert_const_real_from_fixed): New function to convert from fixed to real. (fold_convert_const_fixed_from_fixed): New function to convert from fixed to another fixed. (fold_convert_const_fixed_from_int): New function to convert from int to fixed. (fold_convert_const_fixed_from_real): New function to convert from real to fixed. (fold_convert_const): Support conversions from fixed to int, from fixed to real, from fixed to fixed, from int to fixed, and from real to fixed. (fold_convert): Support FIXED_CST and FIXED_POINT_TYPE. (operand_equal_p): Support FIXED_CST. (make_range): For fixed-point modes, we need to pass the saturating flag as the 2nd parameter. (tree_swap_operands_p): Handle FIXED_CST. (fold_plusminus_mult_expr): For fract modes, we cannot generate constant 1. (fold_unary): Support FIXED_CONVERT_EXPR. (fold_binary): Handle FIXED_CST. Make sure the type is not saturating, before associating operations. Ex: A + B + C, A * B * C, (A1 * C1) +/- (A2 * C2). (tree_expr_nonnegative_warnv_p): Handle FIXED_CST. (fold_negate_const): Support FIXED_CST. (fold_relational_const): Support FIXED_CST. * gimplify.c (omp_firstprivatize_type_sizes): Handle FIXED_POINT_TYPE. (gimplify_expr): Handle FIXED_CST. (gimplify_type_sizes): Handle FIXED_POINT_TYPE. * ipa-prop.c (ipa_callsite_compute_param): Support FIXED_CST. * ipa-type-escape.c (type_to_consider): Handle FIXED_POINT_TYPE. * doc/tm.texi (Type Layout): Document SHORT_FRACT_TYPE_SIZE, FRACT_TYPE_SIZE, LONG_FRACT_TYPE_SIZE, LONG_LONG_FRACT_TYPE_SIZE, SHORT_ACCUM_TYPE_SIZE, ACCUM_TYPE_SIZE, LONG_ACCUM_TYPE_SIZE, LONG_LONG_ACCUM_TYPE_SIZE. * dbxout.c (dbxout_type): Handle FIXED_POINT_TYPE. * c-aux-info.c (gen_type): Handle FIXED_POINT_TYPE. * tree-sra.c (is_sra_scalar_type): Support FIXED_POINT_TYPE. * expmed.c (extract_bit_field): Support MODE_FRACT, MODE_UFRACT, MODE_ACCUM, and MODE_UACCUM. * tree-vectorizer.c (vect_is_simple_reduction): Check for saturating fixed-point types to disable reduction. * explow.c (promote_mode): Support FIXED_POINT_TYPE. From-SVN: r127306
2007-08-09 00:29:12 +02:00
@defmac SHORT_FRACT_TYPE_SIZE
A C expression for the size in bits of the type @code{short _Fract} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT}.
@end defmac
@defmac FRACT_TYPE_SIZE
A C expression for the size in bits of the type @code{_Fract} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 2}.
@end defmac
@defmac LONG_FRACT_TYPE_SIZE
A C expression for the size in bits of the type @code{long _Fract} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 4}.
@end defmac
@defmac LONG_LONG_FRACT_TYPE_SIZE
A C expression for the size in bits of the type @code{long long _Fract} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 8}.
@end defmac
@defmac SHORT_ACCUM_TYPE_SIZE
A C expression for the size in bits of the type @code{short _Accum} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 2}.
@end defmac
@defmac ACCUM_TYPE_SIZE
A C expression for the size in bits of the type @code{_Accum} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 4}.
@end defmac
@defmac LONG_ACCUM_TYPE_SIZE
A C expression for the size in bits of the type @code{long _Accum} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 8}.
@end defmac
@defmac LONG_LONG_ACCUM_TYPE_SIZE
A C expression for the size in bits of the type @code{long long _Accum} on
the target machine. If you don't define this, the default is
@code{BITS_PER_UNIT * 16}.
@end defmac
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
@defmac LIBGCC2_GNU_PREFIX
This macro corresponds to the @code{TARGET_LIBFUNC_GNU_PREFIX} target
hook and should be defined if that hook is overriden to be true. It
causes function names in libgcc to be changed to use a @code{__gnu_}
prefix for their name rather than the default @code{__}. A port which
uses this macro should also arrange to use @file{t-gnu-prefix} in
the libgcc @file{config.host}.
@end defmac
@defmac TARGET_FLT_EVAL_METHOD
A C expression for the value for @code{FLT_EVAL_METHOD} in @file{float.h},
assuming, if applicable, that the floating-point control word is in its
default state. If you do not define this macro the value of
@code{FLT_EVAL_METHOD} will be zero.
@end defmac
@defmac WIDEST_HARDWARE_FP_SIZE
A C expression for the size in bits of the widest floating-point format
supported by the hardware. If you define this macro, you must specify a
value less than or equal to the value of @code{LONG_DOUBLE_TYPE_SIZE}.
If you do not define this macro, the value of @code{LONG_DOUBLE_TYPE_SIZE}
is the default.
@end defmac
@defmac DEFAULT_SIGNED_CHAR
1996-09-25 01:21:45 +02:00
An expression whose value is 1 or 0, according to whether the type
@code{char} should be signed or unsigned by default. The user can
always override this default with the options @option{-fsigned-char}
and @option{-funsigned-char}.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_DEFAULT_SHORT_ENUMS (void)
This target hook should return true if the compiler should give an
@code{enum} type only as many bytes as it takes to represent the range
of possible values of that type. It should return false if all
@code{enum} types should be allocated like @code{int}.
The default is to return false.
@end deftypefn
@defmac SIZE_TYPE
1996-09-25 01:21:45 +02:00
A C expression for a string describing the name of the data type to use
for size values. The typedef name @code{size_t} is defined using the
contents of the string.
The string can contain more than one keyword. If so, separate them with
spaces, and write first any length keyword, then @code{unsigned} if
appropriate, and finally @code{int}. The string must exactly match one
of the data type names defined in the function
@code{c_common_nodes_and_builtins} in the file @file{c-family/c-common.c}.
You may not omit @code{int} or change the order---that would cause the
compiler to crash on startup.
1996-09-25 01:21:45 +02:00
If you don't define this macro, the default is @code{"long unsigned
int"}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SIZETYPE
GCC defines internal types (@code{sizetype}, @code{ssizetype},
@code{bitsizetype} and @code{sbitsizetype}) for expressions
dealing with size. This macro is a C expression for a string describing
the name of the data type from which the precision of @code{sizetype}
is extracted.
The string has the same restrictions as @code{SIZE_TYPE} string.
If you don't define this macro, the default is @code{SIZE_TYPE}.
@end defmac
@defmac PTRDIFF_TYPE
1996-09-25 01:21:45 +02:00
A C expression for a string describing the name of the data type to use
for the result of subtracting two pointers. The typedef name
@code{ptrdiff_t} is defined using the contents of the string. See
@code{SIZE_TYPE} above for more information.
If you don't define this macro, the default is @code{"long int"}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac WCHAR_TYPE
1996-09-25 01:21:45 +02:00
A C expression for a string describing the name of the data type to use
for wide characters. The typedef name @code{wchar_t} is defined using
the contents of the string. See @code{SIZE_TYPE} above for more
information.
If you don't define this macro, the default is @code{"int"}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac WCHAR_TYPE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bits of the data type for wide
characters. This is used in @code{cpp}, which cannot make use of
@code{WCHAR_TYPE}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac WINT_TYPE
A C expression for a string describing the name of the data type to
use for wide characters passed to @code{printf} and returned from
@code{getwc}. The typedef name @code{wint_t} is defined using the
contents of the string. See @code{SIZE_TYPE} above for more
information.
If you don't define this macro, the default is @code{"unsigned int"}.
@end defmac
@defmac INTMAX_TYPE
A C expression for a string describing the name of the data type that
can represent any value of any standard or extended signed integer type.
The typedef name @code{intmax_t} is defined using the contents of the
string. See @code{SIZE_TYPE} above for more information.
If you don't define this macro, the default is the first of
@code{"int"}, @code{"long int"}, or @code{"long long int"} that has as
much precision as @code{long long int}.
@end defmac
@defmac UINTMAX_TYPE
A C expression for a string describing the name of the data type that
can represent any value of any standard or extended unsigned integer
type. The typedef name @code{uintmax_t} is defined using the contents
of the string. See @code{SIZE_TYPE} above for more information.
If you don't define this macro, the default is the first of
@code{"unsigned int"}, @code{"long unsigned int"}, or @code{"long long
unsigned int"} that has as much precision as @code{long long unsigned
int}.
@end defmac
re PR c/448 (<stdint.h>-related issues (C99 issues)) PR c/448 fixincludes: * inclhack.def (newlib_stdint_1, newlib_stdint_2): New fixes. * fixincl.x: Regenerate. * tests/base/stdint.h: Update. gcc: * Makefile.in (USE_GCC_STDINT): Define. (stmp-int-hdrs): Install stdint.h if applicable. * c-common.c (CHAR16_TYPE): Define in terms of UINT_LEAST16_TYPE if known. (CHAR32_TYPE): Define in terms of UINT_LEAST32_TYPE if known. (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. (c_common_nodes_and_builtins): Initialize underlying_wchar_type_node. Do not initialize signed_wchar_type_node or unsigned_wchar_type_node. Initialize nodes for new types. (c_stddef_cpp_builtins): Define macros for new types. * c-common.h (CTI_SIGNED_WCHAR_TYPE, CTI_UNSIGNED_WCHAR_TYPE): Remove. (CTI_UNDERLYING_WCHAR_TYPE, CTI_SIG_ATOMIC_TYPE, CTI_INT8_TYPE, CTI_INT16_TYPE, CTI_INT32_TYPE, CTI_INT64_TYPE, CTI_UINT8_TYPE, CTI_UINT16_TYPE, CTI_UINT32_TYPE, CTI_UINT64_TYPE, CTI_INT_LEAST8_TYPE, CTI_INT_LEAST16_TYPE, CTI_INT_LEAST32_TYPE, CTI_INT_LEAST64_TYPE, CTI_UINT_LEAST8_TYPE, CTI_UINT_LEAST16_TYPE, CTI_UINT_LEAST32_TYPE, CTI_UINT_LEAST64_TYPE, CTI_INT_FAST8_TYPE, CTI_INT_FAST16_TYPE, CTI_INT_FAST32_TYPE, CTI_INT_FAST64_TYPE, CTI_UINT_FAST8_TYPE, CTI_UINT_FAST16_TYPE, CTI_UINT_FAST32_TYPE, CTI_UINT_FAST64_TYPE, CTI_INTPTR_TYPE, CTI_UINTPTR_TYPE): Define. (signed_wchar_type_node, unsigned_wchar_type_node): Remove. (underlying_wchar_type_node, sig_atomic_type_node, int8_type_node, int16_type_node, int32_type_node, int64_type_node, uint8_type_node, uint16_type_node, c_uint32_type_node, c_uint64_type_node, int_least8_type_node, int_least16_type_node, int_least32_type_node, int_least64_type_node, uint_least8_type_node, uint_least16_type_node, uint_least32_type_node, uint_least64_type_node, int_fast8_type_node, int_fast16_type_node, int_fast32_type_node, int_fast64_type_node, uint_fast8_type_node, uint_fast16_type_node, uint_fast32_type_node, uint_fast64_type_node, intptr_type_node, uintptr_type_node): Define. * c-cppbuiltin.c (builtin_define_constants, builtin_define_type_minmax): New. (builtin_define_stdint_macros): Define more macros. (c_cpp_builtins): Define more limit macros. (type_suffix): New. (builtin_define_type_max): Define in terms of builtin_define_type_minmax. Remove is_long parameter. All callers changed. * config.gcc (use_gcc_stdint): Define. (tm_file): Add glibc-stdint.h for targets using glibc or uClibc. Add newlib-stdint.h for generic targets. * config/glibc-stdint.h, config/newlib-stdint.h, ginclude/stdint-gcc.h, ginclude/stdint-wrap.h: New. * config/m32c/m32c.h (UINTPTR_TYPE): Define. * config/score/score.h (UINTPTR_TYPE): Define. * config/sol2.h (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Define. * config/spu/spu.h (STDINT_LONG32): Define. * configure.ac (use_gcc_stdint): Substitute. * configure: Regenerate. * doc/cpp.texi (__SIG_ATOMIC_TYPE__, __INT8_TYPE__, __INT16_TYPE__, __INT32_TYPE__, __INT64_TYPE__, __UINT8_TYPE__, __UINT16_TYPE__, __UINT32_TYPE__, __UINT64_TYPE__, __INT_LEAST8_TYPE__, __INT_LEAST16_TYPE__, __INT_LEAST32_TYPE__, __INT_LEAST64_TYPE__, __UINT_LEAST8_TYPE__, __UINT_LEAST16_TYPE__, __UINT_LEAST32_TYPE_, __UINT_LEAST64_TYPE__, __INT_FAST8_TYPE__, __INT_FAST16_TYPE__, __INT_FAST32_TYPE__, __INT_FAST64_TYPE__, __UINT_FAST8_TYPE__, __UINT_FAST16_TYPE__, __UINT_FAST32_TYPE__, __UINT_FAST64_TYPE__, __INTPTR_TYPE__, __UINTPTR_TYPE__, __WINT_MAX__, __SIZE_MAX__, __PTRDIFF_MAX__, __UINTMAX_MAX__, __SIG_ATOMIC_MAX__, __INT8_MAX__, __INT16_MAX__, __INT32_MAX__, __INT64_MAX__, __UINT8_MAX__, __UINT16_MAX__, __UINT32_MAX__, __UINT64_MAX__, __INT_LEAST8_MAX__, __INT_LEAST16_MAX__, __INT_LEAST32_MAX__, __INT_LEAST64_MAX__, __UINT_LEAST8_MAX__, __UINT_LEAST16_MAX__, __UINT_LEAST32_MAX__, __UINT_LEAST64_MAX__, __INT_FAST8_MAX__, __INT_FAST16_MAX__, __INT_FAST32_MAX__, __INT_FAST64_MAX__, __UINT_FAST8_MAX__, __UINT_FAST16_MAX__, __UINT_FAST32_MAX__, __UINT_FAST64_MAX__, __INTPTR_MAX__, __UINTPTR_MAX__, __WCHAR_MIN__, __WINT_MIN__, __SIG_ATOMIC_MIN__, __INT8_C, __INT16_C, __INT32_C, __INT64_C, __UINT8_C, __UINT16_C, __UINT32_C, __UINT64_C, __INTMAX_C, __UINTMAX_C): Document. * doc/tm.texi (SIG_ATOMIC_TYPE, INT8_TYPE, INT16_TYPE, INT32_TYPE, INT64_TYPE, UINT8_TYPE, UINT16_TYPE, UINT32_TYPE, UINT64_TYPE, INT_LEAST8_TYPE, INT_LEAST16_TYPE, INT_LEAST32_TYPE, INT_LEAST64_TYPE, UINT_LEAST8_TYPE, UINT_LEAST16_TYPE, UINT_LEAST32_TYPE, UINT_LEAST64_TYPE, INT_FAST8_TYPE, INT_FAST16_TYPE, INT_FAST32_TYPE, INT_FAST64_TYPE, UINT_FAST8_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE, UINT_FAST64_TYPE, INTPTR_TYPE, UINTPTR_TYPE): Document. gcc/testsuite: * lib/target-supports.exp (check_effective_target_stdint_types): Update comment. (check_effective_target_inttypes_types): New. * gcc.dg/c99-stdint-1.c, gcc.dg/c99-stdint-2.c, gcc.dg/c99-stdint-3.c, gcc.dg/c99-stdint-4.c, gcc.dg/c99-stdint-5.c, gcc.dg/c99-stdint-6.c: New tests. From-SVN: r145372
2009-03-31 22:30:31 +02:00
@defmac SIG_ATOMIC_TYPE
@defmacx INT8_TYPE
@defmacx INT16_TYPE
@defmacx INT32_TYPE
@defmacx INT64_TYPE
@defmacx UINT8_TYPE
@defmacx UINT16_TYPE
@defmacx UINT32_TYPE
@defmacx UINT64_TYPE
@defmacx INT_LEAST8_TYPE
@defmacx INT_LEAST16_TYPE
@defmacx INT_LEAST32_TYPE
@defmacx INT_LEAST64_TYPE
@defmacx UINT_LEAST8_TYPE
@defmacx UINT_LEAST16_TYPE
@defmacx UINT_LEAST32_TYPE
@defmacx UINT_LEAST64_TYPE
@defmacx INT_FAST8_TYPE
@defmacx INT_FAST16_TYPE
@defmacx INT_FAST32_TYPE
@defmacx INT_FAST64_TYPE
@defmacx UINT_FAST8_TYPE
@defmacx UINT_FAST16_TYPE
@defmacx UINT_FAST32_TYPE
@defmacx UINT_FAST64_TYPE
@defmacx INTPTR_TYPE
@defmacx UINTPTR_TYPE
C expressions for the standard types @code{sig_atomic_t},
@code{int8_t}, @code{int16_t}, @code{int32_t}, @code{int64_t},
@code{uint8_t}, @code{uint16_t}, @code{uint32_t}, @code{uint64_t},
@code{int_least8_t}, @code{int_least16_t}, @code{int_least32_t},
@code{int_least64_t}, @code{uint_least8_t}, @code{uint_least16_t},
@code{uint_least32_t}, @code{uint_least64_t}, @code{int_fast8_t},
@code{int_fast16_t}, @code{int_fast32_t}, @code{int_fast64_t},
@code{uint_fast8_t}, @code{uint_fast16_t}, @code{uint_fast32_t},
@code{uint_fast64_t}, @code{intptr_t}, and @code{uintptr_t}. See
@code{SIZE_TYPE} above for more information.
If any of these macros evaluates to a null pointer, the corresponding
type is not supported; if GCC is configured to provide
@code{<stdint.h>} in such a case, the header provided may not conform
to C99, depending on the type in question. The defaults for all of
these macros are null pointers.
@end defmac
@defmac TARGET_PTRMEMFUNC_VBIT_LOCATION
The C++ compiler represents a pointer-to-member-function with a struct
that looks like:
@smallexample
struct @{
union @{
void (*fn)();
ptrdiff_t vtable_index;
@};
ptrdiff_t delta;
@};
@end smallexample
@noindent
The C++ compiler must use one bit to indicate whether the function that
will be called through a pointer-to-member-function is virtual.
Normally, we assume that the low-order bit of a function pointer must
always be zero. Then, by ensuring that the vtable_index is odd, we can
distinguish which variant of the union is in use. But, on some
platforms function pointers can be odd, and so this doesn't work. In
that case, we use the low-order bit of the @code{delta} field, and shift
the remainder of the @code{delta} field to the left.
GCC will automatically make the right selection about where to store
this bit using the @code{FUNCTION_BOUNDARY} setting for your platform.
However, some platforms such as ARM/Thumb have @code{FUNCTION_BOUNDARY}
set such that functions always start at even addresses, but the lowest
bit of pointers to functions indicate whether the function at that
address is in ARM or Thumb mode. If this is the case of your
architecture, you should define this macro to
@code{ptrmemfunc_vbit_in_delta}.
In general, you should not have to define this macro. On architectures
in which function addresses are always even, according to
@code{FUNCTION_BOUNDARY}, GCC will automatically define this macro to
@code{ptrmemfunc_vbit_in_pfn}.
@end defmac
@defmac TARGET_VTABLE_USES_DESCRIPTORS
Normally, the C++ compiler uses function pointers in vtables. This
macro allows the target to change to use ``function descriptors''
instead. Function descriptors are found on targets for whom a
function pointer is actually a small data structure. Normally the
data structure consists of the actual code address plus a data
pointer to which the function's data is relative.
If vtables are used, the value of this macro should be the number
of words that the function descriptor occupies.
@end defmac
@defmac TARGET_VTABLE_ENTRY_ALIGN
By default, the vtable entries are void pointers, the so the alignment
is the same as pointer alignment. The value of this macro specifies
the alignment of the vtable entry in bits. It should be defined only
when special alignment is necessary. */
@end defmac
@defmac TARGET_VTABLE_DATA_ENTRY_DISTANCE
There are a few non-descriptor entries in the vtable at offsets below
zero. If these entries must be padded (say, to preserve the alignment
specified by @code{TARGET_VTABLE_ENTRY_ALIGN}), set this to the number
of words in each data entry.
@end defmac
2001-06-26 08:36:44 +02:00
1996-09-25 01:21:45 +02:00
@node Registers
@section Register Usage
@cindex register usage
This section explains how to describe what registers the target machine
has, and how (in general) they can be used.
The description of which registers a specific instruction can use is
done with register classes; see @ref{Register Classes}. For information
on using registers to access a stack frame, see @ref{Frame Registers}.
For passing values in registers, see @ref{Register Arguments}.
For returning values in registers, see @ref{Scalar Return}.
@menu
* Register Basics:: Number and kinds of registers.
* Allocation Order:: Order in which registers are allocated.
* Values in Registers:: What kinds of values each reg can hold.
* Leaf Functions:: Renumbering registers for leaf functions.
* Stack Registers:: Handling a register stack such as 80387.
1996-09-25 01:21:45 +02:00
@end menu
@node Register Basics
@subsection Basic Characteristics of Registers
@c prevent bad page break with this line
Registers have various characteristics.
@defmac FIRST_PSEUDO_REGISTER
1996-09-25 01:21:45 +02:00
Number of hardware registers known to the compiler. They receive
numbers 0 through @code{FIRST_PSEUDO_REGISTER-1}; thus, the first
pseudo register's number really is assigned the number
@code{FIRST_PSEUDO_REGISTER}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FIXED_REGISTERS
1996-09-25 01:21:45 +02:00
@cindex fixed register
An initializer that says which registers are used for fixed purposes
all throughout the compiled code and are therefore not available for
general allocation. These would include the stack pointer, the frame
pointer (except on machines where that can be used as a general
register when no frame pointer is needed), the program counter on
machines where that is considered one of the addressable registers,
and any other numbered register with a standard use.
This information is expressed as a sequence of numbers, separated by
commas and surrounded by braces. The @var{n}th number is 1 if
register @var{n} is fixed, 0 otherwise.
The table initialized from this macro, and the table initialized by
the following one, may be overridden at run time either automatically,
by the actions of the macro @code{CONDITIONAL_REGISTER_USAGE}, or by
the user with the command options @option{-ffixed-@var{reg}},
@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CALL_USED_REGISTERS
1996-09-25 01:21:45 +02:00
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
Like @code{FIXED_REGISTERS} but has 1 for each register that is
clobbered (in general) by function calls as well as for fixed
registers. This macro therefore identifies the registers that are not
available for general allocation of values that must live across
function calls.
If a register has 0 in @code{CALL_USED_REGISTERS}, the compiler
automatically saves it on function entry and restores it on function
exit, if the register is used within the function.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CALL_REALLY_USED_REGISTERS
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
Like @code{CALL_USED_REGISTERS} except this macro doesn't require
that the entire set of @code{FIXED_REGISTERS} be included.
(@code{CALL_USED_REGISTERS} must be a superset of @code{FIXED_REGISTERS}).
This macro is optional. If not specified, it defaults to the value
of @code{CALL_USED_REGISTERS}.
@end defmac
@defmac HARD_REGNO_CALL_PART_CLOBBERED (@var{regno}, @var{mode})
@cindex call-used register
@cindex call-clobbered register
@cindex call-saved register
A C expression that is nonzero if it is not permissible to store a
value of mode @var{mode} in hard register number @var{regno} across a
call without some part of it being clobbered. For most machines this
macro need not be defined. It is only required for machines that do not
preserve the entire contents of a register across a call.
@end defmac
1996-09-25 01:21:45 +02:00
@findex fixed_regs
@findex call_used_regs
@findex global_regs
@findex reg_names
@findex reg_class_contents
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
@deftypefn {Target Hook} void TARGET_CONDITIONAL_REGISTER_USAGE (void)
This hook may conditionally modify five variables
@code{fixed_regs}, @code{call_used_regs}, @code{global_regs},
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@code{reg_names}, and @code{reg_class_contents}, to take into account
any dependence of these register sets on target flags. The first three
of these are of type @code{char []} (interpreted as Boolean vectors).
@code{global_regs} is a @code{const char *[]}, and
@code{reg_class_contents} is a @code{HARD_REG_SET}. Before the macro is
called, @code{fixed_regs}, @code{call_used_regs},
@code{reg_class_contents}, and @code{reg_names} have been initialized
from @code{FIXED_REGISTERS}, @code{CALL_USED_REGISTERS},
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@code{REG_CLASS_CONTENTS}, and @code{REGISTER_NAMES}, respectively.
@code{global_regs} has been cleared, and any @option{-ffixed-@var{reg}},
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@option{-fcall-used-@var{reg}} and @option{-fcall-saved-@var{reg}}
command options have been applied.
1996-09-25 01:21:45 +02:00
@cindex disabling certain registers
@cindex controlling register usage
If the usage of an entire class of registers depends on the target
flags, you may indicate this to GCC by using this macro to modify
@code{fixed_regs} and @code{call_used_regs} to 1 for each of the
registers in the classes which should not be used by GCC@. Also make
@code{define_register_constraint}s return @code{NO_REGS} for constraints
that shouldn't be used.
1996-09-25 01:21:45 +02:00
(However, if this class is not included in @code{GENERAL_REGS} and all
of the insn patterns whose constraints permit this class are
controlled by target switches, then GCC will automatically avoid using
these registers when the target switches are opposed to them.)
target.def (conditional_register_usage): Define. * target.def (conditional_register_usage): Define. * reginfo.c (init_reg_sets_1): Call targetm.conditional_register_usage. * system.h (CONDITIONAL_REGISTER_USAGE): Poison. * doc/tm.texi.in (CONDITIONAL_REGISTER_USAGE): Adjust language for making it a hook. * doc/tm.texi: Regenerate. * config/alpha/alpha.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/alpha/alpha.c (alpha_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arc/arc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arc/arc.c (arc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/arm/arm.c (arm_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/bfin/bfin.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/bfin/bfin-protos.h (conditional_register_usage): Delete. * config/bfin/bfin.c (conditional_register_usage): Move code into... (bfin_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/cris/cris.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/cris/cris-protos.h (cris_conditional_register_usage): Delete. * config/cris/cris.c (cris_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/fr30/fr30.h (FIXED_REGISTERS): Adjust comment. * config/frv/frv.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/frv/frv-protos.h (frv_conditional_register_usage): Delete. * config/frv/frv.c (frv_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/h8300/h8300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/h8300/h8300.c (h8300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/i386/i386-protos.h (ix86_conditional_register_usage): Delete. * config/i386/i386.c (ix86_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32c/m32c.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m32c/m32c-protos.h (m32c_conditional_register_usage): Delete. * config/m32c/m32c.c (m32c_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m32r/m32r.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/m32r/m32r.c (m32r_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/m68hc11/m68hc11.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_conditional_register_usage): Delete. * config/m68hc11/m68hc11.c (m68hc11_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mep/mep.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mep/mep-protos.h (mep_conditional_register_usage): Delete. * config/mep/mep.c (mep_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mips/mips.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mips/mips-protos.h (mips_conditional_register_usage): Delete. * config/mips/mips.c (mips_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mmix/mmix.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/mmix/mmix-protos.h (mmix_conditional_register_usage): Delete. * config/mmix/mmix.c (mmix_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/mn10300/mn10300.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/mn10300/mn10300.c (mn10300_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pa/pa32-regs.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pa/pa64-regs.h (CONDITIONAL_REGISTER_USAGE): ...with this... * config/pa/pa.c (pa_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/pdp11/pdp11.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/pdp11/pdp11.c (pdp11_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rs6000/rs6000-protos.h (rs6000_conditional_register_usage): Delete. * config/rs6000/rs6000.c (rs6000_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/rx/rx.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/rx/rx-protos.h (rx_conditional_register_usage): Delete. * config/rx/rx.c (rx_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/s390/s390-protos.h (s390_conditional_register_usage): Delete. * config/s390/s390.c (s390_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/score/score.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/score/score.c (score_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sh/sh.c (sh_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/sparc/sparc.c (sparc_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/spu/spu.h (CONDITIONAL_REGISTER_USAGE): Delete. * config/spu/spu-protos.h (spu_conditional_register_usage): Delete. * config/spu/spu.c (spu_conditional_register_usage): Make static. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. * config/v850/v850.h (CONDITIONAL_REGISTER_USAGE): Move logic... * config/v850/v850.c (v850_conditional_register_usage): ...here. New function. (TARGET_CONDITIONAL_REGISTER_USAGE): Define. From-SVN: r167020
2010-11-22 02:57:50 +01:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac INCOMING_REGNO (@var{out})
1996-09-25 01:21:45 +02:00
Define this macro if the target machine has register windows. This C
expression returns the register number as seen by the called function
corresponding to the register number @var{out} as seen by the calling
function. Return @var{out} if register number @var{out} is not an
outbound register.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac OUTGOING_REGNO (@var{in})
1996-09-25 01:21:45 +02:00
Define this macro if the target machine has register windows. This C
expression returns the register number as seen by the calling function
corresponding to the register number @var{in} as seen by the called
function. Return @var{in} if register number @var{in} is not an inbound
register.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LOCAL_REGNO (@var{regno})
Define this macro if the target machine has register windows. This C
expression returns true if the register is call-saved but is in the
register window. Unlike most call-saved registers, such registers
need not be explicitly restored on function exit or during non-local
gotos.
@end defmac
@defmac PC_REGNUM
1996-09-25 01:21:45 +02:00
If the program counter has a register number, define this as that
register number. Otherwise, do not define it.
@end defmac
1996-09-25 01:21:45 +02:00
@node Allocation Order
@subsection Order of Allocation of Registers
@cindex order of register allocation
@cindex register allocation order
@c prevent bad page break with this line
Registers are allocated in order.
@defmac REG_ALLOC_ORDER
1996-09-25 01:21:45 +02:00
If defined, an initializer for a vector of integers, containing the
numbers of hard registers in the order in which GCC should prefer
1996-09-25 01:21:45 +02:00
to use them (from most preferred to least).
If this macro is not defined, registers are used lowest numbered first
(all else being equal).
One use of this macro is on machines where the highest numbered
registers must always be saved and the save-multiple-registers
instruction supports only sequences of consecutive registers. On such
machines, define @code{REG_ALLOC_ORDER} to be an initializer that lists
1997-12-07 01:31:01 +01:00
the highest numbered allocable register first.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ADJUST_REG_ALLOC_ORDER
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to choose the order in which to allocate
hard registers for pseudo-registers local to a basic block.
Store the desired register order in the array @code{reg_alloc_order}.
Element 0 should be the register to allocate first; element 1, the next
register; and so on.
The macro body should not assume anything about the contents of
@code{reg_alloc_order} before execution of the macro.
On most machines, it is not necessary to define this macro.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HONOR_REG_ALLOC_ORDER
Normally, IRA tries to estimate the costs for saving a register in the
prologue and restoring it in the epilogue. This discourages it from
using call-saved registers. If a machine wants to ensure that IRA
allocates registers in the order given by REG_ALLOC_ORDER even if some
call-saved registers appear earlier than call-used ones, then define this
macro as a C expression to nonzero. Default is 0.
@end defmac
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
@defmac IRA_HARD_REGNO_ADD_COST_MULTIPLIER (@var{regno})
In some case register allocation order is not enough for the
Integrated Register Allocator (@acronym{IRA}) to generate a good code.
If this macro is defined, it should return a floating point value
based on @var{regno}. The cost of using @var{regno} for a pseudo will
be increased by approximately the pseudo's usage frequency times the
value returned by this macro. Not defining this macro is equivalent
to having it always return @code{0.0}.
On most machines, it is not necessary to define this macro.
@end defmac
1996-09-25 01:21:45 +02:00
@node Values in Registers
@subsection How Values Fit in Registers
This section discusses the macros that describe which kinds of values
(specifically, which machine modes) each register can hold, and how many
consecutive registers are needed for a given mode.
@defmac HARD_REGNO_NREGS (@var{regno}, @var{mode})
1996-09-25 01:21:45 +02:00
A C expression for the number of consecutive hard registers, starting
at register number @var{regno}, required to hold a value of mode
@var{mode}. This macro must never return zero, even if a register
cannot hold the requested mode - indicate that with HARD_REGNO_MODE_OK
and/or CANNOT_CHANGE_MODE_CLASS instead.
1996-09-25 01:21:45 +02:00
On a machine where all registers are exactly one word, a suitable
definition of this macro is
@smallexample
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \
/ UNITS_PER_WORD)
1996-09-25 01:21:45 +02:00
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HARD_REGNO_NREGS_HAS_PADDING (@var{regno}, @var{mode})
A C expression that is nonzero if a value of mode @var{mode}, stored
in memory, ends with padding that causes it to take up more space than
in registers starting at register number @var{regno} (as determined by
multiplying GCC's notion of the size of the register when containing
this mode by the number of registers returned by
@code{HARD_REGNO_NREGS}). By default this is zero.
For example, if a floating-point value is stored in three 32-bit
registers but takes up 128 bits in memory, then this would be
nonzero.
This macros only needs to be defined if there are cases where
@code{subreg_get_info}
would otherwise wrongly determine that a @code{subreg} can be
represented by an offset to the register number, when in fact such a
@code{subreg} would contain some of the padding not stored in
registers and so not be representable.
@end defmac
@defmac HARD_REGNO_NREGS_WITH_PADDING (@var{regno}, @var{mode})
For values of @var{regno} and @var{mode} for which
@code{HARD_REGNO_NREGS_HAS_PADDING} returns nonzero, a C expression
returning the greater number of registers required to hold the value
including any padding. In the example above, the value would be four.
@end defmac
@defmac REGMODE_NATURAL_SIZE (@var{mode})
Define this macro if the natural size of registers that hold values
of mode @var{mode} is not the word size. It is a C expression that
should give the natural size in bytes for the specified mode. It is
used by the register allocator to try to optimize its results. This
happens for example on SPARC 64-bit where the natural size of
floating-point registers is still 32-bit.
@end defmac
@defmac HARD_REGNO_MODE_OK (@var{regno}, @var{mode})
1996-09-25 01:21:45 +02:00
A C expression that is nonzero if it is permissible to store a value
of mode @var{mode} in hard register number @var{regno} (or in several
registers starting with that one). For a machine where all registers
are equivalent, a suitable definition is
@smallexample
#define HARD_REGNO_MODE_OK(REGNO, MODE) 1
@end smallexample
You need not include code to check for the numbers of fixed registers,
because the allocation mechanism considers them to be always occupied.
1996-09-25 01:21:45 +02:00
@cindex register pairs
On some machines, double-precision values must be kept in even/odd
register pairs. You can implement that by defining this macro to reject
odd register numbers for such modes.
1996-09-25 01:21:45 +02:00
The minimum requirement for a mode to be OK in a register is that the
@samp{mov@var{mode}} instruction pattern support moves between the
register and other hard register in the same class and that moving a
value into the register and back out not alter it.
1996-09-25 01:21:45 +02:00
Since the same instruction used to move @code{word_mode} will work for
all narrower integer modes, it is not necessary on any machine for
1996-09-25 01:21:45 +02:00
@code{HARD_REGNO_MODE_OK} to distinguish between these modes, provided
you define patterns @samp{movhi}, etc., to take advantage of this. This
is useful because of the interaction between @code{HARD_REGNO_MODE_OK}
and @code{MODES_TIEABLE_P}; it is very desirable for all integer modes
to be tieable.
Many machines have special registers for floating point arithmetic.
Often people assume that floating point machine modes are allowed only
in floating point registers. This is not true. Any registers that
can hold integers can safely @emph{hold} a floating point machine
mode, whether or not floating arithmetic can be done on it in those
registers. Integer move instructions can be used to move the values.
On some machines, though, the converse is true: fixed-point machine
modes may not go in floating registers. This is true if the floating
registers normalize any value stored in them, because storing a
non-floating value there would garble it. In this case,
@code{HARD_REGNO_MODE_OK} should reject fixed-point machine modes in
floating registers. But if the floating registers do not automatically
normalize, if you can store any bit pattern in one and retrieve it
unchanged without a trap, then any machine mode may go in a floating
register, so you can define this macro to say so.
The primary significance of special floating registers is rather that
they are the registers acceptable in floating point arithmetic
instructions. However, this is of no concern to
@code{HARD_REGNO_MODE_OK}. You handle it by writing the proper
constraints for those instructions.
On some machines, the floating registers are especially slow to access,
so that it is better to store a value in a stack frame than in such a
register if floating point arithmetic is not being done. As long as the
floating registers are not in class @code{GENERAL_REGS}, they will not
be used unless some pattern's constraint asks for one.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HARD_REGNO_RENAME_OK (@var{from}, @var{to})
A C expression that is nonzero if it is OK to rename a hard register
@var{from} to another hard register @var{to}.
One common use of this macro is to prevent renaming of a register to
another register that is not saved by a prologue in an interrupt
handler.
The default is always nonzero.
@end defmac
@defmac MODES_TIEABLE_P (@var{mode1}, @var{mode2})
A C expression that is nonzero if a value of mode
1997-12-07 01:31:01 +01:00
@var{mode1} is accessible in mode @var{mode2} without copying.
1996-09-25 01:21:45 +02:00
If @code{HARD_REGNO_MODE_OK (@var{r}, @var{mode1})} and
@code{HARD_REGNO_MODE_OK (@var{r}, @var{mode2})} are always the same for
any @var{r}, then @code{MODES_TIEABLE_P (@var{mode1}, @var{mode2})}
should be nonzero. If they differ for any @var{r}, you should define
this macro to return zero unless some other mechanism ensures the
1997-12-07 01:31:01 +01:00
accessibility of the value in a narrower mode.
You should define this macro to return nonzero in as many cases as
possible since doing so will allow GCC to perform better register
allocation.
@end defmac
@deftypefn {Target Hook} bool TARGET_HARD_REGNO_SCRATCH_OK (unsigned int @var{regno})
This target hook should return @code{true} if it is OK to use a hard register
@var{regno} as scratch reg in peephole2.
One common use of this macro is to prevent using of a register that
is not saved by a prologue in an interrupt handler.
The default version of this hook always returns @code{true}.
@end deftypefn
@defmac AVOID_CCMODE_COPIES
Define this macro if the compiler should avoid copies to/from @code{CCmode}
registers. You should only define this macro if support for copying to/from
@code{CCmode} is incomplete.
@end defmac
1996-09-25 01:21:45 +02:00
@node Leaf Functions
@subsection Handling Leaf Functions
@cindex leaf functions
@cindex functions, leaf
On some machines, a leaf function (i.e., one which makes no calls) can run
more efficiently if it does not make its own register window. Often this
means it is required to receive its arguments in the registers where they
are passed by the caller, instead of the registers where they would
normally arrive.
The special treatment for leaf functions generally applies only when
other conditions are met; for example, often they may use only those
registers for its own variables and temporaries. We use the term ``leaf
function'' to mean a function that is suitable for this special
handling, so that functions with no calls are not necessarily ``leaf
functions''.
GCC assigns register numbers before it knows whether the function is
1996-09-25 01:21:45 +02:00
suitable for leaf function treatment. So it needs to renumber the
registers in order to output a leaf function. The following macros
accomplish this.
@defmac LEAF_REGISTERS
sibcall.c (skip_copy_to_return_value): Use OUTGOING_REGNO for comparison if regno's are equal. * sibcall.c (skip_copy_to_return_value): Use OUTGOING_REGNO for comparison if regno's are equal. * calls.c (initialize_argument_informat): Add ecf_flags argument. Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. (expand_call): Update caller. Avoid making a sibling call if argument size of the callee is larger than argument size of the caller. Call hard_function_value with outgoing set if in sibcall pass. Use FUNCTION_INCOMING_ARG if available and ECF_SIBCALL. * final.c (permitted_reg_in_leaf_functions, only_leaf_regs_used): Change LEAF_REGISTERS from an array initializer to actual array identifier. Move static global variable into the function. (leaf_function_p): Allow SIBLING_CALL_P calls even outside of sequences for leaf functions. * global.c (global_alloc): Likewise. * tm.texi (LEAF_REGISTERS): Update documentation. * config/sparc/sparc.h (CONDITIONAL_REGISTER_USAGE): Remove the ugly TARGET_FLAT leaf disabling hack. (LEAF_REGISTERS): Changed from an array initializer to actual array identifier to avoid duplication and remove the above hack. (FUNCTION_OK_FOR_SIBCALL): Define. * config/sparc/sparc.md (sibcall): New attr type. Use it almost always like call attribute. (eligible_for_sibcall_delay): New attribute. (sibcall): New delay type. (sibcall, sibcall_value, sibcall_epilogue): New expands. (sibcall_symbolic_sp32, sibcall_symbolic_sp64, sibcall_value_symbolic_sp32, sibcall_value_symbolic_sp64): New insns. * config/sparc/sparc.c (sparc_leaf_regs): New array. (eligible_for_sibcall_delay, output_restore_regs, output_sibcall): New functions. (output_function_epilogue): Move part of the code into output_restore_regs. (ultra_code_from_mask, ultrasparc_sched_reorder): Handle TYPE_SIBCALL. * sparc-protos.h (output_sibcall, eligible_for_sibcall_delay): New prototypes. From-SVN: r32730
2000-03-24 22:48:01 +01:00
Name of a char vector, indexed by hard register number, which
1996-09-25 01:21:45 +02:00
contains 1 for a register that is allowable in a candidate for leaf
function treatment.
If leaf function treatment involves renumbering the registers, then the
registers marked here should be the ones before renumbering---those that
GCC would ordinarily allocate. The registers which will actually be
1996-09-25 01:21:45 +02:00
used in the assembler code, after renumbering, should not be marked with 1
in this vector.
Define this macro only if the target machine offers a way to optimize
the treatment of leaf functions.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LEAF_REG_REMAP (@var{regno})
1996-09-25 01:21:45 +02:00
A C expression whose value is the register number to which @var{regno}
should be renumbered, when a function is treated as a leaf function.
If @var{regno} is a register number which should not appear in a leaf
function before renumbering, then the expression should yield @minus{}1, which
1996-09-25 01:21:45 +02:00
will cause the compiler to abort.
Define this macro only if the target machine offers a way to optimize the
treatment of leaf functions, and registers need to be renumbered to do
this.
@end defmac
1996-09-25 01:21:45 +02:00
@findex current_function_is_leaf
@findex current_function_uses_only_leaf_regs
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@code{TARGET_ASM_FUNCTION_PROLOGUE} and
@code{TARGET_ASM_FUNCTION_EPILOGUE} must usually treat leaf functions
specially. They can test the C variable @code{current_function_is_leaf}
which is nonzero for leaf functions. @code{current_function_is_leaf} is
set prior to local register allocation and is valid for the remaining
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
compiler passes. They can also test the C variable
@code{current_function_uses_only_leaf_regs} which is nonzero for leaf
functions which only use leaf registers.
RTL prologue/epilogue for SPARC RTL prologue/epilogue for SPARC * config/sparc/sparc-protos.h (sparc_emitting_epilogue): Delete. (sparc_skip_caller_unimp): Likewise. (load_pic_register): Likewise. (leaf_return_peephole_ok): Likewise. (compute_frame_size): Rename into sparc_compute_frame_size. (sparc_expand_prologue): New prototype. (sparc_expand_epilogue): Likewise. (output_return): Likewise. (eligible_for_epilogue_delay): Rename into eligible_for_return_delay. * config/sparc/sparc.h (INITIAL_ELIMINATION_OFFSET): Adjust call to compute_frame_size. Move comment up. (DELAY_SLOTS_FOR_EPILOGUE): Delete. (ELIGIBLE_FOR_EPILOGUE_DELAY): Likewise. (EPILOGUE_USES): Return true for %g1 if the function uses EH return. * config/sparc/sparc.md (UNSPECV_SAVEW): New constant. (type attribute): Add 'return' and 'savew'. (eligible_for_return_delay): New attribute. (return): New delay_slot. (sibcall_epilogue): Call sparc_expand_epilogue. (prologue): Likewise. Move up. (save_register_window): New expander. (save_register_windowsi): New pattern. (save_register_windowdi): Likewise. (epilogue): New expander. (return_internal): New pattern. (Return peepholes): Delete. * config/sparc/sparc.c (SIBCALL_SLOT_EMPTY_P): New macro. (sparc_emitting_epilogue): Delete. (sparc_skip_caller_unimp): Likewise. (sparc_sr_alias_set): New global variable. (frame_base_name): Delete. (frame_base_reg): New global variable. (sparc_override_options): Get new alias set for save/restore. (leaf_return_peephole_ok): Delete. (eligible_for_epilogue_delay): Rename into eligible_for_return_delay. Factor out code into eligible_for_restore_insn_delay. (eligible_for_restore_insn_delay): New function extraced from above. Use IN_UNCOND_BRANCH_DELAY_TRUE instead of IN_BRANCH_DELAY_TRUE. (eligible_for_sibcall_delay): Use SIBCALL_SLOT_EMPTY_P. Factor out code into eligible_for_restore_insn_delay. (load_pic_register): Make static. Remove check. (save_regs): Delete. (restore_regs): Likewise. (compute_frame_size): Rename into sparc_compute_frame_size. Rename leaf_function into leaf_function_p. (build_big_number): Delete. (save_or_restore_regs): New function. (emit_save_regs): Likewise. (emit_restore_regs): Likewise. (emit_stack_pointer_increment ): Likewise. (emit_stack_pointer_decrement): Likewise. (sparc_expand_prologue): Likewise. (sparc_function_prologue): Rename into sparc_asm_function_prologue. Remove all code to emit instructions. (sparc_expand_epilogue): New function. (sparc_function_epilogue): Rename into sparc_asm_function_epilogue. Remove all code to emit instructions. (output_restore): New function. (output_return): Likewise. (output_sibcall): Factor out code into output_restore. (print_operand): Adjust for frame_base_reg. * target.h (struct gcc_target): New field 'late_rtl_prologue_epilogue'. * target-def.h (TARGET_LATE_RTL_PROLOGUE_EPILOGUE): New define. (TARGET_INITIALIZER): Add it. * passes.c (rest_of_compilation): Set the conditional predicate 'current_function_uses_only_leaf_regs' before sched2. If target has 'late_rtl_prologue_epilogue', emit RTL prologue/epilogue right before sched2. * reorg.c (return_insn_p): New predicate. (find_end_label): Use it. (relax_delay_slots): Do not thread an unconditional jump that points to the end return label. * doc/tm.texi (Registers) <Leaf Functions>: Clarify the validity domain of 'current_function_uses_only_leaf_regs'. (Stack and Calling) <Function Entry>: Document new target hook TARGET_LATE_RTL_PROLOGUE_EPILOGUE. From-SVN: r83901
2004-06-30 12:31:30 +02:00
@code{current_function_uses_only_leaf_regs} is valid after all passes
that modify the instructions have been run and is only useful if
@code{LEAF_REGISTERS} is defined.
1996-09-25 01:21:45 +02:00
@c changed this to fix overfull. ALSO: why the "it" at the beginning
@c of the next paragraph?! --mew 2feb93
@node Stack Registers
@subsection Registers That Form a Stack
There are special features to handle computers where some of the
``registers'' form a stack. Stack registers are normally written by
pushing onto the stack, and are numbered relative to the top of the
stack.
1996-09-25 01:21:45 +02:00
Currently, GCC can only handle one group of stack-like registers, and
they must be consecutively numbered. Furthermore, the existing
support for stack-like registers is specific to the 80387 floating
point coprocessor. If you have a new architecture that uses
stack-like registers, you will need to do substantial work on
@file{reg-stack.c} and write your machine description to cooperate
with it, as well as defining these macros.
@defmac STACK_REGS
1996-09-25 01:21:45 +02:00
Define this if the machine has any stack-like registers.
@end defmac
1996-09-25 01:21:45 +02:00
params.def (PARAM_IRA_LOOP_RESERVED_REGS): New. 2009-09-26 Vladimir Makarov <vmakarov@redhat.com> * params.def (PARAM_IRA_LOOP_RESERVED_REGS): New. * params.h (IRA_LOOP_RESERVED_REGS): New * tree-pass.h (pass_subregs_of_mode_init, pass_subregs_of_mode_finish): Remove. * passes.c (pass_subregs_of_mode_init, pass_subregs_of_mode_finish): Remove. (pass_reginfo_init): Move before loop optimizations. * config/i386/i386.h (STACK_REG_COVER_CLASS): Define. * common.opt (fira-loop-pressure): New. * toplev.h (flag_ira_loop_pressure): New. * rtl.h (init_subregs_of_mode, finish_subregs_of_mode): New externals. * reginfo.c (init_subregs_of_mode, finish_subregs_of_mode): Make external and void type functions. (gate_subregs_of_mode_init, pass_subregs_of_mode_init, pass_subregs_of_mode_finish): Remove. * ira-costs.c (init_costs): Call init_subregs_of_mode. * regmove.c: Include ira.h. (regmove_optimize): Call ira_set_pseudo_classes after IRA based register pressure calculation in loops. * loop-invariant.c: Include REGS_H and ira.h. (struct loop_data): New members max_reg_pressure, regs_ref, and regs_live. (struct invariant): New member orig_regno. (curr_loop): New variable. (find_exits): Initialize regs_ref and regs_live. (create_new_invariant): Initialize orig_regno. (get_cover_class_and_nregs): New. (get_inv_cost): Make aregs_needed an array. Use regs_needed as an array. Add code for flag_ira_loop_pressure. (gain_for_invariant): Make new_regs an array. Add code for flag_ira_loop_pressure. (best_gain_for_invariant): Ditto. (set_move_mark): New parameter gain. Use it for debugging output. (find_invariants_to_move): Make regs_needed and new_regs an array. Add code for flag_ira_loop_pressure. (move_invariant_reg): Set up orig_regno. (move_invariants): Set up reg classes for pseudos for flag_ira_loop_pressure. (free_loop_data): Clear regs_ref and regs_live. (curr_regs_live, curr_reg_pressure, regs_set, n_regs_set, get_regno_cover_class, change_pressure, mark_regno_live, mark_regno_death, mark_reg_store, mark_reg_clobber, mark_reg_death, mark_ref_regs, calculate_loop_reg_pressure): New. (move_loop_invariants): Calculate pressure. Initialize curr_loop. * ira.c (ira): Call ira_set_pseudo_classes after IRA based register pressure calculation in loops if new regs were added. Call finish_subregs_of_mode. * opts.c (decode_options): Set up flag_ira_loop_pressure. * Makefile.in (loop-invariant.o): Add ira.h. (regmove.o): Ditto. * doc/invoke.texi (-fira-loop-pressure, ira-loop-reserved-regs): Describe. * doc/tm.texi (STACK_REG_COVER_CLASS): Describe. From-SVN: r152770
2009-10-14 18:24:11 +02:00
@defmac STACK_REG_COVER_CLASS
This is a cover class containing the stack registers. Define this if
the machine has any stack-like registers.
@end defmac
@defmac FIRST_STACK_REG
1996-09-25 01:21:45 +02:00
The number of the first stack-like register. This one is the top
of the stack.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LAST_STACK_REG
1996-09-25 01:21:45 +02:00
The number of the last stack-like register. This one is the bottom of
the stack.
@end defmac
1996-09-25 01:21:45 +02:00
@node Register Classes
@section Register Classes
@cindex register class definitions
@cindex class definitions, register
On many machines, the numbered registers are not all equivalent.
For example, certain registers may not be allowed for indexed addressing;
certain registers may not be allowed in some instructions. These machine
restrictions are described to the compiler using @dfn{register classes}.
You define a number of register classes, giving each one a name and saying
which of the registers belong to it. Then you can specify register classes
that are allowed as operands to particular instruction patterns.
@findex ALL_REGS
@findex NO_REGS
In general, each register will belong to several classes. In fact, one
class must be named @code{ALL_REGS} and contain all the registers. Another
class must be named @code{NO_REGS} and contain no registers. Often the
union of two classes will be another class; however, this is not required.
@findex GENERAL_REGS
One of the classes must be named @code{GENERAL_REGS}. There is nothing
terribly special about the name, but the operand constraint letters
@samp{r} and @samp{g} specify this class. If @code{GENERAL_REGS} is
the same as @code{ALL_REGS}, just define it as a macro which expands
to @code{ALL_REGS}.
Order the classes so that if class @var{x} is contained in class @var{y}
then @var{x} has a lower class number than @var{y}.
The way classes other than @code{GENERAL_REGS} are specified in operand
constraints is through machine-dependent operand constraint letters.
You can define such letters to correspond to various classes, then use
them in operand constraints.
You must define the narrowest register classes for allocatable
registers, so that each class either has no subclasses, or that for
some mode, the move cost between registers within the class is
cheaper than moving a register in the class to or from memory
(@pxref{Costs}).
1996-09-25 01:21:45 +02:00
You should define a class for the union of two classes whenever some
instruction allows both classes. For example, if an instruction allows
either a floating point (coprocessor) register or a general register for a
certain operand, you should define a class @code{FLOAT_OR_GENERAL_REGS}
which includes both of them. Otherwise you will get suboptimal code,
or even internal compiler errors when reload cannot find a register in the
class computed via @code{reg_class_subunion}.
1996-09-25 01:21:45 +02:00
You must also specify certain redundant information about the register
classes: for each class, which classes contain it and which ones are
contained in it; for each pair of classes, the largest class contained
in their union.
When a value occupying several consecutive registers is expected in a
certain class, all the registers used must belong to that class.
Therefore, register classes cannot be used to enforce a requirement for
a register pair to start with an even-numbered register. The way to
specify this requirement is with @code{HARD_REGNO_MODE_OK}.
Register classes used for input-operands of bitwise-and or shift
instructions have a special requirement: each such class must have, for
each fixed-point machine mode, a subclass whose registers can transfer that
mode to or from memory. For example, on some machines, the operations for
single-byte values (@code{QImode}) are limited to certain registers. When
this is so, each register class that is used in a bitwise-and or shift
instruction must have a subclass consisting of registers from which
single-byte values can be loaded or stored. This is so that
@code{PREFERRED_RELOAD_CLASS} can always have a possible value to return.
@deftp {Data type} {enum reg_class}
An enumerated type that must be defined with all the register class names
as enumerated values. @code{NO_REGS} must be first. @code{ALL_REGS}
must be the last register class, followed by one more enumerated value,
1996-09-25 01:21:45 +02:00
@code{LIM_REG_CLASSES}, which is not a register class but rather
tells how many classes there are.
Each register class has a number, which is the value of casting
the class name to type @code{int}. The number serves as an index
in many of the tables described below.
@end deftp
1996-09-25 01:21:45 +02:00
@defmac N_REG_CLASSES
1996-09-25 01:21:45 +02:00
The number of distinct register classes, defined as follows:
@smallexample
1996-09-25 01:21:45 +02:00
#define N_REG_CLASSES (int) LIM_REG_CLASSES
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REG_CLASS_NAMES
1996-09-25 01:21:45 +02:00
An initializer containing the names of the register classes as C string
constants. These names are used in writing some of the debugging dumps.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REG_CLASS_CONTENTS
1996-09-25 01:21:45 +02:00
An initializer containing the contents of the register classes, as integers
which are bit masks. The @var{n}th integer specifies the contents of class
@var{n}. The way the integer @var{mask} is interpreted is that
register @var{r} is in the class if @code{@var{mask} & (1 << @var{r})} is 1.
When the machine has more than 32 registers, an integer does not suffice.
Then the integers are replaced by sub-initializers, braced groupings containing
several integers. Each sub-initializer must be suitable as an initializer
for the type @code{HARD_REG_SET} which is defined in @file{hard-reg-set.h}.
In this situation, the first integer in each sub-initializer corresponds to
registers 0 through 31, the second integer to registers 32 through 63, and
so on.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REGNO_REG_CLASS (@var{regno})
1996-09-25 01:21:45 +02:00
A C expression whose value is a register class containing hard register
@var{regno}. In general there is more than one such class; choose a class
which is @dfn{minimal}, meaning that no smaller class also contains the
register.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac BASE_REG_CLASS
1996-09-25 01:21:45 +02:00
A macro whose definition is the name of the class to which a valid
base register must belong. A base register is one used in an address
which is the register value plus a displacement.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MODE_BASE_REG_CLASS (@var{mode})
This is a variation of the @code{BASE_REG_CLASS} macro which allows
the selection of a base register in a mode dependent manner. If
@var{mode} is VOIDmode then it should return the same value as
@code{BASE_REG_CLASS}.
@end defmac
@defmac MODE_BASE_REG_REG_CLASS (@var{mode})
A C expression whose value is the register class to which a valid
base register must belong in order to be used in a base plus index
register address. You should define this macro if base plus index
addresses have different requirements than other base register uses.
@end defmac
tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. * doc/tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * doc/tm.texi: Regenerate. * config/cris/cris.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/bfin/bfin.h (MODE_CODE_BASE_REG_CLASS): Likewise. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/avr/avr.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Ditto. * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. * config/avr/avr.c (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. (avr_reg_ok_for_addr_p): Pass AS down to avr_regno_mode_code_ok_for_base_p. * addresses.h (base_reg_class): Add address space argument. Pass to MODE_CODE_BASE_REG_CLASS. (ok_for_base_p_1): Add address space argument. Pass to REGNO_MODE_CODE_OK_FOR_BASE_P. (regno_ok_for_base_p): Add address space argument. Pass to ok_for_base_p_1. * regrename.c (scan_rtx_address): Add address space argument. Pass address space to regno_ok_for_base_p and base_reg_class. Update recursive calls. (scan_rtx): Pass address space to scan_rtx_address. (build_def_use): Likewise. * regcprop.c (replace_oldest_value_addr): Add address space argument. Pass to regno_ok_for_base_p and base_reg_class. Update recursive calls. (replace_oldest_value_mem): Pass address space to replace_oldest_value_addr. (copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads_address_1): Add address space argument. Pass address space to base_reg_class and regno_ok_for_base_p. Update recursive calls. (find_reloads_address): Pass address space to base_reg_class, regno_ok_for_base_p, and find_reloads_address_1. (find_reloads): Pass address space to base_reg_class. (find_reloads_subreg_address): Likewise. * ira-costs.c (record_reg_classes): Update calls to base_reg_class. (ok_for_base_p_nonstrict): Add address space argument. Pass to ok_for_base_p_1. (record_address_regs): Add address space argument. Pass to base_reg_class and ok_for_base_p_nonstrict. Update recursive calls. (record_operand_costs): Pass address space to record_address_regs. (scan_one_insn): Likewise. * caller-save.c (init_caller_save): Update call to base_reg_class. * ira-conflicts.c (ira_build_conflicts): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. Co-Authored-By: Georg-Johann Lay <avr@gjlay.de> From-SVN: r181175
2011-11-08 18:36:45 +01:00
@defmac MODE_CODE_BASE_REG_CLASS (@var{mode}, @var{address_space}, @var{outer_code}, @var{index_code})
bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin.c (bfin_dsp_memref_p): New function. (bfin_valid_reg_p): Test for pseudos explicitly and use only REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all callers changed. * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. (IREG_P, P_REGNO_P, I_REGNO_P): New macros. (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete macros. (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. (REGNO_REG_CLASS): ARGP is in PREGS. * config/bfin/bfin.md (movhi_insn): Allow for addresses containing IREGS. (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split to deal with those addresses. * addresses.h: New file. * caller-save.c: Include "addresses.h". (init_caller_save): Use new base_reg_class function. * rtl-factoring.c: Include "addresses.h". (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. * recog.c: Include "addresses.h". (preprocess_constraints): Use new base_reg_class function. * regrename.c: Include "addresses.h". (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class functions. Keep track of a new var INDEX_CODE to compute valid classes. (replace_oldest_value_addr): Likewise. (replace_oldest_value_mem): Use base_reg_class. * reload.c: Include "addresses.h". (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. (find_reloads): Use new base_reg_class function. (find_reloads_address): Likewise; also use regno_ok_for_base_p. (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; all callers and prototype changed. * reload1.c: Include "addresses.h". (maybe_fix_stack_asms): Use base_reg_class. * regclass.c: Include "addresses.h". (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. (init_reg_autoinc): Use new base_reg_class function. (record_reg_classes): Likewise. (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, OUTER_CODE and INDEX_CODE. All callers and prototype changed. Use new args to compute necessary class. * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, regrename.o, rtl-factoring.o): Update dependencies. * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, REG_OK_FOR_INDEX_P): Delete documentation. From-SVN: r112248
2006-03-21 14:07:33 +01:00
A C expression whose value is the register class to which a valid
tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. * doc/tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * doc/tm.texi: Regenerate. * config/cris/cris.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/bfin/bfin.h (MODE_CODE_BASE_REG_CLASS): Likewise. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/avr/avr.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Ditto. * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. * config/avr/avr.c (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. (avr_reg_ok_for_addr_p): Pass AS down to avr_regno_mode_code_ok_for_base_p. * addresses.h (base_reg_class): Add address space argument. Pass to MODE_CODE_BASE_REG_CLASS. (ok_for_base_p_1): Add address space argument. Pass to REGNO_MODE_CODE_OK_FOR_BASE_P. (regno_ok_for_base_p): Add address space argument. Pass to ok_for_base_p_1. * regrename.c (scan_rtx_address): Add address space argument. Pass address space to regno_ok_for_base_p and base_reg_class. Update recursive calls. (scan_rtx): Pass address space to scan_rtx_address. (build_def_use): Likewise. * regcprop.c (replace_oldest_value_addr): Add address space argument. Pass to regno_ok_for_base_p and base_reg_class. Update recursive calls. (replace_oldest_value_mem): Pass address space to replace_oldest_value_addr. (copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads_address_1): Add address space argument. Pass address space to base_reg_class and regno_ok_for_base_p. Update recursive calls. (find_reloads_address): Pass address space to base_reg_class, regno_ok_for_base_p, and find_reloads_address_1. (find_reloads): Pass address space to base_reg_class. (find_reloads_subreg_address): Likewise. * ira-costs.c (record_reg_classes): Update calls to base_reg_class. (ok_for_base_p_nonstrict): Add address space argument. Pass to ok_for_base_p_1. (record_address_regs): Add address space argument. Pass to base_reg_class and ok_for_base_p_nonstrict. Update recursive calls. (record_operand_costs): Pass address space to record_address_regs. (scan_one_insn): Likewise. * caller-save.c (init_caller_save): Update call to base_reg_class. * ira-conflicts.c (ira_build_conflicts): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. Co-Authored-By: Georg-Johann Lay <avr@gjlay.de> From-SVN: r181175
2011-11-08 18:36:45 +01:00
base register for a memory reference in mode @var{mode} to address
space @var{address_space} must belong. @var{outer_code} and @var{index_code}
define the context in which the base register occurs. @var{outer_code} is
the code of the immediately enclosing expression (@code{MEM} for the top level
of an address, @code{ADDRESS} for something that occurs in an
bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin.c (bfin_dsp_memref_p): New function. (bfin_valid_reg_p): Test for pseudos explicitly and use only REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all callers changed. * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. (IREG_P, P_REGNO_P, I_REGNO_P): New macros. (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete macros. (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. (REGNO_REG_CLASS): ARGP is in PREGS. * config/bfin/bfin.md (movhi_insn): Allow for addresses containing IREGS. (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split to deal with those addresses. * addresses.h: New file. * caller-save.c: Include "addresses.h". (init_caller_save): Use new base_reg_class function. * rtl-factoring.c: Include "addresses.h". (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. * recog.c: Include "addresses.h". (preprocess_constraints): Use new base_reg_class function. * regrename.c: Include "addresses.h". (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class functions. Keep track of a new var INDEX_CODE to compute valid classes. (replace_oldest_value_addr): Likewise. (replace_oldest_value_mem): Use base_reg_class. * reload.c: Include "addresses.h". (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. (find_reloads): Use new base_reg_class function. (find_reloads_address): Likewise; also use regno_ok_for_base_p. (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; all callers and prototype changed. * reload1.c: Include "addresses.h". (maybe_fix_stack_asms): Use base_reg_class. * regclass.c: Include "addresses.h". (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. (init_reg_autoinc): Use new base_reg_class function. (record_reg_classes): Likewise. (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, OUTER_CODE and INDEX_CODE. All callers and prototype changed. Use new args to compute necessary class. * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, regrename.o, rtl-factoring.o): Update dependencies. * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, REG_OK_FOR_INDEX_P): Delete documentation. From-SVN: r112248
2006-03-21 14:07:33 +01:00
@code{address_operand}). @var{index_code} is the code of the corresponding
index expression if @var{outer_code} is @code{PLUS}; @code{SCRATCH} otherwise.
@end defmac
@defmac INDEX_REG_CLASS
1996-09-25 01:21:45 +02:00
A macro whose definition is the name of the class to which a valid
index register must belong. An index register is one used in an
address where its value is either multiplied by a scale factor or
added to another register (as well as added to a displacement).
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REGNO_OK_FOR_BASE_P (@var{num})
1996-09-25 01:21:45 +02:00
A C expression which is nonzero if register number @var{num} is
suitable for use as a base register in operand addresses.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REGNO_MODE_OK_FOR_BASE_P (@var{num}, @var{mode})
1997-08-11 17:56:58 +02:00
A C expression that is just like @code{REGNO_OK_FOR_BASE_P}, except that
that expression may examine the mode of the memory reference in
@var{mode}. You should define this macro if the mode of the memory
reference affects whether a register may be used as a base register. If
you define this macro, the compiler will use it instead of
@code{REGNO_OK_FOR_BASE_P}. The mode may be @code{VOIDmode} for
addresses that appear outside a @code{MEM}, i.e., as an
@code{address_operand}.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac REGNO_MODE_OK_FOR_REG_BASE_P (@var{num}, @var{mode})
A C expression which is nonzero if register number @var{num} is suitable for
use as a base register in base plus index operand addresses, accessing
memory in mode @var{mode}. It may be either a suitable hard register or a
pseudo register that has been allocated such a hard register. You should
define this macro if base plus index addresses have different requirements
than other base register uses.
bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin.c (bfin_dsp_memref_p): New function. (bfin_valid_reg_p): Test for pseudos explicitly and use only REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all callers changed. * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. (IREG_P, P_REGNO_P, I_REGNO_P): New macros. (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete macros. (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. (REGNO_REG_CLASS): ARGP is in PREGS. * config/bfin/bfin.md (movhi_insn): Allow for addresses containing IREGS. (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split to deal with those addresses. * addresses.h: New file. * caller-save.c: Include "addresses.h". (init_caller_save): Use new base_reg_class function. * rtl-factoring.c: Include "addresses.h". (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. * recog.c: Include "addresses.h". (preprocess_constraints): Use new base_reg_class function. * regrename.c: Include "addresses.h". (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class functions. Keep track of a new var INDEX_CODE to compute valid classes. (replace_oldest_value_addr): Likewise. (replace_oldest_value_mem): Use base_reg_class. * reload.c: Include "addresses.h". (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. (find_reloads): Use new base_reg_class function. (find_reloads_address): Likewise; also use regno_ok_for_base_p. (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; all callers and prototype changed. * reload1.c: Include "addresses.h". (maybe_fix_stack_asms): Use base_reg_class. * regclass.c: Include "addresses.h". (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. (init_reg_autoinc): Use new base_reg_class function. (record_reg_classes): Likewise. (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, OUTER_CODE and INDEX_CODE. All callers and prototype changed. Use new args to compute necessary class. * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, regrename.o, rtl-factoring.o): Update dependencies. * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, REG_OK_FOR_INDEX_P): Delete documentation. From-SVN: r112248
2006-03-21 14:07:33 +01:00
Use of this macro is deprecated; please use the more general
@code{REGNO_MODE_CODE_OK_FOR_BASE_P}.
@end defmac
tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. * doc/tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * doc/tm.texi: Regenerate. * config/cris/cris.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/bfin/bfin.h (MODE_CODE_BASE_REG_CLASS): Likewise. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. * config/avr/avr.h (MODE_CODE_BASE_REG_CLASS): Add address space argument. (REGNO_MODE_CODE_OK_FOR_BASE_P): Ditto. * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. * config/avr/avr.c (avr_mode_code_base_reg_class): Ditto. (avr_regno_mode_code_ok_for_base_p): Ditto. (avr_reg_ok_for_addr_p): Pass AS down to avr_regno_mode_code_ok_for_base_p. * addresses.h (base_reg_class): Add address space argument. Pass to MODE_CODE_BASE_REG_CLASS. (ok_for_base_p_1): Add address space argument. Pass to REGNO_MODE_CODE_OK_FOR_BASE_P. (regno_ok_for_base_p): Add address space argument. Pass to ok_for_base_p_1. * regrename.c (scan_rtx_address): Add address space argument. Pass address space to regno_ok_for_base_p and base_reg_class. Update recursive calls. (scan_rtx): Pass address space to scan_rtx_address. (build_def_use): Likewise. * regcprop.c (replace_oldest_value_addr): Add address space argument. Pass to regno_ok_for_base_p and base_reg_class. Update recursive calls. (replace_oldest_value_mem): Pass address space to replace_oldest_value_addr. (copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads_address_1): Add address space argument. Pass address space to base_reg_class and regno_ok_for_base_p. Update recursive calls. (find_reloads_address): Pass address space to base_reg_class, regno_ok_for_base_p, and find_reloads_address_1. (find_reloads): Pass address space to base_reg_class. (find_reloads_subreg_address): Likewise. * ira-costs.c (record_reg_classes): Update calls to base_reg_class. (ok_for_base_p_nonstrict): Add address space argument. Pass to ok_for_base_p_1. (record_address_regs): Add address space argument. Pass to base_reg_class and ok_for_base_p_nonstrict. Update recursive calls. (record_operand_costs): Pass address space to record_address_regs. (scan_one_insn): Likewise. * caller-save.c (init_caller_save): Update call to base_reg_class. * ira-conflicts.c (ira_build_conflicts): Likewise. * reload1.c (maybe_fix_stack_asms): Likewise. Co-Authored-By: Georg-Johann Lay <avr@gjlay.de> From-SVN: r181175
2011-11-08 18:36:45 +01:00
@defmac REGNO_MODE_CODE_OK_FOR_BASE_P (@var{num}, @var{mode}, @var{address_space}, @var{outer_code}, @var{index_code})
A C expression which is nonzero if register number @var{num} is
suitable for use as a base register in operand addresses, accessing
memory in mode @var{mode} in address space @var{address_space}.
This is similar to @code{REGNO_MODE_OK_FOR_BASE_P}, except
that that expression may examine the context in which the register
appears in the memory reference. @var{outer_code} is the code of the
immediately enclosing expression (@code{MEM} if at the top level of the
address, @code{ADDRESS} for something that occurs in an
@code{address_operand}). @var{index_code} is the code of the
corresponding index expression if @var{outer_code} is @code{PLUS};
bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin.c (bfin_dsp_memref_p): New function. (bfin_valid_reg_p): Test for pseudos explicitly and use only REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all callers changed. * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. (IREG_P, P_REGNO_P, I_REGNO_P): New macros. (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete macros. (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. (REGNO_REG_CLASS): ARGP is in PREGS. * config/bfin/bfin.md (movhi_insn): Allow for addresses containing IREGS. (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split to deal with those addresses. * addresses.h: New file. * caller-save.c: Include "addresses.h". (init_caller_save): Use new base_reg_class function. * rtl-factoring.c: Include "addresses.h". (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. * recog.c: Include "addresses.h". (preprocess_constraints): Use new base_reg_class function. * regrename.c: Include "addresses.h". (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class functions. Keep track of a new var INDEX_CODE to compute valid classes. (replace_oldest_value_addr): Likewise. (replace_oldest_value_mem): Use base_reg_class. * reload.c: Include "addresses.h". (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. (find_reloads): Use new base_reg_class function. (find_reloads_address): Likewise; also use regno_ok_for_base_p. (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; all callers and prototype changed. * reload1.c: Include "addresses.h". (maybe_fix_stack_asms): Use base_reg_class. * regclass.c: Include "addresses.h". (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. (init_reg_autoinc): Use new base_reg_class function. (record_reg_classes): Likewise. (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, OUTER_CODE and INDEX_CODE. All callers and prototype changed. Use new args to compute necessary class. * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, regrename.o, rtl-factoring.o): Update dependencies. * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, REG_OK_FOR_INDEX_P): Delete documentation. From-SVN: r112248
2006-03-21 14:07:33 +01:00
@code{SCRATCH} otherwise. The mode may be @code{VOIDmode} for addresses
that appear outside a @code{MEM}, i.e., as an @code{address_operand}.
@end defmac
@defmac REGNO_OK_FOR_INDEX_P (@var{num})
1996-09-25 01:21:45 +02:00
A C expression which is nonzero if register number @var{num} is
suitable for use as an index register in operand addresses. It may be
either a suitable hard register or a pseudo register that has been
allocated such a hard register.
The difference between an index register and a base register is that
the index register may be scaled. If an address involves the sum of
two registers, neither one of them scaled, then either one may be
labeled the ``base'' and the other the ``index''; but whichever
labeling is used must fit the machine's constraints of which registers
may serve in each capacity. The compiler will try both labelings,
looking for one that is valid, and will reload one or both registers
only if neither labeling works.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} reg_class_t TARGET_PREFERRED_RENAME_CLASS (reg_class_t @var{rclass})
A target hook that places additional preference on the register class to use when it is necessary to rename a register in class @var{rclass} to another class, or perhaps @var{NO_REGS}, if no preferred register class is found or hook @code{preferred_rename_class} is not implemented. Sometimes returning a more restrictive class makes better code. For example, on ARM, thumb-2 instructions using @code{LO_REGS} may be smaller than instructions using @code{GENERIC_REGS}. By returning @code{LO_REGS} from @code{preferred_rename_class}, code size can be reduced.
@end deftypefn
@deftypefn {Target Hook} reg_class_t TARGET_PREFERRED_RELOAD_CLASS (rtx @var{x}, reg_class_t @var{rclass})
A target hook that places additional restrictions on the register class
to use when it is necessary to copy value @var{x} into a register in class
@var{rclass}. The value is a register class; perhaps @var{rclass}, or perhaps
another, smaller class.
The default version of this hook always returns value of @code{rclass} argument.
Sometimes returning a more restrictive class makes better code. For
example, on the 68000, when @var{x} is an integer constant that is in range
for a @samp{moveq} instruction, the value of this macro is always
@code{DATA_REGS} as long as @var{rclass} includes the data registers.
Requiring a data register guarantees that a @samp{moveq} will be used.
One case where @code{TARGET_PREFERRED_RELOAD_CLASS} must not return
@var{rclass} is if @var{x} is a legitimate constant which cannot be
loaded into some register class. By returning @code{NO_REGS} you can
force @var{x} into a memory location. For example, rs6000 can load
immediate values into general-purpose registers, but does not have an
instruction for loading an immediate value into a floating-point
register, so @code{TARGET_PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when
@var{x} is a floating-point constant. If the constant can't be loaded
into any kind of register, code generation will be better if
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
@code{TARGET_LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead
of using @code{TARGET_PREFERRED_RELOAD_CLASS}.
If an insn has pseudos in it after register allocation, reload will go
through the alternatives and call repeatedly @code{TARGET_PREFERRED_RELOAD_CLASS}
to find the best one. Returning @code{NO_REGS}, in this case, makes
reload add a @code{!} in front of the constraint: the x86 back-end uses
this feature to discourage usage of 387 registers when math is done in
the SSE registers (and vice versa).
@end deftypefn
@defmac PREFERRED_RELOAD_CLASS (@var{x}, @var{class})
1996-09-25 01:21:45 +02:00
A C expression that places additional restrictions on the register class
to use when it is necessary to copy value @var{x} into a register in class
@var{class}. The value is a register class; perhaps @var{class}, or perhaps
another, smaller class. On many machines, the following definition is
safe:
@smallexample
1996-09-25 01:21:45 +02:00
#define PREFERRED_RELOAD_CLASS(X,CLASS) CLASS
@end smallexample
1996-09-25 01:21:45 +02:00
Sometimes returning a more restrictive class makes better code. For
example, on the 68000, when @var{x} is an integer constant that is in range
for a @samp{moveq} instruction, the value of this macro is always
@code{DATA_REGS} as long as @var{class} includes the data registers.
Requiring a data register guarantees that a @samp{moveq} will be used.
One case where @code{PREFERRED_RELOAD_CLASS} must not return
@var{class} is if @var{x} is a legitimate constant which cannot be
loaded into some register class. By returning @code{NO_REGS} you can
force @var{x} into a memory location. For example, rs6000 can load
immediate values into general-purpose registers, but does not have an
instruction for loading an immediate value into a floating-point
register, so @code{PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when
@var{x} is a floating-point constant. If the constant can't be loaded
into any kind of register, code generation will be better if
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
@code{TARGET_LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead
of using @code{TARGET_PREFERRED_RELOAD_CLASS}.
If an insn has pseudos in it after register allocation, reload will go
through the alternatives and call repeatedly @code{PREFERRED_RELOAD_CLASS}
to find the best one. Returning @code{NO_REGS}, in this case, makes
reload add a @code{!} in front of the constraint: the x86 back-end uses
this feature to discourage usage of 387 registers when math is done in
the SSE registers (and vice versa).
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} reg_class_t TARGET_PREFERRED_OUTPUT_RELOAD_CLASS (rtx @var{x}, reg_class_t @var{rclass})
Like @code{TARGET_PREFERRED_RELOAD_CLASS}, but for output reloads instead of
input reloads.
The default version of this hook always returns value of @code{rclass}
argument.
You can also use @code{TARGET_PREFERRED_OUTPUT_RELOAD_CLASS} to discourage
reload from using some alternatives, like @code{TARGET_PREFERRED_RELOAD_CLASS}.
@end deftypefn
@defmac LIMIT_RELOAD_CLASS (@var{mode}, @var{class})
1996-09-25 01:21:45 +02:00
A C expression that places additional restrictions on the register class
to use when it is necessary to be able to hold a value of mode
@var{mode} in a reload register for which class @var{class} would
ordinarily be used.
Unlike @code{PREFERRED_RELOAD_CLASS}, this macro should be used when
there are certain modes that simply can't go in certain reload classes.
The value is a register class; perhaps @var{class}, or perhaps another,
smaller class.
Don't define this macro unless the target machine has limitations which
require the macro to do something nontrivial.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} reg_class_t TARGET_SECONDARY_RELOAD (bool @var{in_p}, rtx @var{x}, reg_class_t @var{reload_class}, machine_mode @var{reload_mode}, secondary_reload_info *@var{sri})
1996-09-25 01:21:45 +02:00
Many machines have some registers that cannot be copied directly to or
from memory or even from other types of registers. An example is the
@samp{MQ} register, which on most machines, can only be copied to or
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
from general registers, but not memory. Below, we shall be using the
term 'intermediate register' when a move operation cannot be performed
directly, but has to be done by copying the source into the intermediate
register first, and then copying the intermediate register to the
destination. An intermediate register always has the same mode as
source and destination. Since it holds the actual value being copied,
reload might apply optimizations to re-use an intermediate register
and eliding the copy from the source when it can determine that the
intermediate register still holds the required value.
Another kind of secondary reload is required on some machines which
allow copying all registers to and from memory, but require a scratch
register for stores to some memory locations (e.g., those with symbolic
address on the RT, and those with certain symbolic address on the SPARC
when compiling PIC)@. Scratch registers need not have the same mode
as the value being copied, and usually hold a different value than
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
that being copied. Special patterns in the md file are needed to
describe how the copy is performed with the help of the scratch register;
these patterns also describe the number, register class(es) and mode(s)
of the scratch register(s).
In some cases, both an intermediate and a scratch register are required.
For input reloads, this target hook is called with nonzero @var{in_p},
and @var{x} is an rtx that needs to be copied to a register of class
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
@var{reload_class} in @var{reload_mode}. For output reloads, this target
hook is called with zero @var{in_p}, and a register of class @var{reload_class}
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
needs to be copied to rtx @var{x} in @var{reload_mode}.
If copying a register of @var{reload_class} from/to @var{x} requires
an intermediate register, the hook @code{secondary_reload} should
return the register class required for this intermediate register.
If no intermediate register is required, it should return NO_REGS.
If more than one intermediate register is required, describe the one
that is closest in the copy chain to the reload register.
If scratch registers are needed, you also have to describe how to
perform the copy from/to the reload register to/from this
closest intermediate register. Or if no intermediate register is
required, but still a scratch register is needed, describe the
copy from/to the reload register to/from the reload operand @var{x}.
You do this by setting @code{sri->icode} to the instruction code of a pattern
in the md file which performs the move. Operands 0 and 1 are the output
and input of this copy, respectively. Operands from operand 2 onward are
for scratch operands. These scratch operands must have a mode, and a
single-register-class
@c [later: or memory]
output constraint.
When an intermediate register is used, the @code{secondary_reload}
hook will be called again to determine how to copy the intermediate
register to/from the reload operand @var{x}, so your hook must also
have code to handle the register class of the intermediate operand.
@c [For later: maybe we'll allow multi-alternative reload patterns -
@c the port maintainer could name a mov<mode> pattern that has clobbers -
@c and match the constraints of input and output to determine the required
@c alternative. A restriction would be that constraints used to match
@c against reloads registers would have to be written as register class
@c constraints, or we need a new target macro / hook that tells us if an
@c arbitrary constraint can match an unknown register of a given class.
@c Such a macro / hook would also be useful in other places.]
@var{x} might be a pseudo-register or a @code{subreg} of a
pseudo-register, which could either be in a hard register or in memory.
Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is
in memory and the hard register number if it is in a register.
Scratch operands in memory (constraint @code{"=m"} / @code{"=&m"}) are
currently not supported. For the time being, you will have to continue
to use @code{SECONDARY_MEMORY_NEEDED} for that purpose.
@code{copy_cost} also uses this target hook to find out how values are
copied. If you want it to include some extra cost for the need to allocate
(a) scratch register(s), set @code{sri->extra_cost} to the additional cost.
Or if two dependent moves are supposed to have a lower cost than the sum
of the individual moves due to expected fortuitous scheduling and/or special
forwarding logic, you can set @code{sri->extra_cost} to a negative amount.
@end deftypefn
@defmac SECONDARY_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
@defmacx SECONDARY_INPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
@defmacx SECONDARY_OUTPUT_RELOAD_CLASS (@var{class}, @var{mode}, @var{x})
These macros are obsolete, new ports should use the target hook
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
@code{TARGET_SECONDARY_RELOAD} instead.
These are obsolete macros, replaced by the @code{TARGET_SECONDARY_RELOAD}
target hook. Older ports still define these macros to indicate to the
reload phase that it may
1996-09-25 01:21:45 +02:00
need to allocate at least one register for a reload in addition to the
register to contain the data. Specifically, if copying @var{x} to a
register @var{class} in @var{mode} requires an intermediate register,
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
you were supposed to define @code{SECONDARY_INPUT_RELOAD_CLASS} to return the
1996-09-25 01:21:45 +02:00
largest register class all of whose registers can be used as
intermediate registers or scratch registers.
If copying a register @var{class} in @var{mode} to @var{x} requires an
intermediate or scratch register, @code{SECONDARY_OUTPUT_RELOAD_CLASS}
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
was supposed to be defined be defined to return the largest register
class required. If the
requirements for input and output reloads were the same, the macro
@code{SECONDARY_RELOAD_CLASS} should have been used instead of defining both
1996-09-25 01:21:45 +02:00
macros identically.
The values returned by these macros are often @code{GENERAL_REGS}.
Return @code{NO_REGS} if no spare register is needed; i.e., if @var{x}
can be directly copied to or from a register of @var{class} in
@var{mode} without requiring a scratch register. Do not define this
macro if it would always return @code{NO_REGS}.
If a scratch register is required (either with or without an
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
intermediate register), you were supposed to define patterns for
1996-09-25 01:21:45 +02:00
@samp{reload_in@var{m}} or @samp{reload_out@var{m}}, as required
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
(@pxref{Standard Names}. These patterns, which were normally
1996-09-25 01:21:45 +02:00
implemented with a @code{define_expand}, should be similar to the
@samp{mov@var{m}} patterns, except that operand 2 is the scratch
register.
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
These patterns need constraints for the reload register and scratch
register that
1996-09-25 01:21:45 +02:00
contain a single register class. If the original reload register (whose
class is @var{class}) can meet the constraint given in the pattern, the
value returned by these macros is used for the class of the scratch
register. Otherwise, two additional reload registers are required.
Their classes are obtained from the constraints in the insn pattern.
@var{x} might be a pseudo-register or a @code{subreg} of a
pseudo-register, which could either be in a hard register or in memory.
Use @code{true_regnum} to find out; it will return @minus{}1 if the pseudo is
1996-09-25 01:21:45 +02:00
in memory and the hard register number if it is in a register.
These macros should not be used in the case where a particular class of
registers can only be copied to memory and not to another class of
registers. In that case, secondary reload registers are not needed and
would not be helpful. Instead, a stack location must be used to perform
the copy and the @code{mov@var{m}} pattern should use memory as an
1996-09-25 01:21:45 +02:00
intermediate storage. This case often occurs between floating-point and
general registers.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SECONDARY_MEMORY_NEEDED (@var{class1}, @var{class2}, @var{m})
1996-09-25 01:21:45 +02:00
Certain machines have the property that some registers cannot be copied
to some other registers without using memory. Define this macro on
those machines to be a C expression that is nonzero if objects of mode
1996-09-25 01:21:45 +02:00
@var{m} in registers of @var{class1} can only be copied to registers of
class @var{class2} by storing a register of @var{class1} into memory
and loading that memory location into a register of @var{class2}.
Do not define this macro if its value would always be zero.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SECONDARY_MEMORY_NEEDED_RTX (@var{mode})
1996-09-25 01:21:45 +02:00
Normally when @code{SECONDARY_MEMORY_NEEDED} is defined, the compiler
allocates a stack slot for a memory location needed for register copies.
If this macro is defined, the compiler instead uses the memory location
defined by this macro.
Do not define this macro if you do not define
@code{SECONDARY_MEMORY_NEEDED}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SECONDARY_MEMORY_NEEDED_MODE (@var{mode})
1996-09-25 01:21:45 +02:00
When the compiler needs a secondary memory location to copy between two
registers of mode @var{mode}, it normally allocates sufficient memory to
hold a quantity of @code{BITS_PER_WORD} bits and performs the store and
load operations in a mode that many bits wide and whose class is the
same as that of @var{mode}.
This is right thing to do on most machines because it ensures that all
bits of the register are copied and prevents accesses to the registers
in a narrower mode, which some machines prohibit for floating-point
registers.
However, this default behavior is not correct on some machines, such as
the DEC Alpha, that store short integers in floating-point registers
differently than in integer registers. On those machines, the default
widening will not work correctly and you must define this macro to
suppress that widening in some cases. See the file @file{alpha.h} for
details.
Do not define this macro if you do not define
@code{SECONDARY_MEMORY_NEEDED} or if widening @var{mode} to a mode that
is @code{BITS_PER_WORD} bits wide is correct for your machine.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_CLASS_LIKELY_SPILLED_P (reg_class_t @var{rclass})
A target hook which returns @code{true} if pseudos that have been assigned
to registers of class @var{rclass} would likely be spilled because
registers of @var{rclass} are needed for spill registers.
The default version of this target hook returns @code{true} if @var{rclass}
has exactly one register and @code{false} otherwise. On most machines, this
default should be used. For generally register-starved machines, such as
i386, or machines with right register constraints, such as SH, this hook
can be used to avoid excessive spilling.
This hook is also used by some of the global intra-procedural code
transformations to throtle code motion, to avoid increasing register
pressure.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned char} TARGET_CLASS_MAX_NREGS (reg_class_t @var{rclass}, machine_mode @var{mode})
target.def (class_max_nregs): New hook. * target.def (class_max_nregs): New hook. * doc/tm.texi.in (TARGET_CLASS_MAX_NREGS): Document. * doc/tm.texi: Regenerate. * targhooks.c (default_class_max_nregs): New function. * targhooks.h (default_class_max_nregs): Declare. * ira.h (target_ira): Change type x_ira_reg_class_max_nregs and x_ira_reg_class_min_nregs arrays to unsigned char. * ira.c (setup_reg_class_nregs): Use TARGET_CLASS_MAX_NREGS target hook instead of CLASS_MAX_NREGS macro. * reginfo.c (restore_register_info): Ditto. * ira-conflicts.c (process_regs_for_copy): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. Change type rclass and aclass vars to reg_class_t. * ira-costs.c (record_reg_classes): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. Change type rclass var to reg_class_t. * reload.c (combine_reloads, find_reloads, find_reloads_address_1): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. * config/i386/i386.h (CLASS_MAX_NREGS): Remove. * config/i386/i386.c (ix86_class_max_nregs): New function. (ix86_register_move_cost): Use TARGET_CLASS_MAX_NREGS target hook instead of CLASS_MAX_NREGS macro. (TARGET_CLASS_MAX_NREGS): Define. * config/avr/avr.h (CLASS_MAX_NREGS): Remove. * config/avr/avr-protos.h (class_max_nregs): Remove declaration. * config/avr/avr.c (class_max_nregs): Remove function. * config/alpha/alpha.h (CLASS_MAX_NREGS): Remove. * config/spu/spu.h (CLASS_MAX_NREGS): Remove. * config/mep/mep.h (CLASS_MAX_NREGS): Remove. * config/m32r/m32r.h (CLASS_MAX_NREGS): Remove. * config/microblaze/microblaze.h (CLASS_MAX_NREGS): Remove. * config/xtensa/xtensa.h (CLASS_MAX_NREGS): Remove. * config/stormy16/stormy16.h (CLASS_MAX_NREGS): Remove. * config/lm32/lm32.h (CLASS_MAX_NREGS): Remove. * config/moxie/moxie.h (CLASS_MAX_NREGS): Remove. * config/iq2000/iq2000.h (CLASS_MAX_NREGS): Remove. * config/mn10300/mn10300.h (CLASS_MAX_NREGS): Remove. * config/score/score.h (CLASS_MAX_NREGS): Remove. * config/vax/vax.h (CLASS_MAX_NREGS): Remove. * config/h8300/h8300.h (CLASS_MAX_NREGS): Remove. * config/v850/v850.h (CLASS_MAX_NREGS): Remove. From-SVN: r176490
2011-07-20 00:34:31 +02:00
A target hook returns the maximum number of consecutive registers
of class @var{rclass} needed to hold a value of mode @var{mode}.
This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,
the value returned by @code{TARGET_CLASS_MAX_NREGS (@var{rclass},
target.def (class_max_nregs): New hook. * target.def (class_max_nregs): New hook. * doc/tm.texi.in (TARGET_CLASS_MAX_NREGS): Document. * doc/tm.texi: Regenerate. * targhooks.c (default_class_max_nregs): New function. * targhooks.h (default_class_max_nregs): Declare. * ira.h (target_ira): Change type x_ira_reg_class_max_nregs and x_ira_reg_class_min_nregs arrays to unsigned char. * ira.c (setup_reg_class_nregs): Use TARGET_CLASS_MAX_NREGS target hook instead of CLASS_MAX_NREGS macro. * reginfo.c (restore_register_info): Ditto. * ira-conflicts.c (process_regs_for_copy): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. Change type rclass and aclass vars to reg_class_t. * ira-costs.c (record_reg_classes): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. Change type rclass var to reg_class_t. * reload.c (combine_reloads, find_reloads, find_reloads_address_1): Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro. * config/i386/i386.h (CLASS_MAX_NREGS): Remove. * config/i386/i386.c (ix86_class_max_nregs): New function. (ix86_register_move_cost): Use TARGET_CLASS_MAX_NREGS target hook instead of CLASS_MAX_NREGS macro. (TARGET_CLASS_MAX_NREGS): Define. * config/avr/avr.h (CLASS_MAX_NREGS): Remove. * config/avr/avr-protos.h (class_max_nregs): Remove declaration. * config/avr/avr.c (class_max_nregs): Remove function. * config/alpha/alpha.h (CLASS_MAX_NREGS): Remove. * config/spu/spu.h (CLASS_MAX_NREGS): Remove. * config/mep/mep.h (CLASS_MAX_NREGS): Remove. * config/m32r/m32r.h (CLASS_MAX_NREGS): Remove. * config/microblaze/microblaze.h (CLASS_MAX_NREGS): Remove. * config/xtensa/xtensa.h (CLASS_MAX_NREGS): Remove. * config/stormy16/stormy16.h (CLASS_MAX_NREGS): Remove. * config/lm32/lm32.h (CLASS_MAX_NREGS): Remove. * config/moxie/moxie.h (CLASS_MAX_NREGS): Remove. * config/iq2000/iq2000.h (CLASS_MAX_NREGS): Remove. * config/mn10300/mn10300.h (CLASS_MAX_NREGS): Remove. * config/score/score.h (CLASS_MAX_NREGS): Remove. * config/vax/vax.h (CLASS_MAX_NREGS): Remove. * config/h8300/h8300.h (CLASS_MAX_NREGS): Remove. * config/v850/v850.h (CLASS_MAX_NREGS): Remove. From-SVN: r176490
2011-07-20 00:34:31 +02:00
@var{mode})} target hook should be the maximum value of
@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}
values in the class @var{rclass}.
This target hook helps control the handling of multiple-word values
in the reload pass.
The default version of this target hook returns the size of @var{mode}
in words.
@end deftypefn
@defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
1996-09-25 01:21:45 +02:00
A C expression for the maximum number of consecutive registers
of class @var{class} needed to hold a value of mode @var{mode}.
This is closely related to the macro @code{HARD_REGNO_NREGS}. In fact,
the value of the macro @code{CLASS_MAX_NREGS (@var{class}, @var{mode})}
should be the maximum value of @code{HARD_REGNO_NREGS (@var{regno},
@var{mode})} for all @var{regno} values in the class @var{class}.
This macro helps control the handling of multiple-word values
in the reload pass.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CANNOT_CHANGE_MODE_CLASS (@var{from}, @var{to}, @var{class})
If defined, a C expression that returns nonzero for a @var{class} for which
a change from mode @var{from} to mode @var{to} is invalid.
1996-09-25 01:21:45 +02:00
For the example, loading 32-bit integer or floating-point objects into
floating-point registers on the Alpha extends them to 64 bits.
1996-09-25 01:21:45 +02:00
Therefore loading a 64-bit object and then storing it as a 32-bit object
does not store the low-order 32 bits, as would be the case for a normal
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
register. Therefore, @file{alpha.h} defines @code{CANNOT_CHANGE_MODE_CLASS}
as below:
@smallexample
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
(GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0)
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
@deftypefn {Target Hook} bool TARGET_LRA_P (void)
A target hook which returns true if we use LRA instead of reload pass. It means that LRA was ported to the target. The default version of this target hook returns always false.
@end deftypefn
@deftypefn {Target Hook} int TARGET_REGISTER_PRIORITY (int)
A target hook which returns the register priority number to which the register @var{hard_regno} belongs to. The bigger the number, the more preferable the hard register usage (when all other conditions are the same). This hook can be used to prefer some hard register over others in LRA. For example, some x86-64 register usage needs additional prefix which makes instructions longer. The hook can return lower priority number for such registers make them less favorable and as result making the generated code smaller. The default version of this target hook returns always zero.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_REGISTER_USAGE_LEVELING_P (void)
A target hook which returns true if we need register usage leveling. That means if a few hard registers are equally good for the assignment, we choose the least used hard register. The register usage leveling may be profitable for some targets. Don't use the usage leveling for targets with conditional execution or targets with big register files as it hurts if-conversion and cross-jumping optimizations. The default version of this target hook returns always false.
@end deftypefn
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
@deftypefn {Target Hook} bool TARGET_DIFFERENT_ADDR_DISPLACEMENT_P (void)
A target hook which returns true if an address with the same structure can have different maximal legitimate displacement. For example, the displacement can depend on memory mode or on operand combinations in the insn. The default version of this target hook returns always false.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} reg_class_t TARGET_SPILL_CLASS (reg_class_t, @var{machine_mode})
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
This hook defines a class of registers which could be used for spilling pseudos of the given mode and class, or @code{NO_REGS} if only memory should be used. Not defining this hook is equivalent to returning @code{NO_REGS} for all inputs.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_CSTORE_MODE (enum insn_code @var{icode})
Improve cstore code generation on 64-bit sparc. One major suboptimal area of the sparc back end is cstore generation on 64-bit. Due to the way arguments and return values of functions must be promoted, the ideal mode for cstore's result would be DImode. But this hasn't been done because of a fundamental limitation of the cstore patterns. They require a fixed mode be used for the boolean result value. I've decided to work around this by building a target hook which specifies the type to use for conditional store results, and then I use a special predicate for operans 0 in the cstore expanders so that they still match even when we use DImode. The default version of the target hook just does what it does now, so no other target should be impacted by this at all. Regstrapped on 32-bit sparc-linux-gnu and I've run the testsuite with "-m64" to validate the 64-bit side. gcc/ * target.def (cstore_mode): New hook. * target.h: Include insn-codes.h * targhooks.c: Likewise. (default_cstore_mode): New function. * targhooks.h: Declare it. * doc/tm.texi.in: New hook slot for TARGET_CSTORE_MODE. * doc/tm.texi: Rebuild. * expmed.c (emit_cstore): Obtain cstore boolean result mode using target hook, rather than inspecting the insn_data. * config/sparc/sparc.c (sparc_cstore_mode): New function. (TARGET_CSTORE_MODE): Redefine. (emit_scc_insn): When TARGET_ARCH64, emit new 64-bit boolean result patterns. * config/sparc/predicates.md (cstore_result_operand): New special predicate. * config/sparc/sparc.md (cstoresi4, cstoredi4, cstore<F:mode>4): Use it for operand 0. (*seqsi_special): Rewrite using 'P' mode iterator on operand 0. (*snesi_special): Likewise. (*snesi_zero): Likewise. (*seqsi_zero): Likewise. (*sltu_insn): Likewise. (*sgeu_insn): Likewise. (*seqdi_special): Make operand 0 and comparison operation be of DImode. (*snedi_special): Likewise. (*snedi_special_vis3): Likewise. (*neg_snesi_zero): Rename to *neg_snesisi_zero. (*neg_snesi_sign_extend): Rename to *neg_snesidi_zero. (*snesi_zero_extend): Delete, covered by 'P' mode iterator. (*neg_seqsi_zero): Rename to *neg_seqsisi_zero. (*neg_seqsi_sign_extend): Rename to *neg_seqsidi_zero. (*seqsi_zero_extend): Delete, covered by 'P' mode iterator. (*sltu_extend_sp64): Likewise. (*neg_sltu_insn): Rename to *neg_sltusi_insn. (*neg_sltu_extend_sp64): Rename to *neg_sltudi_insn. (*sgeu_extend_sp64): Delete, covered by 'P' mode iterator. (*neg_sgeu_insn): Rename to *neg_sgeusi_insn. (*neg_sgeu_extend_sp64): Rename to *neg_sgeudi_insn. gcc/testsuite/ * gcc.target/sparc/setcc-4.c: New test. * gcc.target/sparc/setcc-5.c: New test. From-SVN: r197679
2013-04-10 21:41:57 +02:00
This hook defines the machine mode to use for the boolean result of conditional store patterns. The ICODE argument is the instruction code for the cstore being performed. Not definiting this hook is the same as accepting the mode encoded into operand 0 of the cstore expander patterns.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Stack and Calling
@section Stack Layout and Calling Conventions
@cindex calling conventions
@c prevent bad page break with this line
This describes the stack layout and calling conventions.
@menu
* Frame Layout::
* Exception Handling::
1997-08-11 17:56:58 +02:00
* Stack Checking::
1996-09-25 01:21:45 +02:00
* Frame Registers::
* Elimination::
* Stack Arguments::
* Register Arguments::
* Scalar Return::
* Aggregate Return::
* Caller Saves::
* Function Entry::
* Profiling::
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
* Tail Calls::
c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-27 09:41:16 +02:00
* Stack Smashing Protection::
* Miscellaneous Register Hooks::
1996-09-25 01:21:45 +02:00
@end menu
@node Frame Layout
@subsection Basic Stack Layout
@cindex stack frame layout
@cindex frame layout
@c prevent bad page break with this line
Here is the basic stack layout.
@defmac STACK_GROWS_DOWNWARD
1996-09-25 01:21:45 +02:00
Define this macro if pushing a word onto the stack moves the stack
pointer to a smaller address.
When we say, ``define this macro if @dots{}'', it means that the
1996-09-25 01:21:45 +02:00
compiler checks this macro only with @code{#ifdef} so the precise
definition used does not matter.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_PUSH_CODE
This macro defines the operation used when something is pushed
on the stack. In RTL, a push operation will be
@code{(set (mem (STACK_PUSH_CODE (reg sp))) @dots{})}
The choices are @code{PRE_DEC}, @code{POST_DEC}, @code{PRE_INC},
and @code{POST_INC}. Which of these is correct depends on
the stack direction and on whether the stack pointer points
to the last item on the stack or whether it points to the
space for the next item on the stack.
The default is @code{PRE_DEC} when @code{STACK_GROWS_DOWNWARD} is
defined, which is almost always right, and @code{PRE_INC} otherwise,
which is often wrong.
@end defmac
@defmac FRAME_GROWS_DOWNWARD
Define this macro to nonzero value if the addresses of local variable slots
defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined. * defaults.h (FRAME_GROWS_DOWNWARD): Define to 0 if not defined. * function.c (get_func_frame_size): Use if (FRAME_GROWS_DOWNWARD) instead of preprocessor conditionals. (assign_stack_local_1, assign_stack_temp_for_type): Likewise. * cfgexpand.c (FRAME_GROWS_DOWNWARD): Don't redefine to 1 or 0 depending on if it was or was not defined previously. * doc/rtl.texi (VIRTUAL_STACK_VARS_REGNUM): Mention that only non-zero definition of FRAME_GROWS_DOWNWARD means frame grows downward. * doc/tm.texi (FRAME_GROWS_DOWNWARD): Likewise. * config/m68hc11/m68hc11.h (FRAME_GROWS_DOWNWARD): Define to 0. Update comment. * config/pa/pa.h (FRAME_GROWS_DOWNWARD): Likewise. * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Likewise. * config/stormy16/stormy16.h (FRAME_GROWS_DOWNWARD): Define to 0. * config/c4x/c4x.h (FRAME_GROWS_DOWNWARD): Likewise. * config/sh/sh.h (FRAME_GROWS_DOWNWARD): Likewise. * config/ia64/ia64.h (FRAME_GROWS_DOWNWARD): Likewise. * config/iq2000/iq2000.h (FRAME_GROWS_DOWNWARD): Likewise. * config/pdp11/pdp11.h (FRAME_GROWS_DOWNWARD): Define to 1. Update comment. * config/i860/i860.h (FRAME_GROWS_DOWNWARD): Likewise. * config/h8300/h8300.h (FRAME_GROWS_DOWNWARD): Likewise. * config/arc/arc.h (FRAME_GROWS_DOWNWARD): Likewise. * config/vax/vax.h (FRAME_GROWS_DOWNWARD): Likewise. * config/sparc/sparc.h (FRAME_GROWS_DOWNWARD): Likewise. * config/i386/i386.h (FRAME_GROWS_DOWNWARD): Likewise. * config/fr30/fr30.h (FRAME_GROWS_DOWNWARD): Likewise. * config/frv/frv.h (FRAME_GROWS_DOWNWARD): Likewise. * config/mn10300/mn10300.h (FRAME_GROWS_DOWNWARD): Likewise. * config/bfin/bfin.h (FRAME_GROWS_DOWNWARD): Likewise. * config/ns32k/ns32k.h (FRAME_GROWS_DOWNWARD): Likewise. * config/v850/v850.h (FRAME_GROWS_DOWNWARD): Likewise. * config/alpha/alpha.h (FRAME_GROWS_DOWNWARD): Update comment. * config/s390/s390.h (FRAME_GROWS_DOWNWARD): Likewise. * config/arm/arm.h (FRAME_GROWS_DOWNWARD): Likewise. * config/alpha/unicosmk.h (FRAME_GROWS_DOWNWARD): Define to 1. * config/cris/cris.h (FRAME_GROWS_DOWNWARD): Likewise. * config/m68k/m68k.h (FRAME_GROWS_DOWNWARD): Likewise. * config/mmix/mmix.h (FRAME_GROWS_DOWNWARD): Likewise. From-SVN: r101329
2005-06-26 07:18:53 +02:00
are at negative offsets from the frame pointer.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ARGS_GROW_DOWNWARD
1996-09-25 01:21:45 +02:00
Define this macro if successive arguments to a function occupy decreasing
addresses on the stack.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STARTING_FRAME_OFFSET
1996-09-25 01:21:45 +02:00
Offset from the frame pointer to the first local variable slot to be allocated.
If @code{FRAME_GROWS_DOWNWARD}, find the next slot's offset by
subtracting the first slot's length from @code{STARTING_FRAME_OFFSET}.
Otherwise, it is found by adding the length of the first slot to the
value @code{STARTING_FRAME_OFFSET}.
@c i'm not sure if the above is still correct.. had to change it to get
@c rid of an overfull. --mew 2feb93
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_ALIGNMENT_NEEDED
Define to zero to disable final alignment of the stack during reload.
The nonzero default for this macro is suitable for most ports.
On ports where @code{STARTING_FRAME_OFFSET} is nonzero or where there
is a register save block following the local block that doesn't require
alignment to @code{STACK_BOUNDARY}, it may be beneficial to disable
stack alignment and do it in the backend.
@end defmac
@defmac STACK_POINTER_OFFSET
1996-09-25 01:21:45 +02:00
Offset from the stack pointer register to the first location at which
outgoing arguments are placed. If not specified, the default value of
zero is used. This is the proper value for most machines.
If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
the first location at which outgoing arguments are placed.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FIRST_PARM_OFFSET (@var{fundecl})
1996-09-25 01:21:45 +02:00
Offset from the argument pointer register to the first argument's
address. On some machines it may depend on the data type of the
function.
If @code{ARGS_GROW_DOWNWARD}, this is the offset to the location above
the first argument's address.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_DYNAMIC_OFFSET (@var{fundecl})
1996-09-25 01:21:45 +02:00
Offset from the stack pointer register to an item dynamically allocated
on the stack, e.g., by @code{alloca}.
The default value for this macro is @code{STACK_POINTER_OFFSET} plus the
length of the outgoing arguments. The default is correct for most
machines. See @file{function.c} for details.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac INITIAL_FRAME_ADDRESS_RTX
A C expression whose value is RTL representing the address of the initial
stack frame. This address is passed to @code{RETURN_ADDR_RTX} and
@code{DYNAMIC_CHAIN_ADDRESS}. If you don't define this macro, a reasonable
default value will be used. Define this macro in order to make frame pointer
elimination work in the presence of @code{__builtin_frame_address (count)} and
@code{__builtin_return_address (count)} for @code{count} not equal to zero.
@end defmac
@defmac DYNAMIC_CHAIN_ADDRESS (@var{frameaddr})
1996-09-25 01:21:45 +02:00
A C expression whose value is RTL representing the address in a stack
frame where the pointer to the caller's frame is stored. Assume that
@var{frameaddr} is an RTL expression for the address of the stack frame
itself.
If you don't define this macro, the default is to return the value
of @var{frameaddr}---that is, the stack frame address is also the
address of the stack word that points to the previous frame.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SETUP_FRAME_ADDRESSES
1996-09-25 01:21:45 +02:00
If defined, a C expression that produces the machine-specific code to
setup the stack so that arbitrary frames can be accessed. For example,
on the SPARC, we must flush all of the register windows to the stack
before we can access arbitrary stack frames. You will seldom need to
define this macro.
@end defmac
@deftypefn {Target Hook} rtx TARGET_BUILTIN_SETJMP_FRAME_VALUE (void)
This target hook should return an rtx that is used to store
the address of the current frame into the built in @code{setjmp} buffer.
The default value, @code{virtual_stack_vars_rtx}, is correct for most
machines. One reason you may need to define this target hook is if
@code{hard_frame_pointer_rtx} is the appropriate value on your machine.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac FRAME_ADDR_RTX (@var{frameaddr})
A C expression whose value is RTL representing the value of the frame
address for the current frame. @var{frameaddr} is the frame pointer
of the current frame. This is used for __builtin_frame_address.
You need only define this macro if the frame address is not the same
as the frame pointer. Most machines do not need to define it.
@end defmac
@defmac RETURN_ADDR_RTX (@var{count}, @var{frameaddr})
1996-09-25 01:21:45 +02:00
A C expression whose value is RTL representing the value of the return
1997-08-11 17:56:58 +02:00
address for the frame @var{count} steps up from the current frame, after
the prologue. @var{frameaddr} is the frame pointer of the @var{count}
frame, or the frame pointer of the @var{count} @minus{} 1 frame if
1996-09-25 01:21:45 +02:00
@code{RETURN_ADDR_IN_PREVIOUS_FRAME} is defined.
The value of the expression must always be the correct address when
@var{count} is zero, but may be @code{NULL_RTX} if there is no way to
determine the return address of other frames.
@end defmac
@defmac RETURN_ADDR_IN_PREVIOUS_FRAME
1996-09-25 01:21:45 +02:00
Define this if the return address of a particular stack frame is accessed
from the frame pointer of the previous stack frame.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac INCOMING_RETURN_ADDR_RTX
1997-08-11 17:56:58 +02:00
A C expression whose value is RTL representing the location of the
incoming return address at the beginning of any function, before the
prologue. This RTL is either a @code{REG}, indicating that the return
value is saved in @samp{REG}, or a @code{MEM} representing a location in
the stack.
You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
If this RTL is a @code{REG}, you should also define
@code{DWARF_FRAME_RETURN_COLUMN} to @code{DWARF_FRAME_REGNUM (REGNO)}.
@end defmac
@defmac DWARF_ALT_FRAME_RETURN_COLUMN
A C expression whose value is an integer giving a DWARF 2 column
number that may be used as an alternative return column. The column
must not correspond to any gcc hard register (that is, it must not
be in the range of @code{DWARF_FRAME_REGNUM}).
This macro can be useful if @code{DWARF_FRAME_RETURN_COLUMN} is set to a
general register, but an alternative column needs to be used for signal
frames. Some targets have also used different frame return columns
over time.
@end defmac
@defmac DWARF_ZERO_REG
A C expression whose value is an integer giving a DWARF 2 register
number that is considered to always have the value zero. This should
only be defined if the target has an architected zero register, and
someone decided it was a good idea to use that register number to
terminate the stack backtrace. New ports should avoid this.
@end defmac
@deftypefn {Target Hook} void TARGET_DWARF_HANDLE_FRAME_UNSPEC (const char *@var{label}, rtx @var{pattern}, int @var{index})
This target hook allows the backend to emit frame-related insns that
contain UNSPECs or UNSPEC_VOLATILEs. The DWARF 2 call frame debugging
info engine will invoke it on insns of the form
@smallexample
(set (reg) (unspec [@dots{}] UNSPEC_INDEX))
@end smallexample
and
@smallexample
(set (reg) (unspec_volatile [@dots{}] UNSPECV_INDEX)).
@end smallexample
to let the backend emit the call frame instructions. @var{label} is
the CFI label attached to the insn, @var{pattern} is the pattern of
the insn and @var{index} is @code{UNSPEC_INDEX} or @code{UNSPECV_INDEX}.
@end deftypefn
@defmac INCOMING_FRAME_SP_OFFSET
1997-08-11 17:56:58 +02:00
A C expression whose value is an integer giving the offset, in bytes,
from the value of the stack pointer register to the top of the stack
frame at the beginning of any function, before the prologue. The top of
the frame is defined to be the value of the stack pointer in the
previous frame, just before the call instruction.
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. * c-decl.c (init_decl_processing): Update accordingly. * expr.c (expand_builtin): Likewise. * cp/decl.c (init_decl_processing): Likewise. * rtl.h (global_rtl): Add cfa entry. (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. (LAST_VIRTUAL_REGISTER): Update. * emit-rtl.c (global_rtl): Add cfa entry. (init_emit): Initialize it. * function.c (cfa_offset): New. (instantiate_virtual_regs): Initialize it. (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. (expand_function_end): Call expand_eh_return. * tm.texi (ARG_POINTER_CFA_OFFSET): New. * except.c (current_function_eh_stub_label): Kill. (current_function_eh_old_stub_label): Likwise; update all references. (expand_builtin_set_return_addr_reg): Kill. (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. (expand_builtin_set_eh_regs): Kill. (eh_regs): Produce a third reg for the actual handler address. (eh_return_context, eh_return_stack_adjust): New. (eh_return_handler, eh_return_stub_label): New. (init_eh_for_function): Initialize them. (expand_builtin_eh_return, expand_eh_return): New. * except.h: Update prototypes. * flow.c (find_basic_blocks_1): Update references to the stub label. * function.h (struct function): Kill stub label elements. * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the register number is one that would be in the previous window. Provide a dummy definition for non-windowed targets. (get_reg_addr): New function. (get_reg, put_reg, copy_reg): Use it. (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. * alpha.c (alpha_eh_epilogue_sp_ofs): New. (alpha_init_expanders): Initialize it. (alpha_expand_epilogue): Use it. * alpha.h: Declare it. * alpha.md (eh_epilogue): New. * m68h.h (ARG_POINTER_CFA_OFFSET): New. * sparc.h (ARG_POINTER_CFA_OFFSET): New. From-SVN: r22436
1998-09-15 21:19:12 +02:00
You only need to define this macro if you want to support call frame
debugging information like that provided by DWARF 2.
@end defmac
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. * c-decl.c (init_decl_processing): Update accordingly. * expr.c (expand_builtin): Likewise. * cp/decl.c (init_decl_processing): Likewise. * rtl.h (global_rtl): Add cfa entry. (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. (LAST_VIRTUAL_REGISTER): Update. * emit-rtl.c (global_rtl): Add cfa entry. (init_emit): Initialize it. * function.c (cfa_offset): New. (instantiate_virtual_regs): Initialize it. (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. (expand_function_end): Call expand_eh_return. * tm.texi (ARG_POINTER_CFA_OFFSET): New. * except.c (current_function_eh_stub_label): Kill. (current_function_eh_old_stub_label): Likwise; update all references. (expand_builtin_set_return_addr_reg): Kill. (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. (expand_builtin_set_eh_regs): Kill. (eh_regs): Produce a third reg for the actual handler address. (eh_return_context, eh_return_stack_adjust): New. (eh_return_handler, eh_return_stub_label): New. (init_eh_for_function): Initialize them. (expand_builtin_eh_return, expand_eh_return): New. * except.h: Update prototypes. * flow.c (find_basic_blocks_1): Update references to the stub label. * function.h (struct function): Kill stub label elements. * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the register number is one that would be in the previous window. Provide a dummy definition for non-windowed targets. (get_reg_addr): New function. (get_reg, put_reg, copy_reg): Use it. (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. * alpha.c (alpha_eh_epilogue_sp_ofs): New. (alpha_init_expanders): Initialize it. (alpha_expand_epilogue): Use it. * alpha.h: Declare it. * alpha.md (eh_epilogue): New. * m68h.h (ARG_POINTER_CFA_OFFSET): New. * sparc.h (ARG_POINTER_CFA_OFFSET): New. From-SVN: r22436
1998-09-15 21:19:12 +02:00
@defmac ARG_POINTER_CFA_OFFSET (@var{fundecl})
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. * c-decl.c (init_decl_processing): Update accordingly. * expr.c (expand_builtin): Likewise. * cp/decl.c (init_decl_processing): Likewise. * rtl.h (global_rtl): Add cfa entry. (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. (LAST_VIRTUAL_REGISTER): Update. * emit-rtl.c (global_rtl): Add cfa entry. (init_emit): Initialize it. * function.c (cfa_offset): New. (instantiate_virtual_regs): Initialize it. (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. (expand_function_end): Call expand_eh_return. * tm.texi (ARG_POINTER_CFA_OFFSET): New. * except.c (current_function_eh_stub_label): Kill. (current_function_eh_old_stub_label): Likwise; update all references. (expand_builtin_set_return_addr_reg): Kill. (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. (expand_builtin_set_eh_regs): Kill. (eh_regs): Produce a third reg for the actual handler address. (eh_return_context, eh_return_stack_adjust): New. (eh_return_handler, eh_return_stub_label): New. (init_eh_for_function): Initialize them. (expand_builtin_eh_return, expand_eh_return): New. * except.h: Update prototypes. * flow.c (find_basic_blocks_1): Update references to the stub label. * function.h (struct function): Kill stub label elements. * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the register number is one that would be in the previous window. Provide a dummy definition for non-windowed targets. (get_reg_addr): New function. (get_reg, put_reg, copy_reg): Use it. (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. * alpha.c (alpha_eh_epilogue_sp_ofs): New. (alpha_init_expanders): Initialize it. (alpha_expand_epilogue): Use it. * alpha.h: Declare it. * alpha.md (eh_epilogue): New. * m68h.h (ARG_POINTER_CFA_OFFSET): New. * sparc.h (ARG_POINTER_CFA_OFFSET): New. From-SVN: r22436
1998-09-15 21:19:12 +02:00
A C expression whose value is an integer giving the offset, in bytes,
from the argument pointer to the canonical frame address (cfa). The
final value should coincide with that calculated by
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. * tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill. (BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill. (BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill. (BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New. * c-decl.c (init_decl_processing): Update accordingly. * expr.c (expand_builtin): Likewise. * cp/decl.c (init_decl_processing): Likewise. * rtl.h (global_rtl): Add cfa entry. (virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New. (LAST_VIRTUAL_REGISTER): Update. * emit-rtl.c (global_rtl): Add cfa entry. (init_emit): Initialize it. * function.c (cfa_offset): New. (instantiate_virtual_regs): Initialize it. (instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx. (expand_function_end): Call expand_eh_return. * tm.texi (ARG_POINTER_CFA_OFFSET): New. * except.c (current_function_eh_stub_label): Kill. (current_function_eh_old_stub_label): Likwise; update all references. (expand_builtin_set_return_addr_reg): Kill. (expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill. (expand_builtin_set_eh_regs): Kill. (eh_regs): Produce a third reg for the actual handler address. (eh_return_context, eh_return_stack_adjust): New. (eh_return_handler, eh_return_stub_label): New. (init_eh_for_function): Initialize them. (expand_builtin_eh_return, expand_eh_return): New. * except.h: Update prototypes. * flow.c (find_basic_blocks_1): Update references to the stub label. * function.h (struct function): Kill stub label elements. * libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the register number is one that would be in the previous window. Provide a dummy definition for non-windowed targets. (get_reg_addr): New function. (get_reg, put_reg, copy_reg): Use it. (__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa. * alpha.c (alpha_eh_epilogue_sp_ofs): New. (alpha_init_expanders): Initialize it. (alpha_expand_epilogue): Use it. * alpha.h: Declare it. * alpha.md (eh_epilogue): New. * m68h.h (ARG_POINTER_CFA_OFFSET): New. * sparc.h (ARG_POINTER_CFA_OFFSET): New. From-SVN: r22436
1998-09-15 21:19:12 +02:00
@code{INCOMING_FRAME_SP_OFFSET}. Which is unfortunately not usable
during virtual register instantiation.
The default value for this macro is
@code{FIRST_PARM_OFFSET (fundecl) + crtl->args.pretend_args_size},
which is correct for most machines; in general, the arguments are found
immediately before the stack frame. Note that this is not the case on
some targets that save registers into the caller's frame, such as SPARC
and rs6000, and so such targets need to define this macro.
You only need to define this macro if the default is incorrect, and you
want to support call frame debugging information like that provided by
DWARF 2.
@end defmac
@defmac FRAME_POINTER_CFA_OFFSET (@var{fundecl})
If defined, a C expression whose value is an integer giving the offset
in bytes from the frame pointer to the canonical frame address (cfa).
The final value should coincide with that calculated by
@code{INCOMING_FRAME_SP_OFFSET}.
Normally the CFA is calculated as an offset from the argument pointer,
via @code{ARG_POINTER_CFA_OFFSET}, but if the argument pointer is
variable due to the ABI, this may not be possible. If this macro is
defined, it implies that the virtual register instantiation should be
based on the frame pointer instead of the argument pointer. Only one
of @code{FRAME_POINTER_CFA_OFFSET} and @code{ARG_POINTER_CFA_OFFSET}
should be defined.
@end defmac
@defmac CFA_FRAME_BASE_OFFSET (@var{fundecl})
If defined, a C expression whose value is an integer giving the offset
in bytes from the canonical frame address (cfa) to the frame base used
in DWARF 2 debug information. The default is zero. A different value
may reduce the size of debug information on some ports.
@end defmac
@node Exception Handling
@subsection Exception Handling Support
@cindex exception handling
@defmac EH_RETURN_DATA_REGNO (@var{N})
A C expression whose value is the @var{N}th register number used for
data by exception handlers, or @code{INVALID_REGNUM} if fewer than
@var{N} registers are usable.
The exception handling library routines communicate with the exception
handlers via a set of agreed upon registers. Ideally these registers
should be call-clobbered; it is possible to use call-saved registers,
but may negatively impact code size. The target must support at least
2 data registers, but should define 4 if there are enough free registers.
You must define this macro if you want to support call frame exception
handling like that provided by DWARF 2.
@end defmac
@defmac EH_RETURN_STACKADJ_RTX
A C expression whose value is RTL representing a location in which
to store a stack adjustment to be applied before function return.
This is used to unwind the stack to an exception handler's call frame.
It will be assigned zero on code paths that return normally.
Typically this is a call-clobbered hard register that is otherwise
untouched by the epilogue, but could also be a stack slot.
Do not define this macro if the stack pointer is saved and restored
by the regular prolog and epilog code in the call frame itself; in
this case, the exception handling library routines will update the
stack location to be restored in place. Otherwise, you must define
this macro if you want to support call frame exception handling like
that provided by DWARF 2.
@end defmac
@defmac EH_RETURN_HANDLER_RTX
A C expression whose value is RTL representing a location in which
to store the address of an exception handler to which we should
return. It will not be assigned on code paths that return normally.
Typically this is the location in the call frame at which the normal
return address is stored. For targets that return by popping an
address off the stack, this might be a memory address just below
the @emph{target} call frame rather than inside the current call
frame. If defined, @code{EH_RETURN_STACKADJ_RTX} will have already
been assigned, so it may be used to calculate the location of the
target call frame.
Some targets have more complex requirements than storing to an
address calculable during initial code generation. In that case
the @code{eh_return} instruction pattern should be used instead.
If you want to support call frame exception handling, you must
define either this macro or the @code{eh_return} instruction pattern.
@end defmac
@defmac RETURN_ADDR_OFFSET
If defined, an integer-valued C expression for which rtl will be generated
to add it to the exception handler address before it is searched in the
exception handling tables, and to subtract it again from the address before
using it to return to the exception handler.
@end defmac
@defmac ASM_PREFERRED_EH_DATA_FORMAT (@var{code}, @var{global})
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
This macro chooses the encoding of pointers embedded in the exception
handling sections. If at all possible, this should be defined such
that the exception handling section will not require dynamic relocations,
and so may be read-only.
@var{code} is 0 for data, 1 for code labels, 2 for function pointers.
@var{global} is true if the symbol may be affected by dynamic relocations.
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
The macro should return a combination of the @code{DW_EH_PE_*} defines
as found in @file{dwarf2.h}.
If this macro is not defined, pointers will not be encoded but
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
represented directly.
@end defmac
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
@defmac ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX (@var{file}, @var{encoding}, @var{size}, @var{addr}, @var{done})
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
This macro allows the target to emit whatever special magic is required
to represent the encoding chosen by @code{ASM_PREFERRED_EH_DATA_FORMAT}.
Generic code takes care of pc-relative and indirect encodings; this must
be defined if the target uses text-relative or data-relative encodings.
This is a C statement that branches to @var{done} if the format was
handled. @var{encoding} is the format chosen, @var{size} is the number
of bytes that the format occupies, @var{addr} is the @code{SYMBOL_REF}
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
to be emitted.
@end defmac
defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * defaults.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * dwarf2asm.c (dw2_force_const_mem, dw2_output_indirect_constant_1, dw2_output_indirect_constants, dw2_asm_output_encoded_addr_rtx): New. * dwarf2asm.h (dw2_asm_output_encoded_addr_rtx): Prototype. (dw2_output_indirect_constants): Prototype. * dwarf2out.c (dwarf2out_begin_prologue): Generate current_function_func_begin_label if we'll need it for EH. Exit early for IA64_UNWIND_INFO. * except.c: Get DW_EH_PE_* defines from dwarf2.h. (eh_data_format_name): Update for indirect references. (output_function_exception_table): Care for IA64_UNWIND_INFO. Handle ASM_PREFERRED_EH_DATA_FORMAT. * except.h (MUST_USE_SJLJ_EXCEPTIONS): IA64_UNWIND_INFO needn't define HAVE_eh_return etc. * final.c (final_start_function): Always call dwarf2out_begin_prologue. (final_end_function): Don't call output_function_exception_table. * toplev.c (compile_file): Call dw2_output_indirect_constants. (rest_of_compilation): Invoke output_function_exception_table for ia64 before assemble_end_function. * tm.texi (ASM_PREFERRED_EH_DATA_FORMAT): Document. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Document. * unwind-dw2.c (_Unwind_GetTextRelBase, _Unwind_GetDataRelBase): New. * unwind.h: Declare them. * libgcc-std.ver: Export them. * unwind-pe.h: New file. * config/alpha/elf.h (ASM_PREFERRED_EH_DATA_FORMAT): New. * config/ia64/fde-glibc.c: Use "struct unw_table_entry" instead of "fde". (find_fde_for_dso): Extract DT_PLTGOT. (_Unwind_FindTableEntry): Rename from __ia64_find_fde; return the segment and gp as well. * config/ia64/frame-ia64.c: Remove file. * config/ia64/frame-ia64.h: Remove file. * config/ia64/unwind-ia64.c: New file. * config/ia64/unwind-ia64.h: New file. * config/ia64/ia64.h (ASM_OUTPUT_EH_CHAR): Remove. (ASM_OUTPUT_EH_SHORT, ASM_OUTPUT_EH_INT): Remove. (ASM_OUTPUT_EH_DOUBLE_INT): Remove. (ASM_PREFERRED_EH_DATA_FORMAT): New. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New. (IA64_UNWIND_INFO): Re-enable. (HANDLER_SECTION): Remove. (EH_RETURN_DATA_REGNO): New. * config/ia64/ia64.md (exception_receiver): Remove. * config/ia64/t-glibc (LIB2ADDEH): Re-enable. * config/ia64/t-ia64 (LIB2ADDEH): Re-enable. From-SVN: r41981
2001-05-12 08:03:20 +02:00
tm.texi (MD_UNWIND_SUPPORT): Document. * doc/tm.texi (MD_UNWIND_SUPPORT): Document. (MD_FALLBACK_FRAME_STATE_FOR): Update. * unwind-dw2.c (MD_UNWIND_SUPPORT): #include if defined. (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. (MD_FROB_UPDATE_CONTEXT): Remove default. (uw_update_context_1): Instead #ifdef invocation. * config/ia64/unwind-ia64.c (MD_UNWIND_SUPPORT): #include if defined. (uw_frame_state_for): Adjust MD_FALLBACK_FRAME_STATE_FOR invocation. * config/alpha/gnu.h (MD_FALLBACK_FRAME_STATE_FOR): Don't undef. (MD_UNWIND_SUPPORT): Undefine this instead. * config/i386/gnu.h: Likewise. * config/alpha/linux-unwind.h: New file, macro converted to function, extracted from.. * config/alpha/linux.h (MD_FALLBACK_FRAME_STATE_FOR): ..this. (MD_UNWIND_SUPPORT): Define. * config/alpha/vms-unwind.h, config/alpha/vms.h: Likewise. * config/i386/linux-unwind.h, config/i386/linux.h, config/i386/linux64.h: Likewise. * config/ia64/linux-unwind.h, config/ia64/linux.h: Likewise. MD_HANDLE_UNWABI too. * config/mips/linux-unwind.h, config/mips/linux.h: Likewise. * config/pa/linux-unwind.h, config/pa/pa32-linux.h: Likewise. * config/rs6000/darwin-unwind.h, config/rs6000/darwin.h: Likewise. * config/s390/linux-unwind.h, config/s390/linux.h: Likewise. * config/sparc/linux-unwind.h, config/sparc/linux.h, config/sparc/linux64.h: Likewise. * config/sh/linux-unwind.h, config/sh/linux.h: Likewise, but merge SH_FALLBACK_FRAME_FLOAT_STATE into sh_fallback_frame_state. * config/rs6000/linux-unwind.h, config/rs6000/linux.h, config/rs6000/linux64.h: Likewise. Split out get_sigcontext function. Use ARG_POINTER_REGNUM for 32-bit temp reg too. From-SVN: r87167
2004-09-08 02:17:19 +02:00
@defmac MD_FALLBACK_FRAME_STATE_FOR (@var{context}, @var{fs})
This macro allows the target to add CPU and operating system specific
code to the call-frame unwinder for use when there is no unwind data
available. The most common reason to implement this macro is to unwind
through signal frames.
This macro is called from @code{uw_frame_state_for} in
@file{unwind-dw2.c}, @file{unwind-dw2-xtensa.c} and
@file{unwind-ia64.c}. @var{context} is an @code{_Unwind_Context};
@var{fs} is an @code{_Unwind_FrameState}. Examine @code{context->ra}
for the address of the code being executed and @code{context->cfa} for
the stack pointer value. If the frame can be decoded, the register
save addresses should be updated in @var{fs} and the macro should
evaluate to @code{_URC_NO_REASON}. If the frame cannot be decoded,
the macro should evaluate to @code{_URC_END_OF_STACK}.
For proper signal handling in Java this macro is accompanied by
@code{MAKE_THROW_FRAME}, defined in @file{libjava/include/*-signal.h} headers.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac MD_HANDLE_UNWABI (@var{context}, @var{fs})
This macro allows the target to add operating system specific code to the
call-frame unwinder to handle the IA-64 @code{.unwabi} unwinding directive,
usually used for signal or interrupt frames.
This macro is called from @code{uw_update_context} in libgcc's
@file{unwind-ia64.c}. @var{context} is an @code{_Unwind_Context};
@var{fs} is an @code{_Unwind_FrameState}. Examine @code{fs->unwabi}
for the abi and context in the @code{.unwabi} directive. If the
@code{.unwabi} directive can be handled, the register save addresses should
be updated in @var{fs}.
@end defmac
Enabled linkonce support for Darwin. * target.h (struct gcc_target): New target hook, unwind_label. * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. * output.h (default_emit_unwind_label): New function. * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. (TARGET_USES_WEAK_UNWIND_INFO): New target macro. (TARGET_SUPPORTS_HIDDEN): New target macro. * dwarf2out.c (struct dw_fde_struct): Add field for function decl that corresponds to this FDE. (FRAME_BEGIN_LABEL): Allow target to override default label. (output_call_frame_info): If FDEs are linknonce, then use extra indirection for FDE encoding, output a label for each FDE, and output an empty label for each function without an FDE. (dwarf2out_begin_prologue): Set up decl field when creating an FDE. * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for decls with DECL_ONE_ONLY set, if that macro is defined. (make_decl_one_only): Don't use DECL_COMMON if we're compiling for a SUPPORTS_ONE_ONLY target. * config/darwin-protos.h (darwin_unique_section): Declare. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_make_decl_one_only): Likewise. * config/darwin.c (machopic_finish): Get rid of tweak that eliminate stubs for symbols that are defined. (darwin_encode_section_info): Don't treat weak functions as defined. (darwin_make_decl_one_only): Define. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_unique_section): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_asm_output_dwarf_delta): Difference between two labels is local only if both labels are local. * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. (ASM_MAKE_LABEL_LINKONCE): Likewise. (TARGET_SUPPORTS_HIDDEN): Likewise. (TARGET_USES_WEAK_UNWIND_INFO): Likewise. (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. (FRAME_BEGIN_LABEL): Likewise. (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. (ASM_DECLARE_FUNCTION_NAME): Likewise. (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. (TARGET_ASM_UNIQUE_SECTION): Define. (EH_FRAME_SECTION_NAME): Define. (EH_FRAME_SECTION_ATTR): Likewise. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (TARGET_ASM_NAMED_SECTION): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, TARGET_ASM_EMIT_UNWIND_LABEL. * cp/decl2.c (maybe_make_one_only): Look at TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether to make an explicit instantiation weak. * cp/method.c (use_thunk): Make sure we call comdat_linkage when appropriate. * cp/pt.c (do_type_instantiation): On systems where weak symbols don't go in a static archive's TOC, explicit instantiation of a class must imply *explicit* instantiation of its memeber. From-SVN: r79394
2004-03-12 18:09:03 +01:00
@defmac TARGET_USES_WEAK_UNWIND_INFO
A C expression that evaluates to true if the target requires unwind
info to be given comdat linkage. Define it to be @code{1} if comdat
linkage is necessary. The default is @code{0}.
@end defmac
1997-08-11 17:56:58 +02:00
@node Stack Checking
@subsection Specifying How Stack Checking is Done
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
GCC will check that stack references are within the boundaries of the
stack, if the option @option{-fstack-check} is specified, in one of
three ways:
1997-08-11 17:56:58 +02:00
@enumerate
@item
If the value of the @code{STACK_CHECK_BUILTIN} macro is nonzero, GCC
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
will assume that you have arranged for full stack checking to be done
at appropriate places in the configuration files. GCC will not do
other special processing.
1997-08-11 17:56:58 +02:00
@item
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
If @code{STACK_CHECK_BUILTIN} is zero and the value of the
@code{STACK_CHECK_STATIC_BUILTIN} macro is nonzero, GCC will assume
that you have arranged for static stack checking (checking of the
static stack frame of functions) to be done at appropriate places
in the configuration files. GCC will only emit code to do dynamic
stack checking (checking on dynamic stack allocations) using the third
approach below.
1997-08-11 17:56:58 +02:00
@item
If neither of the above are true, GCC will generate code to periodically
1997-08-11 17:56:58 +02:00
``probe'' the stack pointer using the values of the macros defined below.
@end enumerate
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
If neither STACK_CHECK_BUILTIN nor STACK_CHECK_STATIC_BUILTIN is defined,
GCC will change its allocation strategy for large objects if the option
@option{-fstack-check} is specified: they will always be allocated
dynamically if their size exceeds @code{STACK_CHECK_MAX_VAR_SIZE} bytes.
1997-08-11 17:56:58 +02:00
@defmac STACK_CHECK_BUILTIN
1997-08-11 17:56:58 +02:00
A nonzero value if stack checking is done by the configuration files in a
machine-dependent manner. You should define this macro if stack checking
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
is required by the ABI of your machine or if you would like to do stack
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
checking in some more efficient way than the generic approach. The default
value of this macro is zero.
@end defmac
@defmac STACK_CHECK_STATIC_BUILTIN
A nonzero value if static stack checking is done by the configuration files
in a machine-dependent manner. You should define this macro if you would
like to do static stack checking in some more efficient way than the generic
approach. The default value of this macro is zero.
@end defmac
1997-08-11 17:56:58 +02:00
re PR target/10127 (-fstack-check let's program crash) PR target/10127 PR ada/20548 * expr.h (STACK_CHECK_PROBE_INTERVAL): Delete. (STACK_CHECK_PROBE_INTERVAL_EXP): New macro. (STACK_CHECK_MOVING_SP): Likewise. * system.h (STACK_CHECK_PROBE_INTERVAL): Poison it. * doc/tm.texi (Stack Checking): Delete STACK_CHECK_PROBE_INTERVAL. Document STACK_CHECK_PROBE_INTERVAL_EXP and STACK_CHECK_MOVING_SP. * doc/md.texi (Standard Pattern Names): Tweak entry of CHECK_STACK. Document PROBE_STACK. * explow.c (anti_adjust_stack_and_probe): New function. (allocate_dynamic_stack_space): Do not directly allocate space if STACK_CHECK_MOVING_SP, instead invoke above function. (emit_stack_probe): Handle probe_stack insn. (PROBE_INTERVAL): New macro. (STACK_GROW_OPTAB): Likewise. (STACK_GROW_OFF): Likewise. (probe_stack_range): Use Pmode and memory_address consistently. Fix loop condition in the small constant case. Rewrite in the general case to be immune to wraparounds. Make sure the address of probes is valid. Try to use [base + disp] addressing mode if possible. * ira.c (setup_eliminable_regset): Set frame_pointer_needed if stack checking is enabled and STACK_CHECK_MOVING_SP. * rtlanal.c (may_trap_p_1) <MEM>: If stack checking is enabled, return 1 for volatile references to the stack pointer. * tree.c (build_common_builtin_nodes): Do not set ECF_NOTHROW on __builtin_alloca if stack checking is enabled. * unwind-dw2.c (uw_identify_context): Take into account whether the context is that of a signal frame or not. * config/i386/linux.h (STACK_CHECK_MOVING_SP): Define to 1. * config/i386/linux64.h (STACK_CHECK_MOVING_SP): Likewise. From-SVN: r153877
2009-11-03 23:49:37 +01:00
@defmac STACK_CHECK_PROBE_INTERVAL_EXP
An integer specifying the interval at which GCC must generate stack probe
instructions, defined as 2 raised to this integer. You will normally
define this macro so that the interval be no larger than the size of
the ``guard pages'' at the end of a stack area. The default value
of 12 (4096-byte interval) is suitable for most systems.
@end defmac
1997-08-11 17:56:58 +02:00
re PR target/10127 (-fstack-check let's program crash) PR target/10127 PR ada/20548 * expr.h (STACK_CHECK_PROBE_INTERVAL): Delete. (STACK_CHECK_PROBE_INTERVAL_EXP): New macro. (STACK_CHECK_MOVING_SP): Likewise. * system.h (STACK_CHECK_PROBE_INTERVAL): Poison it. * doc/tm.texi (Stack Checking): Delete STACK_CHECK_PROBE_INTERVAL. Document STACK_CHECK_PROBE_INTERVAL_EXP and STACK_CHECK_MOVING_SP. * doc/md.texi (Standard Pattern Names): Tweak entry of CHECK_STACK. Document PROBE_STACK. * explow.c (anti_adjust_stack_and_probe): New function. (allocate_dynamic_stack_space): Do not directly allocate space if STACK_CHECK_MOVING_SP, instead invoke above function. (emit_stack_probe): Handle probe_stack insn. (PROBE_INTERVAL): New macro. (STACK_GROW_OPTAB): Likewise. (STACK_GROW_OFF): Likewise. (probe_stack_range): Use Pmode and memory_address consistently. Fix loop condition in the small constant case. Rewrite in the general case to be immune to wraparounds. Make sure the address of probes is valid. Try to use [base + disp] addressing mode if possible. * ira.c (setup_eliminable_regset): Set frame_pointer_needed if stack checking is enabled and STACK_CHECK_MOVING_SP. * rtlanal.c (may_trap_p_1) <MEM>: If stack checking is enabled, return 1 for volatile references to the stack pointer. * tree.c (build_common_builtin_nodes): Do not set ECF_NOTHROW on __builtin_alloca if stack checking is enabled. * unwind-dw2.c (uw_identify_context): Take into account whether the context is that of a signal frame or not. * config/i386/linux.h (STACK_CHECK_MOVING_SP): Define to 1. * config/i386/linux64.h (STACK_CHECK_MOVING_SP): Likewise. From-SVN: r153877
2009-11-03 23:49:37 +01:00
@defmac STACK_CHECK_MOVING_SP
An integer which is nonzero if GCC should move the stack pointer page by page
when doing probes. This can be necessary on systems where the stack pointer
contains the bottom address of the memory area accessible to the executing
thread at any point in time. In this situation an alternate signal stack
is required in order to be able to recover from a stack overflow. The
default value of this macro is zero.
@end defmac
@defmac STACK_CHECK_PROTECT
The number of bytes of stack needed to recover from a stack overflow, for
languages where such a recovery is supported. The default value of 75 words
with the @code{setjmp}/@code{longjmp}-based exception handling mechanism and
8192 bytes with other exception handling mechanisms should be adequate for
most machines.
@end defmac
1997-08-11 17:56:58 +02:00
re PR middle-end/20548 (ACATS c52103x c52104x c52104y segfault) PR ada/20548 * common.opt (-fstack-check): Do not declare the variable here. (-fstack-check=): New option variant. * doc/invoke.texi (Code Gen Options): Document it. * expr.h (STACK_OLD_CHECK_PROTECT): New macro. (STACK_CHECK_PROTECT): Bump to 3 pages if DWARF-2 EH is used. (STACK_CHECK_STATIC_BUILTIN): New macro. * doc/tm.texi (Stack Checking): Document STACK_CHECK_STATIC_BUILTIN. * opts.c: Include expr.h. (common_handle_option) <OPT_fold_stack_check_>: New case. <OPT_fstack_check>: Likewise. * calls.c (initialize_argument_information): Use TYPE_SIZE_UNIT consistently in the test for variable-sized types. Adjust for new behaviour of flag_stack_check. * explow.c: Include except.h. (allocate_dynamic_stack_space): Do not take into account STACK_CHECK_MAX_FRAME_SIZE for static builtin stack checking. * function.c (gimplify_parameters): Use DECL_SIZE_UNIT in the test for variable-sized parameters. Treat all parameters whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. * gimplify.c (gimplify_decl_expr): Treat non-static objects whose size is greater than STACK_CHECK_MAX_VAR_SIZE as variable-sized if generic stack checking is enabled. (expand_function_end): Adjust for new behaviour of flag_stack_check. * reload1.c (reload): Likewise. * stmt.c (expand_decl): Assert that all automatic variables have fixed size at this point and remove dead code. * flags.h (stack_check_type): New enumeration type. (flag_stack_check): Declare. * toplev.c (flag_stack_check): New global variable. * Makefile.in (opts.o): Add dependency on EXPR_H. (explow.o): Add dependency on except.h. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Use DECL_SIZE_UNIT in the setjmp test consistently. Adjust for new behaviour of flag_stack_check. * gcc-interface/utils2.c (build_call_alloc_dealloc): Remove redundant test of flag_stack_check. Adjust for new behaviour of flag_stack_check. From-SVN: r139159
2008-08-16 20:40:57 +02:00
The following macros are relevant only if neither STACK_CHECK_BUILTIN
nor STACK_CHECK_STATIC_BUILTIN is defined; you can omit them altogether
in the opposite case.
@defmac STACK_CHECK_MAX_FRAME_SIZE
The maximum size of a stack frame, in bytes. GCC will generate probe
1997-08-11 17:56:58 +02:00
instructions in non-leaf functions to ensure at least this many bytes of
stack are available. If a stack frame is larger than this size, stack
checking will not be reliable and GCC will issue a warning. The
default is chosen so that GCC only generates one instruction on most
1997-08-11 17:56:58 +02:00
systems. You should normally not change the default value of this macro.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac STACK_CHECK_FIXED_FRAME_SIZE
GCC uses this value to generate the above warning message. It
1997-08-11 17:56:58 +02:00
represents the amount of fixed frame used by a function, not including
space for any callee-saved registers, temporaries and user variables.
You need only specify an upper bound for this amount and will normally
use the default of four words.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac STACK_CHECK_MAX_VAR_SIZE
The maximum size, in bytes, of an object that GCC will place in the
1997-08-11 17:56:58 +02:00
fixed area of the stack frame when the user specifies
@option{-fstack-check}.
GCC computed the default from the values of the above macros and you will
1997-08-11 17:56:58 +02:00
normally not need to override that default.
@end defmac
1996-09-25 01:21:45 +02:00
@need 2000
@node Frame Registers
@subsection Registers That Address the Stack Frame
@c prevent bad page break with this line
This discusses registers that address the stack frame.
@defmac STACK_POINTER_REGNUM
1996-09-25 01:21:45 +02:00
The register number of the stack pointer register, which must also be a
fixed register according to @code{FIXED_REGISTERS}. On most machines,
the hardware determines which register this is.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FRAME_POINTER_REGNUM
1996-09-25 01:21:45 +02:00
The register number of the frame pointer register, which is used to
access automatic variables in the stack frame. On some machines, the
hardware determines which register this is. On other machines, you can
choose any register you wish for this purpose.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HARD_FRAME_POINTER_REGNUM
1996-09-25 01:21:45 +02:00
On some machines the offset between the frame pointer and starting
offset of the automatic variables is not known until after register
allocation has been done (for example, because the saved registers are
between these two locations). On those machines, define
@code{FRAME_POINTER_REGNUM} the number of a special, fixed register to
be used internally until the offset is known, and define
1998-02-19 01:04:36 +01:00
@code{HARD_FRAME_POINTER_REGNUM} to be the actual hard register number
1996-09-25 01:21:45 +02:00
used for the frame pointer.
You should define this macro only in the very rare circumstances when it
is not possible to calculate the offset between the frame pointer and
the automatic variables until after register allocation has been
completed. When this macro is defined, you must also indicate in your
definition of @code{ELIMINABLE_REGS} how to eliminate
@code{FRAME_POINTER_REGNUM} into either @code{HARD_FRAME_POINTER_REGNUM}
or @code{STACK_POINTER_REGNUM}.
Do not define this macro if it would be the same as
@code{FRAME_POINTER_REGNUM}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ARG_POINTER_REGNUM
1996-09-25 01:21:45 +02:00
The register number of the arg pointer register, which is used to access
the function's argument list. On some machines, this is the same as the
frame pointer register. On some machines, the hardware determines which
register this is. On other machines, you can choose any register you
wish for this purpose. If this is not the same register as the frame
pointer register, then you must mark it as a fixed register according to
@code{FIXED_REGISTERS}, or arrange to be able to eliminate it
(@pxref{Elimination}).
@end defmac
1996-09-25 01:21:45 +02:00
optc-gen.awk: Generate global_options initializer instead of individual variables. gcc: * optc-gen.awk: Generate global_options initializer instead of individual variables. Add x_ prefix to names of structure members. * opth-gen.awk: Generate gcc_options structure. Add x_ prefix to names of structure members. * doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Document. * doc/tm.texi: Regenerate. * alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. * c-parser.c (disable_extension_diagnostics, restore_extension_diagnostics): Update names of cpp_options members. * combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * common.opt (fcompare-debug-second): Don't use Var. * config/alpha/alpha.h (target_flags): Remove. * config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/bfin/bfin.h (target_flags): Remove. * config/cris/cris.h (target_flags): Remove. * config/i386/i386-c.c (ix86_pragma_target_parse): Update names of cl_target_option members. * config/i386/i386.c (ix86_force_align_arg_pointer): Remove. (ix86_function_specific_print, ix86_valid_target_attribute_tree, ix86_can_inline_p): Update names of cl_target_option members. * config/i386/i386.h (ix86_isa_flags): Remove. * config/lm32/lm32.h (target_flags): Remove. * config/mcore/mcore.h (mcore_stack_increment): Remove. * config/mcore/mcore.md (addsi3): Remove extern declaration of flag_omit_frame_pointer. * config/mep/mep.h (target_flags): Remove. * config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/mmix/mmix.h (target_flags): Remove. * config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic, flag_expensive_optimizations): Remove. * config/s390/s390.h (flag_pic): Remove. * config/score/score-conv.h (target_flags): Remove. * config/sh/sh.h (sh_fixed_range_str): Remove. * config/spu/spu.h (target_flags, spu_fixed_range_string): Remove. * dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * diagnostic.c (diagnostic_initialize): Update names of diagnostic_context members. * diagnostic.h (diagnostic_context): Rename inhibit_warnings and warn_system_headers. (diagnostic_report_warnings_p): Update for new names. * dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and HARD_FRAME_POINTER_IS_ARG_POINTER. * flags.h (flag_compare_debug): Declare. * ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * opts.c (flag_compare_debug): Define. (common_handle_option): Update names of diagnostic_context members. Handle -fcompare-debug-second. (fast_math_flags_struct_set_p): Update names of cl_optimization members. * reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use. * sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. gcc/c-family: * c-common.c (c_cpp_error): Update names of diagnostic_context members. * c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of cl_optimization members. * c-opts.c (warning_as_error_callback, c_common_handle_option, sanitize_cpp_opts, finish_options): Update names of cpp_options members. gcc/fortran: * cpp.c (cpp_define_builtins): Update names of gfc_option_t members. (gfc_cpp_post_options): Update names of cpp_options members. (cb_cpp_error): Update names of diagnostic_context members. * f95-lang.c (gfc_init_builtin_functions): Update names of gfc_option_t members. * gfortran.h (gfc_option_t): Rename warn_conversion and flag_openmp. * intrinsic.c (gfc_convert_type_warn): Update names of gfc_option_t members. * options.c (gfc_init_options, gfc_post_options, set_Wall, gfc_handle_option): Update names of gfc_option_t members. * parse.c (next_free, next_fixed): Update names of gfc_option_t members. * scanner.c (pedantic): Remove extern declaration. (skip_free_comments, skip_fixed_comments, include_line): Update names of gfc_option_t members. * trans-decl.c (gfc_generate_function_code): Update names of gfc_option_t members. gcc/java: * java-tree.h (flag_filelist_file, flag_assert, flag_jni, flag_force_classes_archive_check, flag_redundant, flag_newer, flag_use_divide_subroutine, flag_use_atomic_builtins, flag_use_boehm_gc, flag_hash_synchronization, flag_check_references, flag_optimize_sci, flag_indirect_classes, flag_indirect_dispatch, flag_store_check, flag_reduced_reflection): Remove. * jcf-dump.c (flag_newer): Remove. * jcf.h (quiet_flag): Remove. * parse.h (quiet_flag): Remove. libcpp: * include/cpplib.h (cpp_options): Rename warn_deprecated, warn_traditional, warn_long_long and pedantic. * directives.c (directive_diagnostics, _cpp_handle_directive): Update names of cpp_options members. * expr.c (cpp_classify_number, eval_token): Update names of cpp_options members. * init.c (cpp_create_reader, post_options): Update names of cpp_options members. * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of cpp_options members. * macro.c (parse_params): Update names of cpp_options members. From-SVN: r164723
2010-09-29 16:49:14 +02:00
@defmac HARD_FRAME_POINTER_IS_FRAME_POINTER
Define this to a preprocessor constant that is nonzero if
@code{hard_frame_pointer_rtx} and @code{frame_pointer_rtx} should be
the same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM
== FRAME_POINTER_REGNUM)}; you only need to define this macro if that
definition is not suitable for use in preprocessor conditionals.
@end defmac
@defmac HARD_FRAME_POINTER_IS_ARG_POINTER
Define this to a preprocessor constant that is nonzero if
@code{hard_frame_pointer_rtx} and @code{arg_pointer_rtx} should be the
same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM ==
ARG_POINTER_REGNUM)}; you only need to define this macro if that
definition is not suitable for use in preprocessor conditionals.
@end defmac
@defmac RETURN_ADDRESS_POINTER_REGNUM
1996-09-25 01:21:45 +02:00
The register number of the return address pointer register, which is used to
access the current function's return address from the stack. On some
machines, the return address is not at a fixed offset from the frame
pointer or stack pointer or argument pointer. This register can be defined
to point to the return address on the stack, and then be converted by
@code{ELIMINABLE_REGS} into either the frame pointer or stack pointer.
Do not define this macro unless there is no other way to get the return
address from the stack.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STATIC_CHAIN_REGNUM
@defmacx STATIC_CHAIN_INCOMING_REGNUM
1996-09-25 01:21:45 +02:00
Register numbers used for passing a function's static chain pointer. If
register windows are used, the register number as seen by the called
function is @code{STATIC_CHAIN_INCOMING_REGNUM}, while the register
number as seen by the calling function is @code{STATIC_CHAIN_REGNUM}. If
these registers are the same, @code{STATIC_CHAIN_INCOMING_REGNUM} need
not be defined.
1996-09-25 01:21:45 +02:00
The static chain register need not be a fixed register.
If the static chain is passed in memory, these macros should not be
defined; instead, the @code{TARGET_STATIC_CHAIN} hook should be used.
@end defmac
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
@deftypefn {Target Hook} rtx TARGET_STATIC_CHAIN (const_tree @var{fndecl}, bool @var{incoming_p})
This hook replaces the use of @code{STATIC_CHAIN_REGNUM} et al for
targets that may use different static chain locations for different
nested functions. This may be required if the target has function
attributes that affect the calling conventions of the function and
those calling conventions use different static chain locations.
The default version of this hook uses @code{STATIC_CHAIN_REGNUM} et al.
If the static chain is passed in memory, this hook should be used to
provide rtx giving @code{mem} expressions that denote where they are stored.
Often the @code{mem} expression as seen by the caller will be at an offset
from the stack pointer and the @code{mem} expression as seen by the callee
will be at an offset from the frame pointer.
@findex stack_pointer_rtx
@findex frame_pointer_rtx
@findex arg_pointer_rtx
The variables @code{stack_pointer_rtx}, @code{frame_pointer_rtx}, and
@code{arg_pointer_rtx} will have been initialized and should be used
to refer to those items.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
@end deftypefn
@defmac DWARF_FRAME_REGISTERS
This macro specifies the maximum number of hard registers that can be
saved in a call frame. This is used to size data structures used in
DWARF2 exception handling.
Prior to GCC 3.0, this macro was needed in order to establish a stable
exception handling ABI in the face of adding new hard registers for ISA
extensions. In GCC 3.0 and later, the EH ABI is insulated from changes
in the number of hard registers. Nevertheless, this macro can still be
used to reduce the runtime memory requirements of the exception handling
routines, which can be substantial if the ISA contains a lot of
registers that are not call-saved.
If this macro is not defined, it defaults to
@code{FIRST_PSEUDO_REGISTER}.
@end defmac
@defmac PRE_GCC3_DWARF_FRAME_REGISTERS
This macro is similar to @code{DWARF_FRAME_REGISTERS}, but is provided
for backward compatibility in pre GCC 3.0 compiled code.
If this macro is not defined, it defaults to
@code{DWARF_FRAME_REGISTERS}.
@end defmac
@defmac DWARF_REG_TO_UNWIND_COLUMN (@var{regno})
Define this macro if the target's representation for dwarf registers
is different than the internal representation for unwind column.
Given a dwarf register, this macro should return the internal unwind
column number to use instead.
See the PowerPC's SPE target for an example.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DWARF_FRAME_REGNUM (@var{regno})
Define this macro if the target's representation for dwarf registers
used in .eh_frame or .debug_frame is different from that used in other
debug info sections. Given a GCC hard register number, this macro
should return the .eh_frame register number. The default is
@code{DBX_REGISTER_NUMBER (@var{regno})}.
@end defmac
@defmac DWARF2_FRAME_REG_OUT (@var{regno}, @var{for_eh})
Define this macro to map register numbers held in the call frame info
that GCC has collected using @code{DWARF_FRAME_REGNUM} to those that
should be output in .debug_frame (@code{@var{for_eh}} is zero) and
.eh_frame (@code{@var{for_eh}} is nonzero). The default is to
return @code{@var{regno}}.
@end defmac
@defmac REG_VALUE_IN_UNWIND_CONTEXT
Define this macro if the target stores register values as
@code{_Unwind_Word} type in unwind context. It should be defined if
target register size is larger than the size of @code{void *}. The
default is to store register values as @code{void *} type.
@end defmac
@defmac ASSUME_EXTENDED_UNWIND_CONTEXT
Define this macro to be 1 if the target always uses extended unwind
context with version, args_size and by_value fields. If it is undefined,
it will be defined to 1 when @code{REG_VALUE_IN_UNWIND_CONTEXT} is
defined and 0 otherwise.
@end defmac
1996-09-25 01:21:45 +02:00
@node Elimination
@subsection Eliminating Frame Pointer and Arg Pointer
@c prevent bad page break with this line
This is about eliminating the frame pointer and arg pointer.
target.h (struct gcc_target): Add frame_pointer_required field. * target.h (struct gcc_target): Add frame_pointer_required field. * target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. From-SVN: r149065
2009-06-30 00:51:04 +02:00
@deftypefn {Target Hook} bool TARGET_FRAME_POINTER_REQUIRED (void)
This target hook should return @code{true} if a function must have and use
a frame pointer. This target hook is called in the reload pass. If its return
value is @code{true} the function will have a frame pointer.
1996-09-25 01:21:45 +02:00
target.h (struct gcc_target): Add frame_pointer_required field. * target.h (struct gcc_target): Add frame_pointer_required field. * target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. From-SVN: r149065
2009-06-30 00:51:04 +02:00
This target hook can in principle examine the current function and decide
according to the facts, but on most machines the constant @code{false} or the
constant @code{true} suffices. Use @code{false} when the machine allows code
to be generated with no frame pointer, and doing so saves some time or space.
Use @code{true} when there is no possible advantage to avoiding a frame
pointer.
1996-09-25 01:21:45 +02:00
In certain cases, the compiler does not know how to produce valid code
without a frame pointer. The compiler recognizes those cases and
automatically gives the function a frame pointer regardless of what
target.h (struct gcc_target): Add frame_pointer_required field. * target.h (struct gcc_target): Add frame_pointer_required field. * target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. From-SVN: r149065
2009-06-30 00:51:04 +02:00
@code{TARGET_FRAME_POINTER_REQUIRED} returns. You don't need to worry about
them.
1996-09-25 01:21:45 +02:00
In a function that does not require a frame pointer, the frame pointer
register can be allocated for ordinary usage, unless you mark it as a
fixed register. See @code{FIXED_REGISTERS} for more information.
target.h (struct gcc_target): Add frame_pointer_required field. * target.h (struct gcc_target): Add frame_pointer_required field. * target-def.h (TARGET_FRAME_POINTER_REQUIRED): New. (TARGET_INITIALIZER): Use TARGET_FRAME_POINTER_REQUIRED. * ira.c (setup_eliminable_regset): Use frame_pointer_required target hook. * reload1.c (update_eliminables): (Ditto.). * gcc/system.h (FRAME_POINTER_REQUIRED): Poison. * doc/tm.texi (FRAME_POINTER_REQUIRED): Revise documentation. (INITIAL_FRAME_POINTER_OFFSET): (Ditto.). * config/arc/arc.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.h (FRAME_POINTER_REQUIRED): Remove macro. * config/arm/arm.c (TARGET_FRAME_POINTER_REQUIRED): Define. (arm_frame_pointer_required): New function. * config/avr/avr.h (FRAME_POINTER_REQUIRED): Remove macro. * config/avr/avr.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (avr_frame_pointer_required_p): Declare as static. * config/avr/avr-protos.h (avr_frame_pointer_required_p): Remove. * config/bfin/bfin.h (FRAME_POINTER_REQUIRED): Remove macro. * config/bfin/bfin.c (TARGET_FRAME_POINTER_REQUIRED): Define. (bfin_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (bfin_frame_pointer_required): Remove. * config/cris/cris.h (FRAME_POINTER_REQUIRED): Remove macro. * config/cris/cris.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (cris_frame_pointer_required): New function. * config/crx/crx.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.h (FRAME_POINTER_REQUIRED): Remove macro. * config/fr30/fr30.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (fr30_frame_pointer_required): New function. * config/frv/frv.h (FRAME_POINTER_REQUIRED): Remove macro. * config/frv/frv.c (TARGET_FRAME_POINTER_REQUIRED): Define. (frv_frame_pointer_required): Make as static, change return type to bool. * config/bfin/bfin-protos.h (frv_frame_pointer_required): Remove. * config/i386/i386.h (FRAME_POINTER_REQUIRED): Remove macro. * config/i386/i386.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (ix86_frame_pointer_required): Make as static, change return type to bool. * config/i386/i386-protos.h (ix86_frame_pointer_required): Remove. * config/m32c/m32c.h (FRAME_POINTER_REQUIRED): Remove macro. * config/m32c/m32c.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mcore/mcore.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mips/mips.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mips_frame_pointer_required): Make as static. * config/mips/mips-protos.h (mips_frame_pointer_required): Remove. * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Remove macro. * config/mmix/mmix.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (mmix_frame_pointer_required): Mew function. * config/moxie/moxie.h (FRAME_POINTER_REQUIRED): Remove macro. * config/moxie/moxie.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. * config/pa/pa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/score/score.h (FRAME_POINTER_REQUIRED): Remove macro. * config/sh/sh.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.h (FRAME_POINTER_REQUIRED): Remove macro. (CAN_ELIMINATE): Redefine. * config/sparc/sparc.c (TARGET_FRAME_POINTER_REQUIRED): Define macro. (sparc_frame_pointer_required): New function. (sparc_can_eliminate): New function. * config/sparc/sparc-protos.h (sparc_can_eliminate): Declare. * config/vax/vax.h (FRAME_POINTER_REQUIRED): Remove macro. * config/vax/vax.c (TARGET_FRAME_POINTER_REQUIRED): Define. * config/xtensa/xtensa.h (FRAME_POINTER_REQUIRED): Remove macro. * config/xtensa/xtensa.c (TARGET_FRAME_POINTER_REQUIRED): Define. (xtensa_frame_pointer_required): Make as static, change return type to bool. * config/xtensa/xtensa-protos.h (xtensa_frame_pointer_required): Remove. From-SVN: r149065
2009-06-30 00:51:04 +02:00
Default return value is @code{false}.
@end deftypefn
1996-09-25 01:21:45 +02:00
@findex get_frame_size
@defmac INITIAL_FRAME_POINTER_OFFSET (@var{depth-var})
1996-09-25 01:21:45 +02:00
A C statement to store in the variable @var{depth-var} the difference
between the frame pointer and the stack pointer values immediately after
the function prologue. The value would be computed from information
such as the result of @code{get_frame_size ()} and the tables of
registers @code{regs_ever_live} and @code{call_used_regs}.
If @code{ELIMINABLE_REGS} is defined, this macro will be not be used and
need not be defined. Otherwise, it must be defined even if
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@code{TARGET_FRAME_POINTER_REQUIRED} always returns true; in that
1996-09-25 01:21:45 +02:00
case, you may set @var{depth-var} to anything.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ELIMINABLE_REGS
1996-09-25 01:21:45 +02:00
If defined, this macro specifies a table of register pairs used to
eliminate unneeded registers that point into the stack frame. If it is not
defined, the only elimination attempted by the compiler is to replace
references to the frame pointer with references to the stack pointer.
The definition of this macro is a list of structure initializations, each
of which specifies an original and replacement register.
On some machines, the position of the argument pointer is not known until
the compilation is completed. In such a case, a separate hard register
must be used for the argument pointer. This register can be eliminated by
replacing it with either the frame pointer or the argument pointer,
depending on whether or not the frame pointer has been eliminated.
In this case, you might specify:
@smallexample
1996-09-25 01:21:45 +02:00
#define ELIMINABLE_REGS \
@{@{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM@}, \
@{ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM@}, \
@{FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM@}@}
@end smallexample
1996-09-25 01:21:45 +02:00
Note that the elimination of the argument pointer with the stack pointer is
specified first since that is the preferred elimination.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_CAN_ELIMINATE (const int @var{from_reg}, const int @var{to_reg})
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
This target hook should returns @code{true} if the compiler is allowed to
try to replace register number @var{from_reg} with register number
@var{to_reg}. This target hook need only be defined if @code{ELIMINABLE_REGS}
is defined, and will usually be @code{true}, since most of the cases
1996-09-25 01:21:45 +02:00
preventing register elimination are things that the compiler already
knows about.
hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.h (hook_bool_const_int_const_int_true): Declare. * hooks.c (hook_bool_const_int_const_int_true): New function. * target.h (struct gcc_target): Add can_eliminate field. * target-def.h (TARGET_CAN_ELIMINATE): Define. (TARGET_INITIALIZER): Use TARGET_CAN_ELIMINATE. * ira.c (setup_eliminable_regset): Use can_eliminate target hook. * reload1.c (update_eliminables, init_elim_table): (Ditto.). (elim_table): Revise comment. * system.h (CAN_ELIMINATE): Poison. * defaults.h (CAN_ELIMINATE): Remove. * doc/tm.texi (CAN_ELIMINATE): Revise documentation. * config/alpha/vms.h (CAN_ELIMINATE): Remove macro. * config/alpha/alpha.c (TARGET_CAN_ELIMINATE) [TARGET_ABI_OPEN_VMS]: Define macro. (alpha_vms_can_eliminate): Declare as static, change return type to bool. * config/alpha/alpha-protos.h (alpha_vms_can_eliminate): Remove. * config/arm/arm.h (CAN_ELIMINATE): Remove macro. * config/arm/arm.c (TARGET_CAN_ELIMINATE): Define macro. (arm_can_eliminate): New function. * config/avr/avr.h (CAN_ELIMINATE): Remove macro. * config/avr/avr.c (TARGET_CAN_ELIMINATE): Define macro. (avr_can_eliminate): Declare as static. * config/avr/avr-protos.h (avr_can_eliminate): Remove. * config/bfin/bfin.h (CAN_ELIMINATE): Remove macro. * config/bfin/bfin.c (TARGET_CAN_ELIMINATE): Define macro. (bfin_can_eliminate): New function. * config/crx/crx.h (CAN_ELIMINATE): Remove macro. * config/crx/crx.c (TARGET_CAN_ELIMINATE): Define macro. (crx_can_eliminate): New function. * config/fr30/fr30.h (CAN_ELIMINATE): Remove macro. * config/fr30/fr30.c (TARGET_CAN_ELIMINATE): Define macro. (fr30_can_eliminate): New function. * config/frv/frv.h (CAN_ELIMINATE): Remove macro. * config/frv/frv.c (TARGET_CAN_ELIMINATE): Define macro. (frv_can_eliminate): New function. * config/h8300/h8300.h (CAN_ELIMINATE): Remove macro. * config/h8300/h8300.c (TARGET_CAN_ELIMINATE): Define macro. (h8300_can_eliminate): New function. * config/i386/i386.h (CAN_ELIMINATE): Remove macro. * config/i386/i386.c (TARGET_CAN_ELIMINATE): Define macro. (i386_can_eliminate): Declare as static, change return type to bool. * config/i386/i386-protos.h (i386_can_eliminate): Remove. * config/ia64/ia64.h (CAN_ELIMINATE): Remove macro. * config/ia64/ia64.c (TARGET_CAN_ELIMINATE): Define macro. (ia64_can_eliminate): New function. * config/iq2000/iq2000.h (CAN_ELIMINATE): Remove macro. * config/iq2000/iq2000.c (TARGET_CAN_ELIMINATE): Define macro. (iq2000_can_eliminate): New function. * config/m32r/m32r.h (CAN_ELIMINATE): Remove macro. * config/m32r/m32r.c (TARGET_CAN_ELIMINATE): Define macro. (m32r_can_eliminate): New function. * config/m68hc11/m68hc11.h (CAN_ELIMINATE): Remove macro. * config/m68hc11/m68hc11.c (TARGET_CAN_ELIMINATE): Define macro. (m68hc11_can_eliminate): New function. * config/m68k/m68k.h (CAN_ELIMINATE): Remove macro. * config/m68k/m68k.c (TARGET_CAN_ELIMINATE): Define macro. (m68k_can_eliminate): New function. * config/mep/mep.h (CAN_ELIMINATE): Remove macro. * config/mep/mep.c (TARGET_CAN_ELIMINATE): Define macro. (mep_can_eliminate): New function. * config/mips/mips.h (CAN_ELIMINATE): Remove macro. * config/mips/mips.c (TARGET_CAN_ELIMINATE): Define macro. (mips_can_eliminate): New function. * config/rs6000/rs6000.h (CAN_ELIMINATE): Remove macro. * config/rs6000/rs6000.c (TARGET_CAN_ELIMINATE): Define macro. (rs6000_can_eliminate): New function. * config/s390/s390.h (CAN_ELIMINATE): Remove macro. * config/s390/s390.c (TARGET_CAN_ELIMINATE): Define macro. (s390_can_eliminate): Declare as static. * config/s390/s390-protos.h (sparc_can_eliminate): Remove. * config/score/score.h (CAN_ELIMINATE): Remove macro. * config/score/score.c (TARGET_CAN_ELIMINATE): Define macro. (score_can_eliminate): New function. * config/sparc/sparc.h (CAN_ELIMINATE): Remove macro. * config/sparc/sparc.c (TARGET_CAN_ELIMINATE): Define macro. (sparc_can_eliminate): Declare as static. * config/sparc/sparc-protos.h (sparc_can_eliminate): Remove. * config/stormy16/stormy16.h (CAN_ELIMINATE): Remove macro. * config/stormy16/stormy16.c (TARGET_CAN_ELIMINATE): Define macro. (xstormy16_can_eliminate): New function. * config/v850/v850.h (CAN_ELIMINATE): Remove macro. * config/v850/v850.c (TARGET_CAN_ELIMINATE): Define macro. (v850_can_eliminate): New function. From-SVN: r151096
2009-08-25 23:09:00 +02:00
Default return value is @code{true}.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac INITIAL_ELIMINATION_OFFSET (@var{from-reg}, @var{to-reg}, @var{offset-var})
1996-09-25 01:21:45 +02:00
This macro is similar to @code{INITIAL_FRAME_POINTER_OFFSET}. It
specifies the initial difference between the specified pair of
registers. This macro must be defined if @code{ELIMINABLE_REGS} is
defined.
@end defmac
1996-09-25 01:21:45 +02:00
@node Stack Arguments
@subsection Passing Function Arguments on the Stack
@cindex arguments on stack
@cindex stack arguments
The macros in this section control how arguments are passed
on the stack. See the following section for other macros that
control passing certain arguments in registers.
@deftypefn {Target Hook} bool TARGET_PROMOTE_PROTOTYPES (const_tree @var{fntype})
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
This target hook returns @code{true} if an argument declared in a
prototype as an integral type smaller than @code{int} should actually be
passed as an @code{int}. In addition to avoiding errors in certain
cases of mismatch, it also makes for better code on certain machines.
The default is to not promote prototypes.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac PUSH_ARGS
A C expression. If nonzero, push insns will be used to pass
Convert ACCUMULATE_OUTGOING_ARGS to an expression. * calls.c (PUSH_ARGS_REVERSED) Change to expression. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (struct arg_data): Remove #ifdef ACCUMULATE_OUTGOING_ARGS. (save_fixed_argument_area, restore_fixed_argument_area): conditionize by #ifdef REG_PARM_STACK_SPACE only. (emit_call): Change #ifdefs on ACCUMULATE_OUTGOING_ARGS to conditions, handle RETURN_POPS_ARGS on ACCUMULATE_OUTGOING_ARGS. (precompute_register_parameters): Avoid #ifdefs on ACCUMULATE_OUTGOING_ARGS and PUSH_ARGS_REVERSED. (stire_one_args): Likewise. (expand_call): Likewise; conditionize PUSH_ROUNDING code by PUSH_ARGS. (emit_library_call_value_1): Likewise. (compute_argument_block_size): Align to STACK_BOUNDARY only for ACCUMULATE_OUTGOING_ARGS. * combine.c (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (nonzero_bits): Conditionize PUSH_ROUNDING code by USE_PUSH. (use_crosses_set_p): Likewise. * all targets (ACCUMULATE_OUTGOING_ARGS define): Change to #define ACCUMULATE_OUTGOING_ARGS 1. * i386.c (ix86_compute_frame_size): Handle ACCUMULATE_OUTGOING_ARGS frames. * i386.h (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS): New constants. (TARGET_PUSH_ARGS, TARGET_ACCUMULATE_OUTGOING_ARGS): New macros. (TARGET_SWITCHES): Add push-args, no-push-args, accumulate-outgoing-args and no-accumulate-outgoing-args. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): New macro. * expr.c (ACCUMULATE_OUTGONG_ARGS, PUSH_ARGS): Provide default. (push_block): Avoid ifdefs on ACCUMULATE_OUTGONG_ARGS and PUSH_ROUNDING. (emit_push_insn): Likewise. * final.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (final_scan_insn): Avoid ifdefs on ACCUMULATE_OUTGOING_ARGS. * function.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (STACK_DYNAMIC_OFFSET): Define correctly for both ACCUMULATE_OUTGOING_ARGS and normal mode. * invoke.texi (-mpush_args, -maccumulate-outgoing-args): Document. * tm.texi (PUSH_ARGS): Document. (ACCUMULATE_OUTGOING_ARGS, PUSH_ROUNDING): Update documentation. From-SVN: r32803
2000-03-29 15:10:44 +02:00
outgoing arguments.
If the target machine does not have a push instruction, set it to zero.
That directs GCC to use an alternate strategy: to
allocate the entire argument block and then store the arguments into
it. When @code{PUSH_ARGS} is nonzero, @code{PUSH_ROUNDING} must be defined too.
@end defmac
Convert ACCUMULATE_OUTGOING_ARGS to an expression. * calls.c (PUSH_ARGS_REVERSED) Change to expression. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (struct arg_data): Remove #ifdef ACCUMULATE_OUTGOING_ARGS. (save_fixed_argument_area, restore_fixed_argument_area): conditionize by #ifdef REG_PARM_STACK_SPACE only. (emit_call): Change #ifdefs on ACCUMULATE_OUTGOING_ARGS to conditions, handle RETURN_POPS_ARGS on ACCUMULATE_OUTGOING_ARGS. (precompute_register_parameters): Avoid #ifdefs on ACCUMULATE_OUTGOING_ARGS and PUSH_ARGS_REVERSED. (stire_one_args): Likewise. (expand_call): Likewise; conditionize PUSH_ROUNDING code by PUSH_ARGS. (emit_library_call_value_1): Likewise. (compute_argument_block_size): Align to STACK_BOUNDARY only for ACCUMULATE_OUTGOING_ARGS. * combine.c (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (nonzero_bits): Conditionize PUSH_ROUNDING code by USE_PUSH. (use_crosses_set_p): Likewise. * all targets (ACCUMULATE_OUTGOING_ARGS define): Change to #define ACCUMULATE_OUTGOING_ARGS 1. * i386.c (ix86_compute_frame_size): Handle ACCUMULATE_OUTGOING_ARGS frames. * i386.h (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS): New constants. (TARGET_PUSH_ARGS, TARGET_ACCUMULATE_OUTGOING_ARGS): New macros. (TARGET_SWITCHES): Add push-args, no-push-args, accumulate-outgoing-args and no-accumulate-outgoing-args. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): New macro. * expr.c (ACCUMULATE_OUTGONG_ARGS, PUSH_ARGS): Provide default. (push_block): Avoid ifdefs on ACCUMULATE_OUTGONG_ARGS and PUSH_ROUNDING. (emit_push_insn): Likewise. * final.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (final_scan_insn): Avoid ifdefs on ACCUMULATE_OUTGOING_ARGS. * function.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (STACK_DYNAMIC_OFFSET): Define correctly for both ACCUMULATE_OUTGOING_ARGS and normal mode. * invoke.texi (-mpush_args, -maccumulate-outgoing-args): Document. * tm.texi (PUSH_ARGS): Document. (ACCUMULATE_OUTGOING_ARGS, PUSH_ROUNDING): Update documentation. From-SVN: r32803
2000-03-29 15:10:44 +02:00
@defmac PUSH_ARGS_REVERSED
A C expression. If nonzero, function arguments will be evaluated from
last to first, rather than from first to last. If this macro is not
defined, it defaults to @code{PUSH_ARGS} on targets where the stack
and args grow in opposite directions, and 0 otherwise.
@end defmac
@defmac PUSH_ROUNDING (@var{npushed})
1996-09-25 01:21:45 +02:00
A C expression that is the number of bytes actually pushed onto the
stack when an instruction attempts to push @var{npushed} bytes.
On some machines, the definition
@smallexample
1996-09-25 01:21:45 +02:00
#define PUSH_ROUNDING(BYTES) (BYTES)
@end smallexample
1996-09-25 01:21:45 +02:00
@noindent
will suffice. But on other machines, instructions that appear
to push one byte actually push two bytes in an attempt to maintain
alignment. Then the definition should be
@smallexample
1996-09-25 01:21:45 +02:00
#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1)
@end smallexample
If the value of this macro has a type, it should be an unsigned type.
@end defmac
1996-09-25 01:21:45 +02:00
@findex outgoing_args_size
@findex crtl->outgoing_args_size
@defmac ACCUMULATE_OUTGOING_ARGS
A C expression. If nonzero, the maximum amount of space required for outgoing arguments
will be computed and placed into
@code{crtl->outgoing_args_size}. No space will be pushed
1996-09-25 01:21:45 +02:00
onto the stack for each call; instead, the function prologue should
increase the stack frame size by this amount.
Convert ACCUMULATE_OUTGOING_ARGS to an expression. * calls.c (PUSH_ARGS_REVERSED) Change to expression. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (struct arg_data): Remove #ifdef ACCUMULATE_OUTGOING_ARGS. (save_fixed_argument_area, restore_fixed_argument_area): conditionize by #ifdef REG_PARM_STACK_SPACE only. (emit_call): Change #ifdefs on ACCUMULATE_OUTGOING_ARGS to conditions, handle RETURN_POPS_ARGS on ACCUMULATE_OUTGOING_ARGS. (precompute_register_parameters): Avoid #ifdefs on ACCUMULATE_OUTGOING_ARGS and PUSH_ARGS_REVERSED. (stire_one_args): Likewise. (expand_call): Likewise; conditionize PUSH_ROUNDING code by PUSH_ARGS. (emit_library_call_value_1): Likewise. (compute_argument_block_size): Align to STACK_BOUNDARY only for ACCUMULATE_OUTGOING_ARGS. * combine.c (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): Provide default value. (nonzero_bits): Conditionize PUSH_ROUNDING code by USE_PUSH. (use_crosses_set_p): Likewise. * all targets (ACCUMULATE_OUTGOING_ARGS define): Change to #define ACCUMULATE_OUTGOING_ARGS 1. * i386.c (ix86_compute_frame_size): Handle ACCUMULATE_OUTGOING_ARGS frames. * i386.h (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS): New constants. (TARGET_PUSH_ARGS, TARGET_ACCUMULATE_OUTGOING_ARGS): New macros. (TARGET_SWITCHES): Add push-args, no-push-args, accumulate-outgoing-args and no-accumulate-outgoing-args. (ACCUMULATE_OUTGOING_ARGS, PUSH_ARGS): New macro. * expr.c (ACCUMULATE_OUTGONG_ARGS, PUSH_ARGS): Provide default. (push_block): Avoid ifdefs on ACCUMULATE_OUTGONG_ARGS and PUSH_ROUNDING. (emit_push_insn): Likewise. * final.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (final_scan_insn): Avoid ifdefs on ACCUMULATE_OUTGOING_ARGS. * function.c (ACCUMULATE_OUTGOING_ARGS): Provide default. (STACK_DYNAMIC_OFFSET): Define correctly for both ACCUMULATE_OUTGOING_ARGS and normal mode. * invoke.texi (-mpush_args, -maccumulate-outgoing-args): Document. * tm.texi (PUSH_ARGS): Document. (ACCUMULATE_OUTGOING_ARGS, PUSH_ROUNDING): Update documentation. From-SVN: r32803
2000-03-29 15:10:44 +02:00
Setting both @code{PUSH_ARGS} and @code{ACCUMULATE_OUTGOING_ARGS}
1996-09-25 01:21:45 +02:00
is not proper.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REG_PARM_STACK_SPACE (@var{fndecl})
1996-09-25 01:21:45 +02:00
Define this macro if functions should assume that stack space has been
allocated for arguments even when their values are passed in
registers.
The value of this macro is the size, in bytes, of the area reserved for
arguments passed in registers for the function represented by @var{fndecl},
which can be zero if GCC is calling a library function.
The argument @var{fndecl} can be the FUNCTION_DECL, or the type itself
of the function.
1996-09-25 01:21:45 +02:00
This space can be allocated by the caller, or be a part of the
machine-dependent stack frame: @code{OUTGOING_REG_PARM_STACK_SPACE} says
which.
@end defmac
1996-09-25 01:21:45 +02:00
@c above is overfull. not sure what to do. --mew 5feb93 did
@c something, not sure if it looks good. --mew 10feb93
@defmac INCOMING_REG_PARM_STACK_SPACE (@var{fndecl})
Like @code{REG_PARM_STACK_SPACE}, but for incoming register arguments.
Define this macro if space guaranteed when compiling a function body
is different to space required when making a call, a situation that
can arise with K&R style function definitions.
@end defmac
2008-05-07 Kai Tietz <kai,tietz@onevision.com> * calls.c (compute_argument_block_size): Add argument tree fndecl. (OUTGOING_REG_PARM_STACK_SPACE): Add function type argument. (emit_library_call_value_1): Add new variable fndecl initialized by NULL_TREE. It should be the decl type of orgfun, but this information seems not to be available here, so it uses the default calling abi. * config/arm/arm.c (arm_return_in_memory): Add fntype argumen. * config/arm/arm.h (RETURN_IN_MEMORY): Replace RETURN_IN_MEMORY by TARGET_RETURN_IN_MEMORY. * config/i386/i386-interix.h: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386elf.h: Likewise. * config/i386/ptx4-i.h: Likewise. * config/i386/sol2-10.h: Likewise. * config/i386/sysv4.h: Likewise. * config/i386/vx-common.h: Likewise. * config/cris/cris.h: Removed #if 0 clause. * config/arm/arm-protos.h (arm_return_in_memory): Add fntype argument. * config/i386/i386-protos.h (ix86_return_in_memory): Add fntype argument. (ix86_sol10_return_in_memory): Likewise. (ix86_i386elf_return_in_memory): New. (ix86_i386interix_return_in_memory): New. * config/mt/mt-protos.h (mt_return_in_memory): New. * config/mt/mt.c: Likewise. * config/mt/mt.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument. (RETURN_IN_MEMORY): Replace by TARGET_RETURN_IN_MEMORY. * config/bfin/bfin.h: Likewise. * config/bfin/bfin-protos.h (bfin_return_in_memory): Add fntype argument. * config/bfin/bfin.c: Likewise. * config/pa/pa.h (OUTGOING_REG_PARM_STACK_SPACE): Add FNTYPE argument. * config/alpha/unicosmk.h: Likewise. * config/i386/cygming.h: Likewise. * config/iq2000/iq2000.h: Likewise. * config/mips/mips.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/rs6000/rs6000.h: Likewise. * config/score/score.h: Likewise. * config/spu/spu.h: Likewise. * config/v850/v850.h: Likewise. * defaults.h: Likewise. * doc/tm.texi (OUTGOING_REG_PARM_STACK_SPACE): Adjust documentation. * expr.c (emit_block_move): Adjust use of OUTGOING_REG_PARM_STACK_SPACE. * function.c (STACK_DYNAMIC_OFFSET): Adjust use of OUTGOING_REG_PARM_STACK_SPACE. * targhooks.c (default_return_in_memory): Remove RETURN_IN_MEMORY. From-SVN: r135069
2008-05-08 09:10:49 +02:00
@defmac OUTGOING_REG_PARM_STACK_SPACE (@var{fntype})
Define this to a nonzero value if it is the responsibility of the
caller to allocate the area reserved for arguments passed in registers
when calling a function of @var{fntype}. @var{fntype} may be NULL
if the function called is a library function.
1996-09-25 01:21:45 +02:00
If @code{ACCUMULATE_OUTGOING_ARGS} is defined, this macro controls
whether the space for these arguments counts in the value of
@code{crtl->outgoing_args_size}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STACK_PARMS_IN_REG_PARM_AREA
1996-09-25 01:21:45 +02:00
Define this macro if @code{REG_PARM_STACK_SPACE} is defined, but the
stack parameters don't skip the area specified by it.
@c i changed this, makes more sens and it should have taken care of the
@c overfull.. not as specific, tho. --mew 5feb93
Normally, when a parameter is not passed in registers, it is placed on the
stack beyond the @code{REG_PARM_STACK_SPACE} area. Defining this macro
suppresses this behavior and causes the parameter to be passed on the
stack in its natural location.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} int TARGET_RETURN_POPS_ARGS (tree @var{fundecl}, tree @var{funtype}, int @var{size})
reginfo.c (init_reg_sets_1): Adjust comments. * reginfo.c (init_reg_sets_1): Adjust comments. * combine-stack-adj.c (rest_of_handle_stack_adjustments): Likewise. * calls.c (prepare_call_address): Likewise. (emit_call_1): Use targetm.calls.return_pops_args. (expand_call): Likewise. * function.c (assign_parms): Likewise. * system.h (RETURN_POPS_ARGS): Add to #pragma poison list. * target.h (struct gcc_target) [struct calls]: Add return_pops_args field. * targhooks.h (default_return_pops_args): Declare. * targhooks.c (default_return_pops_args): Define. * target-def.h (TARGET_RETURN_POPS_ARGS): Define. (TARGET_CALLS): Add TARGET_RETURN_POPS_ARGS. * doc/tm.texi (RETURN_POPS_ARGS): Rename to... (TARGET_RETURN_POPS_ARGS): ...this. Use deftypefn. Adjust documentation. * config/alpha/alpha.h (RETURN_POPS_ARGS): Delete. * config/arc/arc.h (RETURN_POPS_ARGS): Likewise. * config/arm/arm.h (RETURN_POPS_ARGS): Likewise. * config/avr/avr.h (RETURN_POPS_ARGS): Likewise. * config/bfin/bfin.h (RETURN_POPS_ARGS): Likewise. * config/cris/cris.h (RETURN_POPS_ARGS): Likewise. * config/crx/crx.h (RETURN_POPS_ARGS): Likewise. * config/fr30/fr30.h (RETURN_POPS_ARGS): Likewise. * config/frv/frv.h (RETURN_POPS_ARGS): Likewise. * config/h8300/h8300.h (RETURN_POPS_ARGS): Likewise. * config/ia64/ia64.h (RETURN_POPS_ARGS): Likewise. * config/iq2000/iq2000.h (RETURN_POPS_ARGS): Likewise. * config/lm32/lm32.h (RETURN_POPS_ARGS): Likewise. * config/m32c/m32c.h (RETURN_POPS_ARGS): Likewise. * config/m32r/m32r.h (RETURN_POPS_ARGS): Likewise. * config/m68hc11/m68hc11.h (RETURN_POPS_ARGS): Likewise. * config/mcore/mcore.h (RETURN_POPS_ARGS): Likewise. * config/mep/mep.h (RETURN_POPS_ARGS): Likewise. * config/mips/mips.h (RETURN_POPS_ARGS): Likewise. * config/mmix/mmix.h (RETURN_POPS_ARGS): Likewise. * config/mn10300/mn10300.h (RETURN_POPS_ARGS): Likewise. * config/moxie/moxie.h (RETURN_POPS_ARGS): Likewise. * config/pa/pa.h (RETURN_POPS_ARGS): Likewise. * config/pdp11/pdp11.h (RETURN_POPS_ARGS): Likewise. * config/picochip/picochip.h (RETURN_POPS_ARGS): Likewise. * config/rs6000/rs6000.h (RETURN_POPS_ARGS): Likewise. * config/rx/rx.h (RETURN_POPS_ARGS): Likewise. * config/s390/s390.h (RETURN_POPS_ARGS): Likewise. * config/score/score.h (RETURN_POPS_ARGS): Likewise. * config/sh/sh.h (RETURN_POPS_ARGS): Likewise. * config/sparc/sparc.h (RETURN_POPS_ARGS): Likewise. * config/spu/spu.h (RETURN_POPS_ARGS): Likewise. * config/stormy16/stormy16.h (RETURN_POPS_ARGS): Likewise. * config/v850/v850.h (RETURN_POPS_ARGS): Likewise. * config/xtensa/xtensa.h (RETURN_POPS_ARGS): Likewise. * config/i386/i386-protos.h (ix86_return_pops_args): Delete. * config/i386/i386.h (RETURN_POPS_ARGS): Delete. * config/i386/i386.c (ix86_return_pops_args): Make static. Constify arguments. (TARGET_RETURN_POPS_ARGS): Define. * config/m68k/m68k.h (RETURN_POPS_ARGS): Move to... * config/m68k/m68k.c (m68k_return_pops_args): ...here. New function. (TARGET_RETURN_POPS_ARGS): Define. * config/vax/vax.h (RETURN_POPS_ARGS): Move to... * config/vax/vax.c (vax_return_pops_args): ...here. New function. (TARGET_RETURN_POPS_ARGS): Define. From-SVN: r161528
2010-06-29 14:18:36 +02:00
This target hook returns the number of bytes of its own arguments that
a function pops on returning, or 0 if the function pops no arguments
and the caller must therefore pop them all after the function returns.
1996-09-25 01:21:45 +02:00
@var{fundecl} is a C variable whose value is a tree node that describes
the function in question. Normally it is a node of type
@code{FUNCTION_DECL} that describes the declaration of the function.
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
From this you can obtain the @code{DECL_ATTRIBUTES} of the function.
1996-09-25 01:21:45 +02:00
@var{funtype} is a C variable whose value is a tree node that
describes the function in question. Normally it is a node of type
@code{FUNCTION_TYPE} that describes the data type of the function.
From this it is possible to obtain the data types of the value and
arguments (if known).
1997-08-11 17:56:58 +02:00
When a call to a library function is being considered, @var{fundecl}
1996-09-25 01:21:45 +02:00
will contain an identifier node for the library function. Thus, if
you need to distinguish among various library functions, you can do so
by their names. Note that ``library function'' in this context means
a function used to perform arithmetic, whose name is known specially
in the compiler and was not mentioned in the C code being compiled.
@var{size} is the number of bytes of arguments passed on the
1996-09-25 01:21:45 +02:00
stack. If a variable number of bytes is passed, it is zero, and
argument popping will always be the responsibility of the calling function.
On the VAX, all functions always pop their arguments, so the definition
of this macro is @var{size}. On the 68000, using the standard
1996-09-25 01:21:45 +02:00
calling convention, no functions pop their arguments, so the value of
the macro is always 0 in this case. But an alternative calling
convention is available in which functions that take a fixed number of
arguments pop them but other functions (such as @code{printf}) pop
nothing (the caller pops all). When this convention is in use,
@var{funtype} is examined to determine whether a function takes a fixed
number of arguments.
reginfo.c (init_reg_sets_1): Adjust comments. * reginfo.c (init_reg_sets_1): Adjust comments. * combine-stack-adj.c (rest_of_handle_stack_adjustments): Likewise. * calls.c (prepare_call_address): Likewise. (emit_call_1): Use targetm.calls.return_pops_args. (expand_call): Likewise. * function.c (assign_parms): Likewise. * system.h (RETURN_POPS_ARGS): Add to #pragma poison list. * target.h (struct gcc_target) [struct calls]: Add return_pops_args field. * targhooks.h (default_return_pops_args): Declare. * targhooks.c (default_return_pops_args): Define. * target-def.h (TARGET_RETURN_POPS_ARGS): Define. (TARGET_CALLS): Add TARGET_RETURN_POPS_ARGS. * doc/tm.texi (RETURN_POPS_ARGS): Rename to... (TARGET_RETURN_POPS_ARGS): ...this. Use deftypefn. Adjust documentation. * config/alpha/alpha.h (RETURN_POPS_ARGS): Delete. * config/arc/arc.h (RETURN_POPS_ARGS): Likewise. * config/arm/arm.h (RETURN_POPS_ARGS): Likewise. * config/avr/avr.h (RETURN_POPS_ARGS): Likewise. * config/bfin/bfin.h (RETURN_POPS_ARGS): Likewise. * config/cris/cris.h (RETURN_POPS_ARGS): Likewise. * config/crx/crx.h (RETURN_POPS_ARGS): Likewise. * config/fr30/fr30.h (RETURN_POPS_ARGS): Likewise. * config/frv/frv.h (RETURN_POPS_ARGS): Likewise. * config/h8300/h8300.h (RETURN_POPS_ARGS): Likewise. * config/ia64/ia64.h (RETURN_POPS_ARGS): Likewise. * config/iq2000/iq2000.h (RETURN_POPS_ARGS): Likewise. * config/lm32/lm32.h (RETURN_POPS_ARGS): Likewise. * config/m32c/m32c.h (RETURN_POPS_ARGS): Likewise. * config/m32r/m32r.h (RETURN_POPS_ARGS): Likewise. * config/m68hc11/m68hc11.h (RETURN_POPS_ARGS): Likewise. * config/mcore/mcore.h (RETURN_POPS_ARGS): Likewise. * config/mep/mep.h (RETURN_POPS_ARGS): Likewise. * config/mips/mips.h (RETURN_POPS_ARGS): Likewise. * config/mmix/mmix.h (RETURN_POPS_ARGS): Likewise. * config/mn10300/mn10300.h (RETURN_POPS_ARGS): Likewise. * config/moxie/moxie.h (RETURN_POPS_ARGS): Likewise. * config/pa/pa.h (RETURN_POPS_ARGS): Likewise. * config/pdp11/pdp11.h (RETURN_POPS_ARGS): Likewise. * config/picochip/picochip.h (RETURN_POPS_ARGS): Likewise. * config/rs6000/rs6000.h (RETURN_POPS_ARGS): Likewise. * config/rx/rx.h (RETURN_POPS_ARGS): Likewise. * config/s390/s390.h (RETURN_POPS_ARGS): Likewise. * config/score/score.h (RETURN_POPS_ARGS): Likewise. * config/sh/sh.h (RETURN_POPS_ARGS): Likewise. * config/sparc/sparc.h (RETURN_POPS_ARGS): Likewise. * config/spu/spu.h (RETURN_POPS_ARGS): Likewise. * config/stormy16/stormy16.h (RETURN_POPS_ARGS): Likewise. * config/v850/v850.h (RETURN_POPS_ARGS): Likewise. * config/xtensa/xtensa.h (RETURN_POPS_ARGS): Likewise. * config/i386/i386-protos.h (ix86_return_pops_args): Delete. * config/i386/i386.h (RETURN_POPS_ARGS): Delete. * config/i386/i386.c (ix86_return_pops_args): Make static. Constify arguments. (TARGET_RETURN_POPS_ARGS): Define. * config/m68k/m68k.h (RETURN_POPS_ARGS): Move to... * config/m68k/m68k.c (m68k_return_pops_args): ...here. New function. (TARGET_RETURN_POPS_ARGS): Define. * config/vax/vax.h (RETURN_POPS_ARGS): Move to... * config/vax/vax.c (vax_return_pops_args): ...here. New function. (TARGET_RETURN_POPS_ARGS): Define. From-SVN: r161528
2010-06-29 14:18:36 +02:00
@end deftypefn
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
@defmac CALL_POPS_ARGS (@var{cum})
Contribute sh64-elf. 2002-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_CANNOT_MODIFY_JUMPS_P): Define to... (sh_cannot_modify_jumps_p): New function. 2002-02-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_MS_BITFIELD_LAYOUT_P): Define to... (sh_ms_bitfield_layout_p): New function. 2002-02-04 Alexandre Oliva <aoliva@redhat.com> Zack Weinberg <zack@codesourcery.com> * config/sh/sh.h (TRAMPOLINE_ADJUST_ADDRESS): Use expand_simple_binop instead of expand_binop. 2002-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS) [! TARGET_SH5]: Disable use of .quad and .uaquad. * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_ALIGNED_DI_OP): Add comment pointing to the above. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_const, movdi_const_32bit, movdi_const_16bit): Make sure all CONSTs have modes. (sym2PIC): Ditto, but by adjusting all callers. * config/sh/sh.c (calc_live_regs) [TARGET_SHCOMPACT]: Set pr_live if the prologue calls the SHmedia argument decoder or register saver. 2002-01-24 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (TARGET_ASM_UNALIGNED_DI_OP): Define. (TARGET_ASM_ALIGNED_DI_OP): Likewise. (sh_expand_epilogue): Don't emit USE of return target register. (prepare_move_operands): Legitimize DImode PIC addresses. (sh_media_register_for_return): Skip tr0, used to initialize the PIC register. (sh_expand_prologue): Remove explicit USE of return register. (nonpic_symbol_mentioned_p): PC is non-PIC. Don't recurse in CONST_DOUBLEs. UNSPEC_GOTPLT is PIC. * config/sh/sh.h (ASM_OUTPUT_DOUBLE_INT): Removed, obsolete. (OVERRIDE_OPTIONS): Don't disable PIC on SH5. (EXTRA_CONSTRAINT_S): Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (GOT_ENTRY_P, GOTPLT_ENTRY_P, GOTOFF_P, PIC_ADDR_P): New. (MOVI_SHORI_BASE_OPERAND_P): New. (NON_PIC_REFERENCE_P, PIC_REFERENCE_P): New. (EXTRA_CONSTRAINT_T): Define in terms of them. (OUTPUT_ADDR_CONST_EXTRA): Handle UNSPEC_GOTPLT. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu): Add SIBCALL_REGS class to alternatives supporting TARGET_REGS. (UNSPEC_GOTPLT): New constant. (movdi split): Move incrementing of LABEL_NUSES... (movdi_const, movdi_const_32bit): Here. Use MOVI_SHORI_BASE_OPERAND_P instead of EXTRA_CONSTRAINT_T. (movdi_const_16bit): New. (call, call_value) [flag_pic]: Use GOTPLT. (call_pop, call_value_pop): New expands. (call_pop_compact, call_pop_rettramp): New insns. (call_value_pop_compact, call_value_pop_rettramp): New insns. (sibcall) [flag_pic]: Use GOT. (builtint_setjmp_receiver): Remove bogus, unused expand. (GOTaddr2picreg): Implement for SHcompact and SHmedia. (*pt, *ptb, ptrel): New insns. (sym2GOT): Handle DImode GOT. (sym2GOTPLT, symGOTPLT2reg): New expands. (sym2PIC): New expand. (shcompact_return_tramp): Use GOTPLT to return trampoline. (shcompact_return_tramp_i): Use return register explicitly. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SHMEDIA]: Don't disable flag_reorder_blocks. 2002-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Reorder return, uses and clobbers, for clarity. (sibcall_epilogue) [TARGET_SHCOMPACT]: Mark saving and restoring of r0 in macl as MAYBE_DEAD. 2002-01-18 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (LONG_DOUBLE_TYPE_SIZE): Define. * config/sh/sh.md (movv4sf_i, movv16sf_i): Fix uses of alter_subreg all over. (jump) [TARGET_SHMEDIA]: FAIL to create new jumps after reload, instead of emitting instructions that would require reloading. (casesi_load_media): Add missing modes. 2001-11-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (sh_expand_prologue): Mark the PIC register as used if the argument decoder is called. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (udivsi3, divsi3): Load libcall symbol name in Pmode, then extend it to DImode if necessary. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Don't accept DFmode constants in FPU-enabled SHmedia, let them be loaded from memory. 2001-08-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (cmpeqdi_media, cmpgtdi_media, cmpgtudi_media): Adjust whitespace in assembly output templates. 2001-08-28 Stephen Clarke <Stephen.Clarke@st.com> * config/sh/sh.md (movdicc_false, movdicc_true, movdicc): Adjust mode of if_then_else. 2001-08-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): Override definition in sh.h. 2001-07-26 Andrew Haley <aph@cambridge.redhat.com> Joern Rennecke <amylaar@redhat.com> * config/sh/sh64.h (CPP_DEFAULT_CPU_SPEC): New. (SUBTARGET_CPP_PTR_SPEC): New. (SUBTARGET_CPP_SPEC): Remove. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Fix typo in previous checkin. 2001-07-11 Chandrakala Chavva <cchavva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Fix redact indentations. 2001-07-10 Chandrakala Chavva <cchavva@cygnus.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MODES_TIEABLE_P): Don't tie modes wider than what single FP register can hold for SHmedia target. 2001-07-06 Chandrakala Chavva <cchavva@redhat.com> Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movsf_media_nofpu+1, movdf_media_nofpu+1): Do not split into SUBREG. 2001-06-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/ushmedia.h, config/sh/sshmedia.h: Updated signatures and added new functions as specified in SH5 ABI r9. 2001-06-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_nested_trampoline): Align to an 8-byte boundary. 2001-06-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (dump_table): Add const0_rtx in calls of gen_consttable_4 and gen_consttable_8. Emit multiple labels and consttable_window_ends. 2001-06-03 Graham Stott <grahams@redhat,com> * config/sh/sh.md (movdi split): Remove unused variable last_insn. 2001-05-16 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand): Handle floating-point pair, vector and matrix registers. * config/sh/sh.h (REGISTER_MOVE_COST): Take floating-pointer vector modes into account. * config/sh/sh.md (movv2sf): Split move between registers into movdf. (movv4sf, movv16sf): Introduce insns that get split only after reload. * config/sh/shmedia.h: Fix Copyright dates. * config/sh/ushmedia.h: Likewise. Move loop counter declarations into conditionals that uses them. (sh_media_FVADD_S, sh_media_FVSUB_S): Fix off-by-one error in loop boundary. * config/sh/sshmedia.h: Fix Copyright dates. (sh_media_PUTCFG): Fix constraints. 2001-05-12 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_PTRMEMFUNC_VBIT_LOCATION): Define to ptrmemfunc_vbit_in_delta for SH5. 2001-05-08 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (TARGET_SWITCHES): Document -m5-*. * invoke.texi: Likewise. 2001-04-14 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (GCC_push_shmedia_regs, GCC_push_shmedia_regs_nofpu, GCC_pop_shmedia_regs, GCC_pop_shmedia_regs_nofpu): New global symbols. * config/sh/t-sh64 (LIB1ASMFUNCS): Add them. * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): New macro. * config/sh/sh.c (calc_live_regs): Account for PR's saving in compact function with nonlocal labels. (sh_expand_prologue) [SHcompact]: Push SHmedia regs if needed. (sh_expand_epilogue) [SHcompact]: Pop them when appropriate. (initial_elimination_offset): Account for their stack space. * config/sh/sh.md (shmedia_save_restore_regs_compact): New insn. * config/sh/sh.md (movsi_media, movsi_media_nofpu, movqi_media, movhi_media, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Require at least one of the operands to be a register. (movv2sf): Likewise. Renamed to movv2sf_i. (movdi, movdf, movv2sf, movv4sf, movv16sf, movsf): prepare_move_operands() before emitting SHmedia insns. 2001-04-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/crti.asm (init, fini) [__SH5__ && ! __SHMEDIA__]: Don't save nor initialize r12. Don't mis-align the stack. Pad the code with a nop. * config/sh/crti.asm: Don't restore r12. Don't mis-align the stack. 2001-03-13 Alexandre Oliva <aoliva@redhat.com> * gcc/longlong.h (__umulsidi3, count_leading_zeros) [__SHMEDIA__]: Implement. 2001-03-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md: Set latency of `pt' closer to reality. (movsi_media, movsi_media_nofpu, movdi_media, movdi_media_nofpu, movdf_media, movdf_media_nofpu, movsf_media, movsf_media_nofpu): Set move, load and store type attributes. * config/sh/sh.c (sh_loop_align) [TARGET_SH5]: Set to 3. * config/sh/sh.h (OVERRIDE_OPTIONS) [TARGET_SH5]: Disable profiling. * config/sh/sh.h (PROMOTE_MODE): Sign-extend SImode to DImode. * config/sh/sh-protos.h (sh_media_register_for_return): Declare. * config/sh/sh.c (sh_media_register_for_return): New function. (sh_expand_prologue) [TARGET_SHMEDIA]: Copy r18 to an available branch-target register. (sh_expand_epilogue) [TARGET_SHMEDIA]: Explicitly USE it. * config/sh/sh.md (return_media_i): Use any call-clobbered branch-target register. (return_media): If r18 wasn't copied in the prologue, copy it here. * config/sh/sh.h (CONDITIONAL_REGISTER_USAGE) [TARGET_SHMEDIA]: Clear class FP0_REGS. * config/sh/sh64.h (LINK_SPEC): Removed incorrect default copied from elf.h. 2001-03-08 DJ Delorie <dj@redhat.com> * config/sh/sh.h (OVERRIDE_OPTIONS): Disable relaxing for SHMEDIA. 2001-02-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sibcall_compact): Set fp_mode to single. 2001-02-07 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INT_ASM_OP) [SHMEDIA64]: Use `.quad'. 2001-02-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_ARGS): Compute size of BLKmode return value correctly for call_cookie. 2001-02-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Modified so as to call ___setup_argv_and_call_main. 2001-01-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't count stack_regs in SHmedia mode. 2001-01-20 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_DATALABEL_ENCODING): New macro. (STRIP_NAME_ENCODING): Use it. (ASM_OUTPUT_LABELREF): Likewise. Don't call assemble_name(). 2001-01-19 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (sgeu) [! SHMEDIA]: Fix invocation of prepare_scc_operands(). * config/sh/sh.h (SH_DATALABEL_ENCODING): Change to "#"... (DATALABEL_SYMNAME_P): ... so that we don't need memcmp here. 2001-01-17 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (STRIP_NAME_ENCODING): Strip leading `*'. 2001-01-13 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Use R0_REG. * config/sh/sh.md (R7_REG, R8_REG, R9_REG): Define as constants, used in shcompact_incoming_args. * config/sh/sh.c (sh_expand_epilogue): Fix thinko in previous change. * config/sh/crt1.asm (start) [SH5]: Switch to single-precision mode. * config/sh/lib1funcs.asm (sdivsi3_i4, udivsi3_i4, set_fpscr): Adjust accordingly. * config/sh/sh.c (sh_expand_prologue, sh_expand_epilogue): Simplify. Adjust. Add sanity check. * config/sh/sh.h (TARGET_SWITCHES) [5-compact]: Set FPU_SINGLE_BIT. * config/sh/sh.md (udivsi3_i4_single, divsi3_i4_single): Match TARGET_SHCOMPACT. (udivsi3, divsi3): Use them. (force_mode_for_call): New insn. (call, call_value, sibcall_value): Emit it before SHcompact calls. 2001-01-11 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (call, call_value, sibcall): Make sure the call cookie is non-NULL before taking its value. 2001-01-10 Alexandre Oliva <aoliva@redhat.com> * config.gcc (sh64): Set target_requires_64bit_host_wide_int. 2001-01-09 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (shcompact_incoming_args): Set argument memory block. * config/sh/sh.h (STATIC_CHAIN_REGNUM) [SH5]: Use r1. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r0 as temporary for stack adjusts. Use MACL and MACH to pass arguments to shcompact_incoming_args. * config/sh/sh.md (shcompact_incoming_args): Adjust. Don't clobber r1. * config/sh/lib1funcs.asm (shcompact_incoming_args): Likewise. (nested_trampoline): Load static chain address into r1. * config/sh/sh.md (movdi_media splits): Fix sign-extension. 2001-01-07 Alexandre Oliva <aoliva@redhat.com * config/sh/sh.c (fpul_operand) [SHMEDIA]: Just call fp_arith_reg_operand(). 2001-01-06 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (casesi): Sign-extend the first two operands, and use signed compares for them. * config/sh/sh.c (dump_table): Don't emit 8-byte constants after 4-byte ones. Instead, inter-leave them, maintaining the 8-byte ones properly aligned. (find_barrier): Account for extra alignment needed for 8-byte wide constants. (machine_dependent_reorg): Require a label for the second 4-byte constant after an 8-byte one. * config/sh/lib1funcs.asm (sdivsi3): Fix typo in yesterday's change. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (machine_dependent_reorg) [SHCOMPACT]: Reset last_float when switching float modes. * config/sh/sh.md (movdf) [SH5]: Don't use stack-pointer auto-increment for general-purpose registers. * config/sh/lib1funcs.asm (sdivsi3) [SHMEDIA]: Sign-extend the result. * config/sh/sh.c (sh_expand_prologue) [SH5]: Use r1 as temporary for stack adjust. * config/sh/sh.c (sh_builtin_saveregs): Support using all registers for varargs. 2001-01-01 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Simplify. * config/sh/sh.h (CALL_COOKIE_STACKSEQ, CALL_COOKIE_STACKSEQ_SHIFT, CALL_COOKIE_STACKSEQ_GET): New macros. (CALL_COOKIE_INT_REG_SHIFT): Adjust. (FUNCTION_ARG_ADVANCE): Use SHCOMPACT_FORCE_ON_STACK. Adjust call_cookie accordingly. (FUNCTION_ARG): Test SHCOMPACT_FORCE_ON_STACK. (SHCOMPACT_BYREF): Likewise. (SHCOMPACT_FORCE_ON_STACK): New macro. * config/sh/sh.c (sh_expand_prologue): Use new call_cookie format. (sh_builtin_saveregs): Likewise. * config/sh/lib1funcs.asm (shcompact_call_trampoline, shcompact_incoming_args): Use new shift values. Support sequences of consecutive and non-consecutive pushes/pops. * config/sh/sh.md (return): Don't explicitly use PR_REG. 2001-01-05 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/sh.h (TEXT_SECTION): Define. * config/sh/elf.h (ASM_FILE_START): Output TEXT_SECTION_ASM_OP. 2001-01-05 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (INIT_CUMULATIVE_LIBCALL_ARGS): New macro. * config/sh/sh.h (BASE_RETURN_VALUE_REG): Use FP regs for return values on FPU-enabled SHmedia. (FUNCTION_VALUE_REGNO_P): Mark FIRST_FP_RET_REG as used on FPU-enabled SHmedia. (INIT_CUMULATIVE_ARGS): Set up return trampoline only if value is returned in a non-FP reg and is not returned by reference. * config/sh/sh.md (shcompact_return_tramp_i): Change type to jump_ind. 2000-01-04 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (SH_MIN_ALIGN_FOR_CALLEE_COPY): New. (FUNCTION_ARG_CALLEE_COPIES): Require argument to be quad-aligned to be passed by callee-copy reference. 2001-01-03 Alexandre Oliva <aoliva@redhat.com> * config/sh/elf.h (MAX_WCHAR_TYPE_SIZE): Define. * config/sh/sh64.h (MAX_WCHAR_TYPE_SIZE): Undefine. 2001-01-02 Alexandre Oliva <aoliva@redhat.com> * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix error in copying low-numbered FP regs to r7 and r8. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Don't request copying of FP regs to general-purpose regs only if the copy was passed on the stack. * config/sh/lib1funcs.asm (shcompact_call_trampoline): Fix typo in copying FP reg to r9. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Use trampoline to copy FP regs to general-purpose regs only in outgoing calls. * config/sh/sh.md (movdf_media, movsf_media): Revert incorrect change from 2000-10-30. Adjust for 64-bit (or 32-bit) HOST_WIDE_INT. * config/sh/sh.h (struct sh_args): Document all fields. (FUNCTION_OK_FOR_SIBCALL): Functions that receive arguments passed partially on the stack should not consider making sibcalls. * config/sh/sh.h (FUNCTION_ARG_ADVANCE): Add byref regs to stack_regs only for incoming calls. When passing FP args, make sure there are FP regs available before modifying call_cookie. (SHCOMPACT_BYREF): Pass double args in general-purpose registers by reference. 2000-12-30 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (FUNCTION_OK_FOR_SIBCALL) [SHCOMPACT]: Don't attempt to generate sibcalls if the caller got any arguments by reference. * config/sh/lib1funcs.asm (set_fpscr) [SH5]: Default to double. * config/sh/sh.c (dump_table) [SHCOMPACT]: Align DImode and DFmode to 8-byte boundaries. * config/sh/sh.md (shcompact_preserve_incoming_args): New insn. * config/sh/sh.h (CALL_COOKIE_INT_REG_GET): New macro. * config/sh/sh.c (sh_expand_prologue): Preserve args that will be stored in the stack. * config/sh/lib1funcs.asm (ct_main_table, ia_main_table): Arrange for the offsets to have the ISA bit set. (shcompact_call_trampoline): Document. Swap r0 and r1, to match invocation. Use beq instead of bgt to mark end of sequence of loads. (shcompact_incoming_args): Fix store of r2. Use beq instead of bgt to mark end of sequence of stores. * config/sh/sh.c (arith_operand): Don't check whether CONST_OK_FOR_J for now. * config/sh/sh.md (movdf_media, movsf_media): Use HOST_WIDE_INT instead of long for conversion. 2000-12-29 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.c (print_operand_address): Convert INTVAL to int before passing it to fprintf. 2000-12-28 Alexandre Oliva <aoliva@redhat.com> * config/sh/crt1.asm (start): Reset SR.FD, to enable the FP unit. Call set_fpscr before reading/writing SR. * config/sh/crt1.asm (start): Set SR.SZ and SR.PR, but not SR.FR. Call set_fpscr. * config/sh/lib1funcs.asm: Add `.align 2' directives before SHmedia code. (FMOVD_WORKS): Define on SH5 with FPU. (set_fpscr): Define on SH5. Remove separate _fpscr_values setting. * config/sh/t-sh64 (LIB1ASMFUNCS): Add _set_fpscr instead of _fpscr_values. 2000-12-28 Hans-Peter Nilsson <hpn@cygnus.com> * config/sh/lib1funcs.asm (ct_main_table): Align contents to even address. (ia_main_table): Ditto. 2000-12-27 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.h (MAX_WCHAR_TYPE_SIZE): Don't define. * config/sh/sh64.h (WCHAR_TYPE, WCHAR_TYPE_SIZE): Reinstate the definitions from sh.h. * config/sh/sh.h (PTRDIFF_TYPE): Define as conditional on TARGET_SH5. (SUBTARGET_CPP_SPEC): Arrange for __PTRDIFF_TYPE__ to be defined. * config/sh/elf.h (PTRDIFF_TYPE): Likewise. * config/sh/sh64.h (SUBTARGET_CPP_SPEC): Likewise. 2000-12-26 Alexandre Oliva <aoliva@redhat.com> * config/sh/sh.md (movdi_media split): Don't add REG_LABEL notes. Increment LABEL_NUSES. From-SVN: r49630
2002-02-09 04:08:08 +01:00
A C expression that should indicate the number of bytes a call sequence
pops off the stack. It is added to the value of @code{RETURN_POPS_ARGS}
when compiling a function call.
@var{cum} is the variable in which all arguments to the called function
have been accumulated.
On certain architectures, such as the SH5, a call trampoline is used
that pops certain registers off the stack, depending on the arguments
that have been passed to the function. Since this is a property of the
call site, not of the called function, @code{RETURN_POPS_ARGS} is not
appropriate.
@end defmac
1996-09-25 01:21:45 +02:00
@node Register Arguments
@subsection Passing Arguments in Registers
@cindex arguments in registers
@cindex registers arguments
This section describes the macros which let you control how various
types of arguments are passed in registers or how they are arranged in
the stack.
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_FUNCTION_ARG (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
Return an RTX indicating whether a function argument is passed in a
register and if so, which register.
1996-09-25 01:21:45 +02:00
The arguments are @var{ca}, which summarizes all the previous
1996-09-25 01:21:45 +02:00
arguments; @var{mode}, the machine mode of the argument; @var{type},
the data type of the argument as a tree node or 0 if that is not known
(which happens for C support library functions); and @var{named},
which is @code{true} for an ordinary argument and @code{false} for
nameless arguments that correspond to @samp{@dots{}} in the called
function's prototype. @var{type} can be an incomplete type if a
syntax error has previously occurred.
1996-09-25 01:21:45 +02:00
The return value is usually either a @code{reg} RTX for the hard
register in which to pass the argument, or zero to pass the argument
on the stack.
1996-09-25 01:21:45 +02:00
The value of the expression can also be a @code{parallel} RTX@. This is
1996-09-25 01:21:45 +02:00
used when an argument is passed in multiple locations. The mode of the
@code{parallel} should be the mode of the entire argument. The
1996-09-25 01:21:45 +02:00
@code{parallel} holds any number of @code{expr_list} pairs; each one
describes where part of the argument is passed. In each
@code{expr_list} the first operand must be a @code{reg} RTX for the hard
register in which to pass this part of the argument, and the mode of the
register RTX indicates how large this part of the argument is. The
second operand of the @code{expr_list} is a @code{const_int} which gives
the offset in bytes into the entire argument of where this part starts.
As a special exception the first @code{expr_list} in the @code{parallel}
RTX may have a first operand of zero. This indicates that the entire
argument is also stored on the stack.
1996-09-25 01:21:45 +02:00
The last time this hook is called, it is called with @code{MODE ==
VOIDmode}, and its result is passed to the @code{call} or @code{call_value}
pattern as operands 2 and 3 respectively.
1996-09-25 01:21:45 +02:00
@cindex @file{stdarg.h} and register arguments
The usual way to make the ISO library @file{stdarg.h} work on a
machine where some arguments are usually passed in registers, is to
cause nameless arguments to be passed on the stack instead. This is
done by making @code{TARGET_FUNCTION_ARG} return 0 whenever
@var{named} is @code{false}.
@cindex @code{TARGET_MUST_PASS_IN_STACK}, and @code{TARGET_FUNCTION_ARG}
@cindex @code{REG_PARM_STACK_SPACE}, and @code{TARGET_FUNCTION_ARG}
target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target.h (struct gcc_target): Add calls.must_pass_in_stack. * expr.h (MUST_PASS_IN_STACK): Remove. * system.h (MUST_PASS_IN_STACK): Poison. * tree.h (must_pass_in_stack_var_size): Declare. (must_pass_in_stack_var_size_or_pad): Declare. * calls.c (must_pass_in_stack_var_size): New. (must_pass_in_stack_var_size_or_pad): Rename from default_must_pass_in_stack. * config/alpha/alpha.c (unicosmk_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove. * config/fr30/fr30.c (fr30_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove. * config/frv/frv.c (frv_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/frv/frv.h (MUST_PASS_IN_STACK): Remove. * config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove. * config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New. (ix86_must_pass_in_stack): Make static. * config/i386/i386.h (MUST_PASS_IN_STACK): Remove. * config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New. * config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove. * config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New. * config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove. * config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New. (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove. * config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New. * config/mips/mips.h (MUST_PASS_IN_STACK): Remove. * config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New. * config/pa/pa.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.h (MUST_PASS_IN_STACK): Remove. * config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New. * config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove. * config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New. * config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove. * doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from MUST_PASS_IN_STACK. * calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c, config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h, config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/xtensa/xtensa.c: Use target hook. From-SVN: r84606
2004-07-13 09:45:09 +02:00
You may use the hook @code{targetm.calls.must_pass_in_stack}
1996-09-25 01:21:45 +02:00
in the definition of this macro to determine if this argument is of a
type that must be passed in the stack. If @code{REG_PARM_STACK_SPACE}
is not defined and @code{TARGET_FUNCTION_ARG} returns nonzero for such an
1996-09-25 01:21:45 +02:00
argument, the compiler will abort. If @code{REG_PARM_STACK_SPACE} is
defined, the argument will be computed in the stack and then loaded into
a register.
@end deftypefn
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_MUST_PASS_IN_STACK (machine_mode @var{mode}, const_tree @var{type})
target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target.h (struct gcc_target): Add calls.must_pass_in_stack. * expr.h (MUST_PASS_IN_STACK): Remove. * system.h (MUST_PASS_IN_STACK): Poison. * tree.h (must_pass_in_stack_var_size): Declare. (must_pass_in_stack_var_size_or_pad): Declare. * calls.c (must_pass_in_stack_var_size): New. (must_pass_in_stack_var_size_or_pad): Rename from default_must_pass_in_stack. * config/alpha/alpha.c (unicosmk_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove. * config/fr30/fr30.c (fr30_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove. * config/frv/frv.c (frv_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/frv/frv.h (MUST_PASS_IN_STACK): Remove. * config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove. * config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New. (ix86_must_pass_in_stack): Make static. * config/i386/i386.h (MUST_PASS_IN_STACK): Remove. * config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New. * config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove. * config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New. * config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove. * config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New. (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove. * config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New. * config/mips/mips.h (MUST_PASS_IN_STACK): Remove. * config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New. * config/pa/pa.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.h (MUST_PASS_IN_STACK): Remove. * config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New. * config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove. * config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New. * config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove. * doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from MUST_PASS_IN_STACK. * calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c, config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h, config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/xtensa/xtensa.c: Use target hook. From-SVN: r84606
2004-07-13 09:45:09 +02:00
This target hook should return @code{true} if we should not pass @var{type}
solely in registers. The file @file{expr.h} defines a
definition that is usually appropriate, refer to @file{expr.h} for additional
documentation.
target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target-def.h (TARGET_MUST_PASS_IN_STACK): New. * target.h (struct gcc_target): Add calls.must_pass_in_stack. * expr.h (MUST_PASS_IN_STACK): Remove. * system.h (MUST_PASS_IN_STACK): Poison. * tree.h (must_pass_in_stack_var_size): Declare. (must_pass_in_stack_var_size_or_pad): Declare. * calls.c (must_pass_in_stack_var_size): New. (must_pass_in_stack_var_size_or_pad): Rename from default_must_pass_in_stack. * config/alpha/alpha.c (unicosmk_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/alpha/unicosmk.h (MUST_PASS_IN_STACK): Remove. * config/fr30/fr30.c (fr30_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/fr30/fr30.h (MUST_PASS_IN_STACK): Remove. * config/frv/frv.c (frv_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/frv/frv.h (MUST_PASS_IN_STACK): Remove. * config/i386/i386-protos.h (ix86_must_pass_in_stack): Remove. * config/i386/i386.c (TARGET_MUST_PASS_IN_STACK): New. (ix86_must_pass_in_stack): Make static. * config/i386/i386.h (MUST_PASS_IN_STACK): Remove. * config/ia64/ia64.c (TARGET_MUST_PASS_IN_STACK): New. * config/ia64/ia64.h (MUST_PASS_IN_STACK): Remove. * config/m32r/m32r.c (TARGET_MUST_PASS_IN_STACK): New. * config/m32r/m32r.h (MUST_PASS_IN_STACK): Remove. * config/mcore/mcore-protos.h (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.c (TARGET_MUST_PASS_IN_STACK): New. (mcore_must_pass_on_stack): Remove. * config/mcore/mcore.h (MUST_PASS_IN_STACK): Remove. * config/mips/mips.c (TARGET_MUST_PASS_IN_STACK): New. * config/mips/mips.h (MUST_PASS_IN_STACK): Remove. * config/pa/pa.c (TARGET_MUST_PASS_IN_STACK): New. * config/pa/pa.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/aix.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/linux64.h (MUST_PASS_IN_STACK): Remove. * config/rs6000/rs6000.c (rs6000_must_pass_in_stack): New. (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.c (TARGET_MUST_PASS_IN_STACK): New. * config/sh/sh.h (MUST_PASS_IN_STACK): Remove. * config/sparc/sparc.c (TARGET_MUST_PASS_IN_STACK): New. * config/sparc/sparc.h (MUST_PASS_IN_STACK): Remove. * config/xtensa/xtensa.c (TARGET_MUST_PASS_IN_STACK): New. * config/xtensa/xtensa.h (MUST_PASS_IN_STACK): Remove. * doc/tm.texi (TARGET_MUST_PASS_IN_STACK): Update from MUST_PASS_IN_STACK. * calls.c, function.c, config/alpha/alpha.c, config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.c, config/cris/cris.h, config/fr30/fr30.c, config/fr30/fr30.h, config/frv/frv.c, config/i386/i386.c, config/iq2000/iq2000.c, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/xtensa/xtensa.c: Use target hook. From-SVN: r84606
2004-07-13 09:45:09 +02:00
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_FUNCTION_INCOMING_ARG (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
Define this hook if the target machine has ``register windows'', so
1996-09-25 01:21:45 +02:00
that the register in which a function sees an arguments is not
necessarily the same as the one in which the caller passed the
argument.
For such machines, @code{TARGET_FUNCTION_ARG} computes the register in
which the caller passes the value, and
@code{TARGET_FUNCTION_INCOMING_ARG} should be defined in a similar
fashion to tell the function being called where the arguments will
arrive.
1996-09-25 01:21:45 +02:00
If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined,
@code{TARGET_FUNCTION_ARG} serves both purposes.
@end deftypefn
1996-09-25 01:21:45 +02:00
re PR target/8340 (ICE on x86 inline asm w/ -fPIC) gcc/ PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * config/i386/i386.c (ix86_use_pseudo_pic_reg): New. (ix86_init_pic_reg): New. (ix86_select_alt_pic_regnum): Add check on pseudo register. (ix86_save_reg): Likewise. (ix86_expand_prologue): Remove PIC register initialization now performed in ix86_init_pic_reg. (ix86_output_function_epilogue): Add check on pseudo register. (set_pic_reg_ever_alive): New. (legitimize_pic_address): Replace df_set_regs_ever_live with new set_pic_reg_ever_alive. (legitimize_tls_address): Likewise. (ix86_pic_register_p): New check. (ix86_delegitimize_address): Add check on pseudo register. (ix86_expand_call): Insert move from pseudo PIC register to ABI defined REAL_PIC_OFFSET_TABLE_REGNUM. (TARGET_INIT_PIC_REG): New. (TARGET_USE_PSEUDO_PIC_REG): New. * config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Return INVALID_REGNUM if pic_offset_table_rtx exists. * doc/tm.texi.in (TARGET_USE_PSEUDO_PIC_REG, TARGET_INIT_PIC_REG): Document. * doc/tm.texi: Regenerate. * function.c (assign_parms): Generate pseudo register for PIC. * init-regs.c (initialize_uninitialized_regs): Ignor pseudo PIC register. * ira-color.c (color_pass): Add check on pseudo register. * ira-emit.c (change_loop): Don't create copies for PIC pseudo register. * ira.c (split_live_ranges_for_shrink_wrap): Add check on pseudo register. (ira): Add target specific PIC register initialization. (do_reload): Keep PIC pseudo register. * lra-assigns.c (spill_for): Add checks on pseudo register. * lra-constraints.c (contains_symbol_ref_p): New. (lra_constraints): Enable lra risky transformations when PIC is pseudo register. * shrink-wrap.c (try_shrink_wrapping): Add check on pseudo register. * target.def (use_pseudo_pic_reg): New. (init_pic_reg): New. gcc/testsuite/ PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * gcc.target/i386/pic-1.c: Remove dg-error as test should pass now. * gcc.target/i386/pr55458.c: Likewise. * gcc.target/i386/pr47602.c: New. * gcc.target/i386/pr23098.c: Move to XFAIL. From-SVN: r216154
2014-10-13 19:26:49 +02:00
@deftypefn {Target Hook} bool TARGET_USE_PSEUDO_PIC_REG (void)
This hook should return 1 in case pseudo register should be created
for pic_offset_table_rtx during function expand.
@end deftypefn
@deftypefn {Target Hook} void TARGET_INIT_PIC_REG (void)
Perform a target dependent initialization of pic_offset_table_rtx.
This hook is called at the start of register allocation.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t @var{cum}, machine_mode @var{mode}, tree @var{type}, bool @var{named})
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
This target hook returns the number of bytes at the beginning of an
argument that must be put in registers. The value must be zero for
1996-09-25 01:21:45 +02:00
arguments that are passed entirely in registers or that are entirely
pushed on the stack.
On some machines, certain arguments must be passed partially in
registers and partially in memory. On these machines, typically the
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
first few words of arguments are passed in registers, and the rest
1996-09-25 01:21:45 +02:00
on the stack. If a multi-word argument (a @code{double} or a
structure) crosses that boundary, its first few words must be passed
in registers and the rest must be pushed. This macro tells the
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
compiler when this occurs, and how many bytes should go in registers.
1996-09-25 01:21:45 +02:00
@code{TARGET_FUNCTION_ARG} for these arguments should return the first
1996-09-25 01:21:45 +02:00
register to be used by the caller for this argument; likewise
@code{TARGET_FUNCTION_INCOMING_ARG}, for the called function.
target.h (targetm.calls.arg_partial_bytes): New. * target.h (targetm.calls.arg_partial_bytes): New. * target-def.h (TARGET_ARG_PARTIAL_BYTES): New. * calls.c (store_unaligned_arguments_into_pseudos): Update for partial in bytes. (load_register_parameters): Likewise. (store_one_arg): Likewise. (initialize_argument_information): Use targetm.calls.arg_partial_bytes. (emit_library_call_value_1): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. (emit_push_insn): Update for partial in bytes. * expr.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * function.c (assign_parm_find_entry_rtl): Use targetm.calls.arg_partial_bytes. Update for result in bytes. (locate_and_pad_parm): Update for partial in bytes. * system.h (FUNCTION_ARG_PARTIAL_NREGS): Poison. * targhooks.c (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): New. * targhooks.h (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Declare. * doc/tm.texi (TARGET_ARG_PARTIAL_BYTES): Rename and update from FUNCTION_ARG_PARTIAL_NREGS. * config/arc/arc.h, config/c4x/c4x.h, config/i386/i386.h, config/i860/i860.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/pdp11/pdp11.h, config/s390/s390.h, config/stormy16/stormy16.h, config/xtensa/xtensa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/alpha/alpha.c (alpha_arg_partial_bytes): New. (TARGET_ARG_PARTIAL_BYTES): New. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/alpha/vms.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/arm/arm.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/arm/arm.c (arm_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/cris/cris.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/cris/cris.c (cris_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/fr30/fr30.c (fr30_arg_partial_bytes): Rename from fr30_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/fr30/fr30-protos.h: Update. * config/frv/frv.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/frv/frv.c (frv_arg_partial_bytes): Rename from frv_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/frv/frv-protos.h: Update. * config/ia64/ia64.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/ia64/ia64.c (ia64_arg_partial_bytes): Rename from ia64_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/ia64/ia64-protos.h: Update. * config/iq2000/iq2000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/iq2000/iq2000.c (iq2000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/iq2000/iq2000-protos.h: Update. * config/m32r/m32r.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/m32r/m32r.c (m32r_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/m32r/m32r-protos.h: Update. * config/mcore/mcore.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mcore/mcore.c (mcore_arg_partial_bytes): Rename from mcore_function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mcore/mcore-protos.h: Update. * config/mips/mips.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mips/mips.c (mips_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mips/mips-protos.h: Update. * config/mn10300/mn10300.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/mn10300/mn10300.c (mn10300_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/mn10300/mn10300-protos.h: Update. * config/ns32k/ns32k.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/ns32k/ns32k.c (ns32k_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/pa/pa.c (pa_arg_partial_bytes): Rename from function_arg_partial_nregs. Handle 32-bit. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/pa/pa-protos.h: Update. * config/rs6000/rs6000.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/rs6000/rs6000-protos.h: Update. * config/sh/sh.h (FUNCTION_ARG_PARTIAL_NREGS): Move ... * config/sh/sh.c (sh_arg_partial_bytes): ... here. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/sparc/sparc.c (sparc_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/sparc/sparc-protos.h: Update. * config/v850/v850.h (FUNCTION_ARG_PARTIAL_NREGS): Remove. * config/v850/v850.c (v850_arg_partial_bytes): Rename from function_arg_partial_nregs. Adjust to return bytes. (TARGET_ARG_PARTIAL_BYTES): New. * config/v850/v850-protos.h: Update. From-SVN: r92726
2004-12-30 04:08:18 +01:00
@end deftypefn
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_PASS_BY_REFERENCE (cumulative_args_t @var{cum}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
This target hook should return @code{true} if an argument at the
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
position indicated by @var{cum} should be passed by reference. This
predicate is queried after target independent reasons for being
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
passed by reference, such as @code{TREE_ADDRESSABLE (type)}.
If the hook returns true, a copy of that argument is made in memory and a
1996-09-25 01:21:45 +02:00
pointer to the argument is passed instead of the argument itself.
The pointer is passed in whatever way is appropriate for passing a pointer
to that type.
target.h (struct gcc_target): Add calls.pass_by_reference. * target.h (struct gcc_target): Add calls.pass_by_reference. * target-def.h (TARGET_PASS_BY_REFERENCE): New. * function.c (pass_by_reference): Use the hook. * system.h (FUNCTION_ARG_PASS_BY_REFERENCE): Poison. * targhooks.c, targhooks.h (hook_pass_by_reference_false): New. (hook_pass_by_reference_must_pass_in_stack): New. * config/alpha/alpha.c (function_arg): Don't query pass-by-ref. (alpha_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/alpha/alpha.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/arc/arc.c (arc_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/arc/arc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/arm/arm-protos.h (arm_function_arg_pass_by_reference): Remove. * config/arm/arm.c (TARGET_PASS_BY_REFERENCE): New. (arm_pass_by_reference): Rename from arm_function_arg_pass_by_reference. * config/arm/arm.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/c4x/c4x.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/cris/cris.c (cris_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/cris/cris.h (FUNCTION_ARG): Don't query pass-by-ref. (FUNCTION_INCOMING_ARG, FUNCTION_ARG_ADVANCE): Likewise. (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/fr30/fr30.c (TARGET_PASS_BY_REFERENCE): New. * config/fr30/fr30.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/frv/frv-protos.h (frv_function_arg_pass_by_reference): Kill. * config/frv/frv.c (TARGET_PASS_BY_REFERENCE): New. (frv_function_arg_pass_by_reference): Remove. * config/frv/frv.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/i386/i386-protos.h (function_arg_pass_by_reference): Remove. * config/i386/i386.c (TARGET_PASS_BY_REFERENCE): New. (ix86_pass_by_reference): Rename from function_arg_pass_by_reference. * config/i386/i386.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ia64/ia64-protos.h (ia64_function_arg_pass_by_reference): Kill. * config/ia64/ia64.c (TARGET_PASS_BY_REFERENCE): New. (ia64_pass_by_reference): Rename from ia64_function_arg_pass_by_reference. * config/ia64/ia64.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/ip2k/ip2k.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/iq2000/iq2000-protos.h (function_arg_pass_by_reference): Kill. * config/iq2000/iq2000.c (TARGET_PASS_BY_REFERENCE): New. (iq2000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/iq2000/iq2000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/m32r/m32r-protos.h (m32r_pass_by_reference): Remove. * config/m32r/m32r.c (TARGET_PASS_BY_REFERENCE): New. (m32r_pass_by_reference): Adjust prototype. Make static. Handle mode sizes correctly. * config/m32r/m32r.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c (m68hc11_function_arg_pass_by_reference): Remove. * config/m68hc11/m68hc11.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mcore/mcore.c (TARGET_PASS_BY_REFERENCE): New. * config/mcore/mcore.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/mips/mips-protos.h (function_arg_pass_by_reference): Remove. * config/mips/mips.c (TARGET_PASS_BY_REFERENCE): New. (mips_va_arg): Use pass_by_reference. (mips_pass_by_reference): Rename from function_arg_pass_by_reference. Handle mode sizes correctly. * config/mips/mips.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): Don't reference pass-by-ref. * config/mmix/mmix-protos.h (mmix_function_arg_pass_by_reference): Kill. * config/mmix/mmix.c (TARGET_PASS_BY_REFERENCE): New. (mmix_pass_by_reference): Rename from mmix_function_arg_pass_by_reference. * config/mmix/mmix.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/mn10300/mn10300.c (TARGET_PASS_BY_REFERENCE): New. (mn10300_pass_by_reference): New. * config/mn10300/mn10300.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/pa/pa.c (pa_pass_by_reference): New. (TARGET_PASS_BY_REFERENCE): New. * config/pa/pa.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * config/rs6000/rs6000-protos.h (function_arg_pass_by_reference): Kill. * config/rs6000/rs6000.c (TARGET_PASS_BY_REFERENCE): New. (rs6000_pass_by_reference): Rename from function_arg_pass_by_reference. * config/rs6000/rs6000.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/s390/s390-protos.h (s390_function_arg_pass_by_reference): Kill. * config/s390/s390.c (TARGET_PASS_BY_REFERENCE): New. (s390_pass_by_reference): Rename from s390_function_arg_pass_by_reference. (s390_function_arg_advance): Don't query pass-by-ref. (s390_function_arg): Likewise. (s390_gimplify_va_arg): Use pass_by_reference. (s390_call_saved_register_used): Likewise. * config/s390/s390.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/sh/sh.c (TARGET_PASS_BY_REFERENCE): New. (shcompact_byref, sh_pass_by_reference): New. * config/sh/sh.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (SHCOMPACT_BYREF): Remove. * config/sparc/sparc-protos.h (function_arg_pass_by_reference): Kill. * config/sparc/sparc.c (TARGET_PASS_BY_REFERENCE): New. (sparc_pass_by_reference): Rename from function_arg_pass_by_reference. (sparc_gimplify_va_arg): Use pass_by_reference. * config/sparc/sparc.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/stormy16/stormy16.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. * config/v850/v850.c (TARGET_PASS_BY_REFERENCE): New. (v850_pass_by_reference): New. * config/v850/v850.h (FUNCTION_ARG_PASS_BY_REFERENCE): Remove. (FUNCTION_ARG_CALLEE_COPIES): True. * doc/tm.texi (TARGET_PASS_BY_REFERENCE): Update from FUNCTION_ARG_PASS_BY_REFERENCE docs. From-SVN: r84672
2004-07-14 08:24:27 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_CALLEE_COPIES (cumulative_args_t @var{cum}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
The function argument described by the parameters to this hook is
known to be passed by reference. The hook should return true if the
function argument should be copied by the callee instead of copied
by the caller.
For any argument for which the hook returns true, if it can be
function.c (reference_callee_copied): New. * function.c (reference_callee_copied): New. (assign_parm_setup_reg): Use it. * calls.c (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.h (reference_callee_copied): Declare. * target.h (struct gcc_target): Add callee_copies. * target-def.h (TARGET_CALLEE_COPIES): New. (TARGET_PASS_BY_REFERENCE): Update default. * expr.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * targhooks.c (hook_callee_copies_named): New. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Rename from hook_pass_by_reference_false. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): New. * targhooks.h: Update decls. * config/arc/arc.c (TARGET_CALLEE_COPIES): New. * config/arc/arc.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/frv/frv-protos.h (frv_function_arg_callee_copies): Remove. * config/frv/frv.c (frv_function_arg_callee_copies): Remove. * config/frv/frv.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/iq2000/iq2000.c (TARGET_CALLEE_COPIES): New. * config/iq2000/iq2000.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/m68hc11/m68hc11.c (TARGET_CALLEE_COPIES): New. * config/m68hc11/m68hc11.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mips/mips.c (TARGET_CALLEE_COPIES): New. (mips_callee_copies): New. * config/mips/mips.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): New. * config/mmix/mmix.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): New. * config/mn10300/mn10300.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/pa/pa.c (TARGET_CALLEE_COPIES): New. * config/pa/pa.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/sh/sh.c (sh_callee_copies): New. (TARGET_CALLEE_COPIES): New. * config/sh/sh.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * config/v850/v850.c (TARGET_CALLEE_COPIES): New. * config/v850/v850.h (FUNCTION_ARG_CALLEE_COPIES): Remove. * doc/tm.texi (TARGET_CALLEE_COPIES): Replace documentation for FUNCTION_ARG_CALLEE_COPIES. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Update. From-SVN: r87195
2004-09-08 20:45:21 +02:00
determined that the argument is not modified, then a copy need
not be generated.
The default version of this hook always returns false.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac CUMULATIVE_ARGS
A C type for declaring a variable that is used as the first argument
of @code{TARGET_FUNCTION_ARG} and other related values. For some
target machines, the type @code{int} suffices and can hold the number
of bytes of argument so far.
1996-09-25 01:21:45 +02:00
There is no need to record in @code{CUMULATIVE_ARGS} anything about the
arguments that have been passed on the stack. The compiler has other
variables to keep track of that. For target machines on which all
arguments are passed on the stack, there is no need to store anything in
@code{CUMULATIVE_ARGS}; however, the data structure must exist and
should not be empty, so use @code{int}.
@end defmac
1996-09-25 01:21:45 +02:00
tm.texi (OVERRIDE_ABI_FORMAT): New. 2008-06-03 Kai Tietz <kai.tietz@onevision.com> * doc/tm.texi (OVERRIDE_ABI_FORMAT): New. * doc/extend.texi (ms_abi,sysv_abi): New attribute description. * function.c (allocate_struct_function): Use of OVERRIDE_ABI_FORMAT. * config/i386/cygming.h (TARGET_64BIT_MS_ABI): Make use of cfun and DEFAULT_ABI to deceide abi mode. (DEFAULT_ABI): New. (REG_PARM_STACK_SPACE): Removed. (OUTGOING_REG_PARM_STACK_SPACE): Removed. (STACK_BOUNDARY): Use default target to deceide stack boundary. * config/i386/i386-protos.h (ix86_cfun_abi): New. (ix86_function_abi): Likewise. (ix86_function_type_abi): Likewise. (ix86_call_abi_override): Likewise. * confid/i386/i386.md (SSE_REGPARM_MAX): Replaced by abi specific define X86_64_SSE_REGPARM_MAX/X64_SSE_REGPARM_MAX. * config/i386/i386.c (override_options): Replace TARGET_64BIT_MS_ABI. (X86_64_VARARGS_SIZE): Replace REGPARM_MAX and SSE_REGPARM_MAX by abi specific defines. (X86_64_REGPARM_MAX): New. (X86_64_SSE_REGPARM_MAX): New. (X64_REGPARM_MAX): New. (X64_SSE_REGPARM_MAX): New. (X86_32_REGPARM_MAX): New. (X86_32_SSE_REGPARM_MAX): New. (ix86_handle_cconv_attribute): Replace TARGET_64BIT_MS_ABI. (ix86_function_regparm): Handle user calling abi. (ix86_function_arg_regno_p): Replace TARGET_64BIT_MS_ABI by DEFAULT_ABI versus SYSV_ABI check. (ix86_reg_parm_stack_space): New. (ix86_function_type_abi): New. (ix86_call_abi_override): New. (ix86_function_abi): New. (ix86_cfun_abi): New. (init_cumulative_args): Call abi specific initialization. (function_arg_advance): Remove TARGET_64BIT_MS_ABI. (function_arg_64): Extend SSE_REGPARM_MAX check. (function_arg (): Remove TARGET_64BIT_MS_ABI. (ix86_pass_by_reference): Likewise. (ix86_function_value_regno_p): Likewise. (function_value_64): Replace REGPARM_MAX, and SSE_REGPARM_MAX. (ix86_function_value_1): Replace TARGET_64BIT_MS_ABI. (return_in_memory_ms_64): Replace TARGET_64BIT_MS_ABI. (ix86_build_builtin_va_list): Replace TARGET_64BIT_MS_ABI. (setup_incoming_varargs_64): Adjust regparm for call abi. (ix86_setup_incoming_varargs): Replace TARGET_64BIT_MS_ABI. (ix86_va_start): Likewise. (ix86_gimplify_va_arg): Likewise. (ix86_expand_prologue): Likewise. (output_pic_addr_const): Likewise. (ix86_init_machine_status): Initialize call_abi by DEFAULT_ABI. (x86_this_parameter): Replace TARGET_64BIT_MS_ABI. (x86_output_mi_thunk): Likewise. (x86_function_profiler): Likewise. * config/i386/i386.h (TARGET_64BIT_MS_ABI): Use ix64_cfun_abi. (SYSV_ABI, MS_ABI): New constants. (DEFAULT_ABI): New. (init_regs): Add prototype of function in regclass.c file. (OVERRIDE_ABI_FORMAT): New. (CONDITIONAL_REGISTER_USAGE): Remove TARGET_64BIT_MS_ABI part. (REG_PARM_STACK_SPACE): Use ix86_reg_parm_stack_space. (OUTGOING_REG_PARM_STACK_SPACE): New. (ix86_reg_parm_stack_space): New prototype. (CUMULATIVE_ARGS): Add call_abi member. (machine_function): Add call_abi member. * config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace TARGET_64BIT_MS_ABI by DEFAULT_ABI compare to MS_ABI. From-SVN: r136311
2008-06-03 10:05:25 +02:00
@defmac OVERRIDE_ABI_FORMAT (@var{fndecl})
If defined, this macro is called before generating any code for a
function, but after the @var{cfun} descriptor for the function has been
created. The back end may use this macro to update @var{cfun} to
reflect an ABI other than that which would normally be used by default.
If the compiler is generating code for a compiler-generated function,
@var{fndecl} may be @code{NULL}.
@end defmac
tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. (emit_library_call_value_1): Likewise pass nargs. * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args parameter instead of scanning TYPE_ARGS_TYPES to count args. * config/rs6000/rs6000-protos.h (init_cumulative_args): Update prototype. * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to INIT_CUMULATIVE_ARGS. * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h, config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h, config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise. From-SVN: r77380
2004-02-06 07:18:36 +01:00
@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl}, @var{n_named_args})
A C statement (sans semicolon) for initializing the variable
@var{cum} for the state at the beginning of the argument list. The
variable has type @code{CUMULATIVE_ARGS}. The value of @var{fntype}
is the tree node for the data type of the function which will receive
the args, or 0 if the args are to a compiler support library function.
For direct calls that are not libcalls, @var{fndecl} contain the
declaration node of the function. @var{fndecl} is also set when
@code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function
tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco. * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS. (emit_library_call_value_1): Likewise pass nargs. * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here. * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS. * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args parameter instead of scanning TYPE_ARGS_TYPES to count args. * config/rs6000/rs6000-protos.h (init_cumulative_args): Update prototype. * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg. (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000. (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0. * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to INIT_CUMULATIVE_ARGS. * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update. * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h, config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h, config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h, config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h, config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise. From-SVN: r77380
2004-02-06 07:18:36 +01:00
being compiled. @var{n_named_args} is set to the number of named
arguments, including a structure return address if it is passed as a
parameter, when making a call. When processing incoming arguments,
@var{n_named_args} is set to @minus{}1.
1996-09-25 01:21:45 +02:00
When processing a call to a compiler support library function,
@var{libname} identifies which one. It is a @code{symbol_ref} rtx which
contains the name of the function, as a string. @var{libname} is 0 when
an ordinary C function call is being processed. Thus, each time this
macro is called, either @var{libname} or @var{fntype} is nonzero, but
never both of them at once.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
Like @code{INIT_CUMULATIVE_ARGS} but only used for outgoing libcalls,
it gets a @code{MODE} argument instead of @var{fntype}, that would be
@code{NULL}. @var{indirect} would always be zero, too. If this macro
is not defined, @code{INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
0)} is used instead.
@end defmac
@defmac INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
1996-09-25 01:21:45 +02:00
Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
finding the arguments for the function being compiled. If this macro is
undefined, @code{INIT_CUMULATIVE_ARGS} is used instead.
The value passed for @var{libname} is always 0, since library routines
with special calling conventions are never compiled with GCC@. The
1996-09-25 01:21:45 +02:00
argument @var{libname} exists for symmetry with
@code{INIT_CUMULATIVE_ARGS}.
@c could use "this macro" in place of @code{INIT_CUMULATIVE_ARGS}, maybe.
@c --mew 5feb93 i switched the order of the sentences. --mew 10feb93
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} void TARGET_FUNCTION_ARG_ADVANCE (cumulative_args_t @var{ca}, machine_mode @var{mode}, const_tree @var{type}, bool @var{named})
This hook updates the summarizer variable pointed to by @var{ca} to
advance past an argument in the argument list. The values @var{mode},
@var{type} and @var{named} describe that argument. Once this is done,
the variable @var{cum} is suitable for analyzing the @emph{following}
argument with @code{TARGET_FUNCTION_ARG}, etc.
1996-09-25 01:21:45 +02:00
This hook need not do anything if the argument in question was passed
1996-09-25 01:21:45 +02:00
on the stack. The compiler knows how to track the amount of stack space
used for arguments without any special help.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac FUNCTION_ARG_OFFSET (@var{mode}, @var{type})
If defined, a C expression that is the number of bytes to add to the
offset of the argument passed in memory. This is needed for the SPU,
which passes @code{char} and @code{short} arguments in the preferred
slot that is in the middle of the quad word instead of starting at the
top.
@end defmac
@defmac FUNCTION_ARG_PADDING (@var{mode}, @var{type})
1996-09-25 01:21:45 +02:00
If defined, a C expression which determines whether, and in which direction,
to pad out an argument with extra space. The value should be of type
@code{enum direction}: either @code{upward} to pad above the argument,
@code{downward} to pad below, or @code{none} to inhibit padding.
The @emph{amount} of padding is not controlled by this macro, but by the
target hook @code{TARGET_FUNCTION_ARG_ROUND_BOUNDARY}. It is
always just enough to reach the next multiple of that boundary.
1996-09-25 01:21:45 +02:00
This macro has a default definition which is right for most systems.
For little-endian machines, the default is to pad upward. For
big-endian machines, the default is to pad downward for an argument of
constant size shorter than an @code{int}, and upward otherwise.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PAD_VARARGS_DOWN
If defined, a C expression which determines whether the default
implementation of va_arg will attempt to pad down before reading the
next argument, if that argument is smaller than its aligned space as
controlled by @code{PARM_BOUNDARY}. If this macro is not defined, all such
arguments are padded down if @code{BYTES_BIG_ENDIAN} is true.
@end defmac
tm.texi (BLOCK_REG_PADDING): Describe. * doc/tm.texi (BLOCK_REG_PADDING): Describe. * expr.h (struct locate_and_pad_arg_data): Add where_pad. (emit_group_load, emit_group_store): Adjust declarations. Remove most occurrences of #ifdef TREE_CODE. * expr.c (emit_group_load): Add "type" param, and use BLOCK_REG_PADDING to determine need for a shift. Optimize non- aligned accesses if !SLOW_UNALIGNED_ACCESS. (emit_group_store): Likewise. (emit_push_insn, expand_assignment, store_expr, expand_expr): Adjust emit_group_load and emit_group_store calls. * calls.c (store_unaligned_arguments_into_pseudos): Tidy. Use BLOCK_REG_PADDING to determine whether we need endian_correction. (load_register_parameters): Localize vars. Handle shifting of small values to the correct end of regs. Adjust emit_group_load call. (expand_call, emit_library_call_value_1): Adjust emit_group_load and emit_group_store calls. * function.c (assign_parms): Set mem alignment for stack slots. Adjust emit_group_store call. Store values at the "wrong" end of regs to the stack. Use BLOCK_REG_PADDING. (locate_and_pad_parm): Save where_pad. (expand_function_end): Adjust emit_group_load call. * stmt.c (expand_value_return): Adjust emit_group_load call. * Makefile.in (calls.o): Depend on $(OPTABS_H). * config/rs6000/linux64.h (TARGET_LITTLE_ENDIAN): Redefine as 0. (AGGREGATE_PADDING_FIXED, AGGREGATES_PAD_UPWARD_ALWAYS): Define. (MUST_PASS_IN_STACK): Define. (BLOCK_REG_PADDING): Define. * config/rs6000/rs6000.h (struct rs6000_args): Remove orig_nargs. (PAD_VARARGS_DOWN): Define in terms of FUNCTION_ARG_PADDING. * config/rs6000/rs6000.c (init_cumulative_args): Don't set orig_nargs. (function_arg_padding): !AGGREGATE_PADDING_FIXED compatibility code. Act on AGGREGATES_PAD_UPWARD_ALWAYS. From-SVN: r69318
2003-07-14 07:17:18 +02:00
@defmac BLOCK_REG_PADDING (@var{mode}, @var{type}, @var{first})
Specify padding for the last element of a block move between registers and
memory. @var{first} is nonzero if this is the only element. Defining this
macro allows better control of register function parameters on big-endian
machines, without using @code{PARALLEL} rtl. In particular,
@code{MUST_PASS_IN_STACK} need not test padding and mode of types in
registers, as there is no longer a "wrong" part of a register; For example,
a three byte aggregate may be passed in the high part of a register if so
required.
@end defmac
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned int} TARGET_FUNCTION_ARG_BOUNDARY (machine_mode @var{mode}, const_tree @var{type})
This hook returns the alignment boundary, in bits, of an argument
builtins.c (std_gimplify_va_arg_expr): Use targetm.calls.function_arg_boundary. * builtins.c (std_gimplify_va_arg_expr): Use targetm.calls.function_arg_boundary. * function.c (assign_parms, locate_and_pad_parm): Likewise. * calls.c (struct arg_data): Update comment. * defaults.h (FUNCTION_ARG_BOUNDARY): Delete. * target.def (function_arg_boundary): Define. * targhooks.h (default_function_arg_boundary): Declare. * targhooks.c (default_function_arg_boundary): Define. * doc/tm.texi.in (FUNCTION_ARG_PADDING): Use TARGET_FUNCTION_ARG_BOUNDARY. (FUNCTION_ARG_BOUNDARY): Delete. (TARGET_FUNCTION_ARG_BOUNDARY): New. * doc/tm.texi: Regenerate. * system.h (FUNCTION_ARG_BOUNDARY): Poison. * config/arc/arc.h (FUNCTION_ARG_BOUNDARY): Delete. * config/arc/arc.c (arc_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/arm/arm.h (FUNCTION_ARG_BOUNDARY): Delete. * config/arm/arm-protos.h (arm_needs_doubleword_align): Delete. * config/arm/arm.c (arm_needs_doubleword_align): Make static. (arm_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/frv/frv.h (FUNCTION_ARG_BOUNDARY): Delete. * config/frv/frv-protos.h (frv_function_arg_boundary): Delete. * config/frv/frv.c (frv_function_arg_boundary): Make static. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/i386/i386.h (FUNCTION_ARG_BOUNDARY): Delete. * config/i386/i386-protos.h (ix86_function_arg_boundary): Delete. * config/i386/i386.c (ix86_function_arg_boundary): Make static. (ix86_compat_function_arg_boundary): Take and return unsigned int. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/ia64/ia64.h (FUNCTION_ARG_BOUNDARY): Delete. * config/ia64/ia64-protos.h (ia64_function_arg_boundary): Delete. * config/ia64/ia64.c (ia64_function_arg_boundary): Make static. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/m32c/m32c.h (FUNCTION_ARG_BOUNDARY): Delete. * config/m32c/m32c.c (m32c_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/m32r/m32r.h (FUNCTION_ARG_BOUNDARY): Delete. * config/mcore/mcore.h (FUNCTION_ARG_BOUNDARY): Delete. * config/mcore/mcore.c (mcore_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/mips/mips.h (FUNCTION_ARG_BOUNDARY): Delete. * config/mips/mips-protos.h (mips_function_arg_boundary): Delete. * config/mips/mips.c (mips_function_arg_boundary): Make static. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/pa/pa.h (FUNCTION_ARG_BOUNDARY): Delete. * config/pa/pa.c (pa_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/picochip/picochip.h (FUNCTION_ARG_BOUNDARY): Delete. * config/picochip/picochip-protos.h (picochip_get_function_arg_boundary): Delete. * config/picochip/picochip.c (picochip_get_function_arg_boundary): Rename to... (picochip_function_arg_boundary): ...this. Make static. (picochip_function_arg, picochip_arg_partial_bytes): Adjust. (picochip_arg_advance): Adjust. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/rs6000/rs6000.h (FUNCTION_ARG_BOUNDARY): Delete. * config/rs6000/rs6000-protos.h (function_arg_boundary): Delete. * config/rs6000/rs6000.c (function_arg_boundary): Rename to... (rs6000_function_arg_boundary): ...this. Make static. (rs6000_parm_start, rs6000_gimplify_va_arg): Adjust. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/rx/rx.h (FUNCTION_ARG_BOUNDARY): Delete. * config/rx/rx.c (rx_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/sparc/sparc.h (FUNCTION_ARG_BOUNDARY): Delete. * config/sparc/sparc.c (sparc_function_arg_boundary): Define. (TARGET_FUNCTION_ARG_BOUNDARY): Define. * config/xtensa/xtensa.h (FUNCTION_ARG_BOUNDARY): Delete. * config/xtensa/xtensa-protos.h (function_arg_boundary): Delete. * config/xtensa/xtensa.c (function_arg_boundary): Rename to... (xtensa_function_arg_boundary): ...this. Make static. (TARGET_FUNCTION_ARG_BOUNDARY): Define. From-SVN: r166803
2010-11-16 15:25:07 +01:00
with the specified mode and type. The default hook returns
@code{PARM_BOUNDARY} for all arguments.
@end deftypefn
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned int} TARGET_FUNCTION_ARG_ROUND_BOUNDARY (machine_mode @var{mode}, const_tree @var{type})
Normally, the size of an argument is rounded up to @code{PARM_BOUNDARY},
which is the default value for this hook. You can define this hook to
return a different value if an argument size must be rounded to a larger
value.
@end deftypefn
@defmac FUNCTION_ARG_REGNO_P (@var{regno})
1996-09-25 01:21:45 +02:00
A C expression that is nonzero if @var{regno} is the number of a hard
register in which function arguments are sometimes passed. This does
@emph{not} include implicit arguments such as the static chain and
the structure-value address. On many machines, no registers can be
used for this purpose since all function arguments are pushed on the
stack.
@end defmac
@deftypefn {Target Hook} bool TARGET_SPLIT_COMPLEX_ARG (const_tree @var{type})
This hook should return true if parameter of type @var{type} are passed
as two scalar parameters. By default, GCC will attempt to pack complex
arguments into the target's word size. Some ABIs require complex arguments
to be split and treated as their individual components. For example, on
AIX64, complex floats should be passed in a pair of floating point
registers, even though a complex float would fit in one 64-bit floating
point register.
The default value of this hook is @code{NULL}, which is treated as always
false.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_BUILD_BUILTIN_VA_LIST (void)
This hook returns a type node for @code{va_list} for the target.
The default version of the hook returns @code{void*}.
@end deftypefn
@deftypefn {Target Hook} int TARGET_ENUM_VA_LIST_P (int @var{idx}, const char **@var{pname}, tree *@var{ptree})
This target hook is used in function @code{c_common_nodes_and_builtins}
to iterate through the target specific builtin types for va_list. The
variable @var{idx} is used as iterator. @var{pname} has to be a pointer
to a @code{const char *} and @var{ptree} a pointer to a @code{tree} typed
variable.
The arguments @var{pname} and @var{ptree} are used to store the result of
this macro and are set to the name of the va_list builtin type and its
internal type.
If the return value of this macro is zero, then there is no more element.
Otherwise the @var{IDX} should be increased for the next call of this
macro to iterate through all types.
@end deftypefn
config.gcc (extra_headers): Add cross-stdarg.h for target x86_64-*-* and i?86-*-*. 2008-07-06 Kai Tietz <kai.tietz@onevision.com> * config.gcc (extra_headers): Add cross-stdarg.h for target x86_64-*-* and i?86-*-*. * config/i386/cross-stdarg.h: New. * builtins.c (std_fn_abi_va_list): New. (std_canonical_va_list_type): New. (stabilize_va_list): Replace va_list_type_node use by mtarget.canonical_va_list_type. (gimplify_va_arg_expr): Likewise. (expand_builtin_va_copy): Replace va_list_type_node use by mtarget.fn_abi_va_list. * tree-sra.c (is_va_list_type): New helper. (decl_can_be_decomposed_p): Replace va_list_type_node use by is_va_list_type. * tree-ssa-ccp.c (optimize_stdarg_builtin): Likewise. * tree-stdarg.c (execute_optimize_stdarg): Likewise. * c-common.c (c_common_nodes_and_builtins): Use TARGET_ENUM_VA_LIST. * config/i386/i386-protos.h (ix86_get_valist_type): New. (ix86_enum_va_list): New. * config/i386/i386.c (sysv_va_list_type_node): New. (ms_va_list_type_node): New. (ix86_function_type_abi): Remove sorry. (ix86_build_builtin_va_list_abi): New. (ix86_build_builtin_va_list): Call ix86_build_builtin_va_list_abi for 64-bit targets. (ix86_va_start): Replace va_list_type_node by sysv_va_list_type_node. (ix86_init_builtins_va_builtins_abi): New. (ix86_init_builtins): Use ix86_init_builtins_va_builtins_abi for 64-bit targets. (ix86_handle_abi_attribute): New. (attribute_spec): Add sysv_abi and ms_abi. (ix86_fn_abi_va_list): New. (ix86_canonical_va_list_type): New. (ix86_enum_va_list): New. (TARGET_FN_ABI_VA_LIST): New. (TARGET_CANONICAL_VA_LIST_TYPE): New. * config/i386/i386.h (TARGET_ENUM_VA_LIST): New. * doc/tm.texi (TARGET_FN_ABI_VA_LIST): New. (TARGET_CANONICAL_VA_LIST_TYPE): New. (TARGET_ENUM_VA_LIST): New. * expr.h (std_fn_abi_va_list): New. (std_canonical_va_list_type): New. * target-def.h (TARGET_FN_ABI_VA_LIST): New. (TARGET_CANONICAL_VA_LIST_TYPE): New. (TARGET_INITIALIZER): Add TARGET_FN_ABI_VA_LIST and TARGET_CANONICAL_VA_LIST_TYPE. * target.h (struct gcc_target): Add fn_abi_va_list hook and canonical_va_list_type hook. From-SVN: r137525
2008-07-06 16:51:58 +02:00
@deftypefn {Target Hook} tree TARGET_FN_ABI_VA_LIST (tree @var{fndecl})
This hook returns the va_list type of the calling convention specified by
@var{fndecl}.
The default version of this hook returns @code{va_list_type_node}.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_CANONICAL_VA_LIST_TYPE (tree @var{type})
This hook returns the va_list type of the calling convention specified by the
type of @var{type}. If @var{type} is not a valid va_list type, it returns
@code{NULL_TREE}.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_GIMPLIFY_VA_ARG_EXPR (tree @var{valist}, tree @var{type}, gimple_seq *@var{pre_p}, gimple_seq *@var{post_p})
This hook performs target-specific gimplification of
@code{VA_ARG_EXPR}. The first two parameters correspond to the
arguments to @code{va_arg}; the latter two are as in
@code{gimplify.c:gimplify_expr}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_VALID_POINTER_MODE (machine_mode @var{mode})
Define this to return nonzero if the port can handle pointers
with machine mode @var{mode}. The default version of this
hook returns true for both @code{ptr_mode} and @code{Pmode}.
@end deftypefn
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
@deftypefn {Target Hook} bool TARGET_REF_MAY_ALIAS_ERRNO (struct ao_ref *@var{ref})
Define this to return nonzero if the memory reference @var{ref} may alias with the system C library errno location. The default version of this hook assumes the system C library errno location is either a declaration of type int or accessed by dereferencing a pointer to int.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_SCALAR_MODE_SUPPORTED_P (machine_mode @var{mode})
Define this to return nonzero if the port is prepared to handle
insns involving scalar mode @var{mode}. For a scalar mode to be
considered supported, all the basic arithmetic and comparisons
must work.
The default version of this hook returns true for any mode
required to handle the basic C types (as defined by the port).
Included here are the double-word arithmetic supported by the
code in @file{optabs.c}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_VECTOR_MODE_SUPPORTED_P (machine_mode @var{mode})
Define this to return nonzero if the port is prepared to handle
insns involving vector mode @var{mode}. At the very least, it
must have move patterns for this mode.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_ARRAY_MODE_SUPPORTED_P (machine_mode @var{mode}, unsigned HOST_WIDE_INT @var{nelems})
Return true if GCC should try to use a scalar mode to store an array
of @var{nelems} elements, given that each element has mode @var{mode}.
Returning true here overrides the usual @code{MAX_FIXED_MODE} limit
and allows GCC to use any defined integer mode.
One use of this hook is to support vector load and store operations
that operate on several homogeneous vectors. For example, ARM NEON
has operations like:
@smallexample
int8x8x3_t vld3_s8 (const int8_t *)
@end smallexample
where the return type is defined as:
@smallexample
typedef struct int8x8x3_t
@{
int8x8_t val[3];
@} int8x8x3_t;
@end smallexample
If this hook allows @code{val} to have a scalar mode, then
@code{int8x8x3_t} can have the same mode. GCC can then store
@code{int8x8x3_t}s in registers rather than forcing them onto the stack.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P (machine_mode @var{mode})
Remove LIBGCC2_HAS_?F_MODE target macros. This patch removes the LIBGCC2_HAS_{SF,DF,XF,TF}_MODE target macros, replacing them by predefines with -fbuilding-libgcc, together with a target hook that can influence those predefines when needed. The new default is that a floating-point mode is supported in libgcc if (a) it passes the scalar_mode_supported_p hook (otherwise it's not plausible for it to be supported in libgcc) and (b) it's one of those four modes (since those are the modes for which libgcc hardcodes the possibility of support). The target hook can override the default choice (in either direction) for modes that pass scalar_mode_supported_p (although overriding in the direction of returning true when the default would return false only makes sense if all relevant functions are specially defined in libgcc for that particular target). The previous default settings depended on various settings such as LIBGCC2_LONG_DOUBLE_TYPE_SIZE, as well as targets defining the above target macros if the default wasn't correct. The default scalar_mode_supported_p only declares a floating-point mode to be supported if it matches one of float / double / long double. This means that in most cases where a mode is only supported conditionally in libgcc (TFmode only supported if it's the mode of long double, most commonly), the default gets things right. Overrides were needed in the following cases: * SFmode would always have been supported in libgcc (the condition was BITS_PER_UNIT == 8, true for all current targets), but pdp11 defaults to 64-bit float, and in that case SFmode would fail scalar_mode_supported_p. I don't know if libgcc actually built for pdp11 (and the port may well no longer be being used), but this patch adds a scalar_mode_supported_p hook to it to ensure SFmode is treated as supported. * Certain i386 and ia64 targets need the new hook to match the existing cases for when XFmode or TFmode support is present in libgcc. For i386, the hook can always declare XFmode to be supported - the cases where it's not are the cases where long double is TFmode, in which case XFmode fails scalar_mode_supported_p[*] - but TFmode support needs to be conditional. (And of the targets not defining LIBGCC2_HAS_TF_MODE before this patch, some defined LONG_DOUBLE_TYPE_SIZE to 64, so ensuring LIBGCC2_HAS_TF_MODE would always be false, while others did not define it, so allowing it to be true in the -mlong-double-128 case. This patch matches that logic, although I suspect all the latter targets would have been broken if you tried to enable -mlong-double-128 by default, for lack of the soft-fp TFmode support in libgcc, which is separately configured.) [*] I don't know if it's deliberate not to support __float80 at all with -mlong-double-128. In order to implement the default version of the new hook, insn-modes.h was made to contain macros such as HAVE_TFmode for each machine mode, so the default hook can contain conditionals on whether XFmode and TFmode exist (to match the hardcoding of a list of modes in libgcc). This is also used in fortran/trans-types.c; previously it had a conditional on defined(LIBGCC2_HAS_TF_MODE) (a bit dubious, since it ignored the value of the macro), which is replaced by testing defined(HAVE_TFmode), in conjunction with requiring targetm.libgcc_floating_mode_supported_p. (Fortran is testing something stronger than that hook: not only is libgcc support required, but also libm or equivalent. Thus, it has a test for ENABLE_LIBQUADMATH_SUPPORT in the case that the mode is TFmode and that's not the same as any of the three standard types. The old and new tests are intended to accept exactly the same set of modes for all targets.) Apart from the four target macros eliminated by this patch, it gets us closer to eliminating LIBGCC2_LONG_DOUBLE_TYPE_SIZE as well, though a few more places using that macro need changing first. Bootstrapped with no regressions on x86_64-unknown-linux-gnu; also built cc1 for crosses to ia64-elf and pdp11-none as a minimal test of changes for those targets. gcc: * target.def (libgcc_floating_mode_supported_p): New hook. * targhooks.c (default_libgcc_floating_mode_supported_p): New function. * targhooks.h (default_libgcc_floating_mode_supported_p): Declare. * doc/tm.texi.in (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_XF_MODE) (LIBGCC2_HAS_TF_MODE): Remove. (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): New @hook. * doc/tm.texi: Regenerate. * genmodes.c (emit_insn_modes_h): Define HAVE_%smode for each machine mode. * system.h (LIBGCC2_HAS_SF_MODE, LIBGCC2_HAS_DF_MODE) (LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE): Poison. * config/i386/cygming.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/darwin.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/djgpp.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/dragonfly.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/freebsd.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/gnu-user-common.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/i386-interix.h (IX86_NO_LIBGCC_TFMODE): Define. * config/i386/i386.c (ix86_libgcc_floating_mode_supported_p): New function. (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Define. * config/i386/i386elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/lynx.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/netbsd-elf.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/netbsd64.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/nto.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/openbsd.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/i386/openbsdelf.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/rtemself.h (IX86_NO_LIBGCC_TFMODE): Define. * config/i386/sol2.h (LIBGCC2_HAS_TF_MODE): Remove. * config/i386/vx-common.h (IX86_MAYBE_NO_LIBGCC_TFMODE): Define. * config/ia64/elf.h (IA64_NO_LIBGCC_TFMODE): Define. * config/ia64/freebsd.h (IA64_NO_LIBGCC_TFMODE): Define. * config/ia64/hpux.h (LIBGCC2_HAS_XF_MODE, LIBGCC2_HAS_TF_MODE): Remove. * config/ia64/ia64.c (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): New macro. (ia64_libgcc_floating_mode_supported_p): New function. * config/ia64/linux.h (LIBGCC2_HAS_TF_MODE): Remove. * config/ia64/vms.h (IA64_NO_LIBGCC_XFMODE) (IA64_NO_LIBGCC_TFMODE): Define. * config/msp430/msp430.h (LIBGCC2_HAS_DF_MODE): Remove. * config/pdp11/pdp11.c (TARGET_SCALAR_MODE_SUPPORTED_P): New macro. (pdp11_scalar_mode_supported_p): New function. * config/rl78/rl78.h (LIBGCC2_HAS_DF_MODE): Remove. * config/rx/rx.h (LIBGCC2_HAS_DF_MODE): Remove. gcc/c-family: * c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_HAS_%s_MODE__ macros for floating-point modes. gcc/fortran: * trans-types.c (gfc_init_kinds): Check targetm.libgcc_floating_mode_supported_p for floating-point modes. Check HAVE_TFmode instead of LIBGCC2_HAS_TF_MODE. libgcc: * libgcc2.h (LIBGCC2_HAS_SF_MODE): Define using __LIBGCC_HAS_SF_MODE__. (LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__. (LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__. (LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__. * config/libbid/bid_gcc_intrinsics.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define. (LIBGCC2_HAS_XF_MODE): Define using __LIBGCC_HAS_XF_MODE__. (LIBGCC2_HAS_TF_MODE): Define using __LIBGCC_HAS_TF_MODE__. * fixed-bit.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Do not define. (LIBGCC2_HAS_SF_MODE): Define using __LIBGCC_HAS_SF_MODE__. (LIBGCC2_HAS_DF_MODE): Define using __LIBGCC_HAS_DF_MODE__. From-SVN: r215215
2014-09-12 14:05:18 +02:00
Define this to return nonzero if libgcc provides support for the
floating-point mode @var{mode}, which is known to pass
@code{TARGET_SCALAR_MODE_SUPPORTED_P}. The default version of this
hook returns true for all of @code{SFmode}, @code{DFmode},
@code{XFmode} and @code{TFmode}, if such modes exist.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P (machine_mode @var{mode})
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
Define this to return nonzero for machine modes for which the port has
small register classes. If this target hook returns nonzero for a given
@var{mode}, the compiler will try to minimize the lifetime of registers
in @var{mode}. The hook may be called with @code{VOIDmode} as argument.
In this case, the hook is expected to return nonzero if it returns nonzero
for any mode.
On some machines, it is risky to let hard registers live across arbitrary
insns. Typically, these machines have instructions that require values
to be in specific registers (like an accumulator), and reload will fail
if the required hard register is used for another purpose across such an
insn.
Passes before reload do not know which hard registers will be used
in an instruction, but the machine modes of the registers set or used in
the instruction are already known. And for some machines, register
classes are small for, say, integer registers but not for floating point
registers. For example, the AMD x86-64 architecture requires specific
registers for the legacy x86 integer instructions, but there are many
SSE registers for floating point operations. On such targets, a good
strategy may be to return nonzero from this hook for @code{INTEGRAL_MODE_P}
machine modes but zero for the SSE register classes.
The default version of this hook returns false for any mode. It is always
tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. * doc/tm.texi (defmac SMALL_REGISTER_CLASSES): Remove. (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): Add documentation, based on the above, for new target hook. * hooks.c (hook_bool_mode_true): New generic hook. * hooks.h (hook_bool_mode_true): Add prototype. * target.h (struct gcc_target): Add small_register_classes_for_mode_p target hook. * target-def.h (TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P): New default target hook, set to hook_bool_mode_false. * regs.h: Remove default definition of SMALL_REGISTER_CLASSES. * reload.c (push_secondary_reload): Replace SMALL_REGISTER_CLASSES with targetm.small_register_classes_for_mode_p. (find_reusable_reload): Likewise. (combine_reloads): Likewise. * reload1.c (reload_as_needed): Likewise. * cse.c (approx_reg_cost_1, hash_rtx_cb): Likewise. * ifcvt.c (noce_process_if_block, check_cond_move_block, dead_or_predicable): Likewise. * regmove.c (optimize_reg_copy_1): Likewise. * calls.c (prepare_call_address): Likewise. (precompute_register_parameters): Likewise. * config/sh/sh.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/sh/sh.c (sh_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small except for SH64. (sh_override_options): Use the new hook. * config/sh/sh-protos.h (sh_small_register_classes_for_mode_p): Add prototype. * config/arm/arm.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/arm/arm.c (arm_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for THUMB1. * config/arm/arm-protos.h (arm_small_register_classes_for_mode_p): Add prototype. * config/mips/mips.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/mips/mips.c (mips_small_register_classes_for_mode_p): Add implementation of the hook that considers all register classes small for MIPS16. * config/mips/mips-protos.h (mips_small_register_classes_for_mode_p): Add prototype. * config/i386/i386.h: Replace SMALL_REGISTER_CLASSES with new target hook definition. * config/m32c/m32c.h: Likewise. * config/pdp11/pdp11.h: Likewise. * config/avr/avr.h: Likewise. * config/xtensa/xtensa.h: Likewise. * config/m68hc11/m68hc11.h: Likewise. * config/mn10300/mn10300.h: Likewise. * config/mcore/mcore.h: Likewise. * config/h8300/h8300.h: Likewise. * config/bfin/bfin.h: Likewise. * config/iq2000/iq2000.h: Remove SMALL_REGISTER_CLASSES definition. * config/rx/rx.h: Remove SMALL_REGISTER_CLASSES definition. From-SVN: r158997
2010-05-03 19:47:47 +02:00
safe to redefine this hook to return with a nonzero value. But if you
unnecessarily define it, you will reduce the amount of optimizations
that can be performed in some cases. If you do not define this hook
to return a nonzero value when it is required, the compiler will run out
of spill registers and print a fatal error message.
@end deftypefn
@deftypevr {Target Hook} {unsigned int} TARGET_FLAGS_REGNUM
If the target has a dedicated flags register, and it needs to use the post-reload comparison elimination pass, then this value should be set appropriately.
@end deftypevr
1996-09-25 01:21:45 +02:00
@node Scalar Return
@subsection How Scalar Function Values Are Returned
@cindex return values in registers
@cindex values, returned by functions
@cindex scalars, returned as values
This section discusses the macros that control returning scalars as
values---values that can fit in registers.
@deftypefn {Target Hook} rtx TARGET_FUNCTION_VALUE (const_tree @var{ret_type}, const_tree @var{fn_decl_or_type}, bool @var{outgoing})
Define this to return an RTX representing the place where a function
returns or receives a value of data type @var{ret_type}, a tree node
representing a data type. @var{fn_decl_or_type} is a tree node
representing @code{FUNCTION_DECL} or @code{FUNCTION_TYPE} of a
function being called. If @var{outgoing} is false, the hook should
compute the register in which the caller will see the return value.
Otherwise, the hook should return an RTX representing the place where
a function returns a value.
On many machines, only @code{TYPE_MODE (@var{ret_type})} is relevant.
(Actually, on most machines, scalar values are returned in the same
place regardless of mode.) The value of the expression is usually a
@code{reg} RTX for the hard register where the return value is stored.
The value can also be a @code{parallel} RTX, if the return value is in
multiple places. See @code{TARGET_FUNCTION_ARG} for an explanation of the
@code{parallel} form. Note that the callee will populate every
location specified in the @code{parallel}, but if the first element of
the @code{parallel} contains the whole return value, callers will use
that element as the canonical location and ignore the others. The m68k
port uses this type of @code{parallel} to return pointers in both
@samp{%a0} (the canonical location) and @samp{%d0}.
If @code{TARGET_PROMOTE_FUNCTION_RETURN} returns true, you must apply
the same promotion rules specified in @code{PROMOTE_MODE} if
@var{valtype} is a scalar type.
1996-09-25 01:21:45 +02:00
If the precise function being called is known, @var{func} is a tree
node (@code{FUNCTION_DECL}) for it; otherwise, @var{func} is a null
pointer. This makes it possible to use a different value-returning
convention for specific functions when all their calls are
known.
1996-09-25 01:21:45 +02:00
Some target machines have ``register windows'' so that the register in
which a function returns its value is not the same as the one in which
the caller sees the value. For such machines, you should return
different RTX depending on @var{outgoing}.
@code{TARGET_FUNCTION_VALUE} is not used for return values with
aggregate data types, because these are returned in another way. See
@code{TARGET_STRUCT_VALUE_RTX} and related macros, below.
@end deftypefn
@defmac FUNCTION_VALUE (@var{valtype}, @var{func})
This macro has been deprecated. Use @code{TARGET_FUNCTION_VALUE} for
a new target instead.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LIBCALL_VALUE (@var{mode})
1996-09-25 01:21:45 +02:00
A C expression to create an RTX representing the place where a library
function returns a value of mode @var{mode}.
1996-09-25 01:21:45 +02:00
Note that ``library function'' in this context means a compiler
support routine, used to perform arithmetic, whose name is known
specially by the compiler and was not mentioned in the C code being
compiled.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_LIBCALL_VALUE (machine_mode @var{mode}, const_rtx @var{fun})
Define this hook if the back-end needs to know the name of the libcall
function in order to determine where the result should be returned.
The mode of the result is given by @var{mode} and the name of the called
library function is given by @var{fun}. The hook should return an RTX
representing the place where the library function result will be returned.
If this hook is not defined, then LIBCALL_VALUE will be used.
@end deftypefn
@defmac FUNCTION_VALUE_REGNO_P (@var{regno})
1996-09-25 01:21:45 +02:00
A C expression that is nonzero if @var{regno} is the number of a hard
register in which the values of called function may come back.
A register whose use for returning values is limited to serving as the
second of a pair (for a value of type @code{double}, say) need not be
recognized by this macro. So for most machines, this definition
suffices:
@smallexample
1996-09-25 01:21:45 +02:00
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
@end smallexample
1996-09-25 01:21:45 +02:00
If the machine has register windows, so that the caller and the called
function use different registers for the return value, this macro
should recognize only the caller's register numbers.
This macro has been deprecated. Use @code{TARGET_FUNCTION_VALUE_REGNO_P}
for a new target instead.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_FUNCTION_VALUE_REGNO_P (const unsigned int @var{regno})
A target hook that return @code{true} if @var{regno} is the number of a hard
register in which the values of called function may come back.
A register whose use for returning values is limited to serving as the
second of a pair (for a value of type @code{double}, say) need not be
recognized by this target hook.
If the machine has register windows, so that the caller and the called
function use different registers for the return value, this target hook
should recognize only the caller's register numbers.
If this hook is not defined, then FUNCTION_VALUE_REGNO_P will be used.
@end deftypefn
@defmac APPLY_RESULT_SIZE
1996-09-25 01:21:45 +02:00
Define this macro if @samp{untyped_call} and @samp{untyped_return}
need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
saving and restoring an arbitrary return value.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypevr {Target Hook} bool TARGET_OMIT_STRUCT_RETURN_REG
Normally, when a function returns a structure by memory, the address
is passed as an invisible pointer argument, but the compiler also
arranges to return the address from the function like it would a normal
pointer return value. Define this to true if that behaviour is
undesirable on your target.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_RETURN_IN_MSB (const_tree @var{type})
This hook should return true if values of type @var{type} are returned
at the most significant end of a register (in other words, if they are
padded at the least significant end). You can assume that @var{type}
is returned in a register; the caller is required to check this.
Note that the register provided by @code{TARGET_FUNCTION_VALUE} must
be able to hold the complete return value. For example, if a 1-, 2-
or 3-byte structure is returned at the most significant end of a
4-byte register, @code{TARGET_FUNCTION_VALUE} should provide an
@code{SImode} rtx.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Aggregate Return
@subsection How Large Values Are Returned
@cindex aggregates as return values
@cindex large return values
@cindex returning aggregate values
@cindex structure value address
When a function value's mode is @code{BLKmode} (and in some other
cases), the value is not returned according to
@code{TARGET_FUNCTION_VALUE} (@pxref{Scalar Return}). Instead, the
caller passes the address of a block of memory in which the value
should be stored. This address is called the @dfn{structure value
address}.
1996-09-25 01:21:45 +02:00
This section describes how to control returning structure values in
memory.
@deftypefn {Target Hook} bool TARGET_RETURN_IN_MEMORY (const_tree @var{type}, const_tree @var{fntype})
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
This target hook should return a nonzero value to say to return the
function value in memory, just as large structures are always returned.
Here @var{type} will be the data type of the value, and @var{fntype}
will be the type of the function doing the returning, or @code{NULL} for
libcalls.
1996-09-25 01:21:45 +02:00
Note that values of mode @code{BLKmode} must be explicitly handled
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
by this function. Also, the option @option{-fpcc-struct-return}
1996-09-25 01:21:45 +02:00
takes effect regardless of this macro. On most systems, it is
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
possible to leave the hook undefined; this causes a default
1996-09-25 01:21:45 +02:00
definition to be used, whose value is the constant 1 for @code{BLKmode}
values, and 0 otherwise.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
Do not use this hook to indicate that structures and unions should always
1996-09-25 01:21:45 +02:00
be returned in memory. You should instead use @code{DEFAULT_PCC_STRUCT_RETURN}
to indicate this.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac DEFAULT_PCC_STRUCT_RETURN
1996-09-25 01:21:45 +02:00
Define this macro to be 1 if all structure and union return values must be
in memory. Since this results in slower code, this should be defined
only if needed for compatibility with other compilers or with an ABI@.
1996-09-25 01:21:45 +02:00
If you define this macro to be 0, then the conventions used for structure
and union return values are decided by the @code{TARGET_RETURN_IN_MEMORY}
target hook.
1996-09-25 01:21:45 +02:00
If not defined, this defaults to the value 1.
@end defmac
1996-09-25 01:21:45 +02:00
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@deftypefn {Target Hook} rtx TARGET_STRUCT_VALUE_RTX (tree @var{fndecl}, int @var{incoming})
This target hook should return the location of the structure value
address (normally a @code{mem} or @code{reg}), or 0 if the address is
passed as an ``invisible'' first argument. Note that @var{fndecl} may
be @code{NULL}, for libcalls. You do not need to define this target
hook if the address is always passed as an ``invisible'' first
argument.
1996-09-25 01:21:45 +02:00
On some architectures the place where the structure value address
is found by the called function is not the same place that the
caller put it. This can be due to register windows, or it could
be because the function prologue moves it to a different place.
@var{incoming} is @code{1} or @code{2} when the location is needed in
the context of the called function, and @code{0} in the context of
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
the caller.
1996-09-25 01:21:45 +02:00
If @var{incoming} is nonzero and the address is to be found on the
stack, return a @code{mem} which refers to the frame pointer. If
@var{incoming} is @code{2}, the result is being used to fetch the
structure value address at the beginning of a function. If you need
to emit adjusting code, you should do it at this point.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac PCC_STATIC_STRUCT_RETURN
1996-09-25 01:21:45 +02:00
Define this macro if the usual system convention on the target machine
for returning structures and unions is for the called function to return
the address of a static variable containing the value.
Do not define this if the usual system convention is for the caller to
pass an address to the subroutine.
This macro has effect in @option{-fpcc-struct-return} mode, but it does
nothing when you use @option{-freg-struct-return} mode.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_GET_RAW_RESULT_MODE (int @var{regno})
This target hook returns the mode to be used when accessing raw return registers in @code{__builtin_return}. Define this macro if the value in @var{reg_raw_mode} is not correct.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_GET_RAW_ARG_MODE (int @var{regno})
This target hook returns the mode to be used when accessing raw argument registers in @code{__builtin_apply_args}. Define this macro if the value in @var{reg_raw_mode} is not correct.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Caller Saves
@subsection Caller-Saves Register Allocation
If you enable it, GCC can save registers around function calls. This
1996-09-25 01:21:45 +02:00
makes it possible to use call-clobbered registers to hold variables that
must live across calls.
@defmac HARD_REGNO_CALLER_SAVE_MODE (@var{regno}, @var{nregs})
A C expression specifying which mode is required for saving @var{nregs}
of a pseudo-register in call-clobbered hard register @var{regno}. If
@var{regno} is unsuitable for caller save, @code{VOIDmode} should be
returned. For most machines this macro need not be defined since GCC
will select the smallest suitable mode.
@end defmac
1996-09-25 01:21:45 +02:00
@node Function Entry
@subsection Function Entry and Exit
@cindex function entry and exit
@cindex prologue
@cindex epilogue
This section describes the macros that output function entry
(@dfn{prologue}) and exit (@dfn{epilogue}) code.
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_PROLOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
If defined, a function that outputs the assembler code for entry to a
1996-09-25 01:21:45 +02:00
function. The prologue is responsible for setting up the stack frame,
initializing the frame pointer register, saving registers that must be
saved, and allocating @var{size} additional bytes of storage for the
local variables. @var{size} is an integer. @var{file} is a stdio
stream to which the assembler code should be output.
The label for the beginning of the function need not be output by this
macro. That has already been done when the macro is run.
@findex regs_ever_live
To determine which registers to save, the macro can refer to the array
@code{regs_ever_live}: element @var{r} is nonzero if hard register
@var{r} is used anywhere within the function. This implies the function
prologue should save register @var{r}, provided it is not one of the
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
call-used registers. (@code{TARGET_ASM_FUNCTION_EPILOGUE} must likewise use
1996-09-25 01:21:45 +02:00
@code{regs_ever_live}.)
On machines that have ``register windows'', the function entry code does
not save on the stack the registers that are in the windows, even if
they are supposed to be preserved by function calls; instead it takes
appropriate steps to ``push'' the register stack, if any non-call-used
registers are used in the function.
@findex frame_pointer_needed
On machines where functions may or may not have frame-pointers, the
function entry code must vary accordingly; it must set up the frame
pointer if one is wanted, and not otherwise. To determine whether a
frame pointer is in wanted, the macro can refer to the variable
@code{frame_pointer_needed}. The variable's value will be 1 at run
time in a function that needs a frame pointer. @xref{Elimination}.
The function entry code is responsible for allocating any stack space
required for the function. This stack space consists of the regions
listed below. In most cases, these regions are allocated in the
order listed, with the last listed region closest to the top of the
stack (the lowest address if @code{STACK_GROWS_DOWNWARD} is defined, and
the highest address if it is not defined). You can use a different order
for a machine if doing so is more convenient or required for
compatibility reasons. Except in cases where required by standard
or by a debugger, there is no reason why the stack layout used by GCC
need agree with that used by other compilers for a machine.
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
@end deftypefn
final.c (output_addr_const): Use target opening and closing parentheses. * final.c (output_addr_const): Use target opening and closing parentheses. * target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN defaults, add to TARGET_ASM_OUT. * target.h (struct gcc_target): Add open_paren and close_paren. * doc/md.texi: Update. * doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE, TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and TARGET_ASM_CLOSE_PAREN. config: * i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * 1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. * a29k/a29k.h: Similarly. * alpha/alpha.h: Similarly. * arc/arc.h: Similarly. * arm/aof.h: Similarly. * arm/aout.h: Similarly. * avr/avr.h: Similarly. * c4x/c4x.h: Similarly. * clipper/clipper.h: Similarly. * convex/convex.h: Similarly. * d30v/d30v.h: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.h: Similarly. * h8300/h8300.h: Similarly. * i370/i370.h: Similarly. * i386/i386.h: Similarly. * i860/i860.h: Similarly. * i960/i960.h: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/m68k.h: Similarly. * m88k/m88k.h: Similarly. * mcore/mcore.h: Similarly. * mips/mips.h: Similarly. * mn10200/mn10200.h: Similarly. * mn10300/mn10300.h: Similarly. * ns32k/ns32k.h: Similarly. * pa/pa.h: Similarly. * pdp11/pdp11.h: Similarly. * pj/pj.h: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000.h: Similarly. * sh/sh.h: Similarly. * sparc/sparc.h: Similarly. * v850/v850.h: Similarly. * vax/vax.h: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43856
2001-07-09 08:10:09 +02:00
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_END_PROLOGUE (FILE *@var{file})
If defined, a function that outputs assembler code at the end of a
prologue. This should be used when the function prologue is being
emitted as RTL, and you have some extra assembler that needs to be
emitted. @xref{prologue instruction pattern}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_BEGIN_EPILOGUE (FILE *@var{file})
If defined, a function that outputs assembler code at the start of an
epilogue. This should be used when the function epilogue is being
emitted as RTL, and you have some extra assembler that needs to be
emitted. @xref{epilogue instruction pattern}.
@end deftypefn
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_EPILOGUE (FILE *@var{file}, HOST_WIDE_INT @var{size})
If defined, a function that outputs the assembler code for exit from a
function. The epilogue is responsible for restoring the saved
registers and stack pointer to their values when the function was
called, and returning control to the caller. This macro takes the
same arguments as the macro @code{TARGET_ASM_FUNCTION_PROLOGUE}, and the
registers to restore are determined from @code{regs_ever_live} and
@code{CALL_USED_REGISTERS} in the same way.
On some machines, there is a single instruction that does all the work
of returning from the function. On these machines, give that
instruction the name @samp{return} and do not define the macro
@code{TARGET_ASM_FUNCTION_EPILOGUE} at all.
Do not define a pattern named @samp{return} if you want the
@code{TARGET_ASM_FUNCTION_EPILOGUE} to be used. If you want the target
switches to control whether return instructions or epilogues are used,
define a @samp{return} pattern with a validity condition that tests the
target switches appropriately. If the @samp{return} pattern's validity
condition is false, epilogues will be used.
On machines where functions may or may not have frame-pointers, the
function exit code must vary accordingly. Sometimes the code for these
two cases is completely different. To determine whether a frame pointer
is wanted, the macro can refer to the variable
@code{frame_pointer_needed}. The variable's value will be 1 when compiling
a function that needs a frame pointer.
Normally, @code{TARGET_ASM_FUNCTION_PROLOGUE} and
@code{TARGET_ASM_FUNCTION_EPILOGUE} must treat leaf functions specially.
The C variable @code{current_function_is_leaf} is nonzero for such a
function. @xref{Leaf Functions}.
On some machines, some functions pop their arguments on exit while
others leave that for the caller to do. For example, the 68020 when
given @option{-mrtd} pops arguments in functions that take a fixed
number of arguments.
@findex pops_args
@findex crtl->args.pops_args
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
Your definition of the macro @code{RETURN_POPS_ARGS} decides which
functions pop their own arguments. @code{TARGET_ASM_FUNCTION_EPILOGUE}
needs to know what was decided. The number of bytes of the current
function's arguments that this function should pop is available in
@code{crtl->args.pops_args}. @xref{Scalar Return}.
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@itemize @bullet
@item
@findex pretend_args_size
@findex crtl->args.pretend_args_size
A region of @code{crtl->args.pretend_args_size} bytes of
1996-09-25 01:21:45 +02:00
uninitialized space just underneath the first argument arriving on the
stack. (This may not be at the very start of the allocated stack region
if the calling sequence has pushed anything else since pushing the stack
arguments. But usually, on such machines, nothing else has been pushed
yet, because the function prologue itself does all the pushing.) This
region is used on machines where an argument may be passed partly in
registers and partly in memory, and, in some cases to support the
varargs.h: Replace with stub which issues #error. * ginclude/varargs.h: Replace with stub which issues #error. * ginclude/stdarg.h: __builtin_stdarg_start is renamed __builtin_va_start. * builtins.def (BUILT_IN_VARARGS_START): Delete. (BUILT_IN_VA_START): New. * builtins.c (expand_builtin_va_start): Eliminate first argument and code to implement pre-ISO varargs. (std_expand_builtin_va_start): Ignore first argument; it is always 1. (expand_builtin): Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * function.c (assign_parms): Delete hide_last_arg and all its uses. (mark_varargs): Delete function. * function.h (struct function): Delete 'varargs' bit. (current_function_varargs): Delete macro. * tree.h: Don't declare mark_varargs. * c-decl.c (c_function_varargs, c_mark_varargs): Delete. (c_expand_body): Don't call mark_varargs. * c-objc-common.c: Handle BUILT_IN_VA_START and BUILT_IN_STDARG_START identically. Delete BUILT_IN_VARARGS_START case. * c-tree.h: Don't declare c_mark_varargs. * c-parse.in: Remove grammar rules for '&...' (which has been commented out since before 2.7.2) and for '...' in K+R argument declarations. * builtins.c, function.c, integrate.c, sibcall.c, config/alpha/unicosmk.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr.c, config/cris/cris.c, config/fr30/fr30.c, config/i960/i960.c, config/i960/i960.md, config/m32r/m32r.c, config/m32r/m32r.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mmix/mmix.c, config/mmix/mmix.h, config/mn10300/mn10300.c, config/pa/som.h, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.c: Delete all references to current_function_varargs, and code predicated on that flag. * config/alpha/alpha.c (alpha_va_start), config/arc/arc.c (arc_va_start), config/i386/i386.c (ix86_va_start), config/mips/mips.c (mips_va_start), config/mn10300/mn10300.c (mn10300_va_start), config/rs6000/rs6000.c (rs6000_va_start), config/s390/s390.c (s390_va_start), config/sh/sh.c (sh_va_start), Ignore first argument; it is always 1. * config/c4x/c4x-protos.h, config/c4x/c4x.c: Delete c4x_va_start. * config/ia64/ia64-protos.h, config/ia64/ia64.c: Delete ia64_va_start. * config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c: Delete m68hc11_va_start. * config/c4x/c4x.h, config/ia64/ia64.h, config/m68hc11/m68hc11.h: No need to define EXPAND_BUILTIN_VA_START. * doc/invoke.texi, doc/sourcebuild.texi, doc/tm.texi, doc/trouble.texi: Remove references to GCC-provided <varargs.h>. testsuite: * c-torture/execute/991216-3.c, c-torture/execute/strct-varg-1.c, c-torture/execute/va-arg-7.c, c-torture/execute/va-arg-8.c, c-torture/execute/va-arg-15.c, c-torture/execute/va-arg-16.c, c-torture/execute/va-arg-17.c, c-torture/execute/va-arg-19.c: Convert to use <stdarg.h>. * c-torture/execute/va-arg-3.c, c-torture/execute/va-arg-3.x: Delete. * gcc.dg/va-arg-2.c: New. * lib/gcc.exp, lib/objc.exp: Remove code to set -DNO_VARARGS. From-SVN: r55472
2002-07-16 04:16:47 +02:00
features in @code{<stdarg.h>}.
1996-09-25 01:21:45 +02:00
@item
An area of memory used to save certain registers used by the function.
The size of this area, which may also include space for such things as
the return address and pointers to previous stack frames, is
machine-specific and usually depends on which registers have been used
in the function. Machines with register windows often do not require
a save area.
@item
A region of at least @var{size} bytes, possibly rounded up to an allocation
boundary, to contain the local variables of the function. On some machines,
this region and the save area may occur in the opposite order, with the
save area closer to the top of the stack.
@item
@cindex @code{ACCUMULATE_OUTGOING_ARGS} and stack frames
Optionally, when @code{ACCUMULATE_OUTGOING_ARGS} is defined, a region of
@code{crtl->outgoing_args_size} bytes to be used for outgoing
1996-09-25 01:21:45 +02:00
argument lists of the function. @xref{Stack Arguments}.
@end itemize
@defmac EXIT_IGNORE_STACK
1996-09-25 01:21:45 +02:00
Define this macro as a C expression that is nonzero if the return
instruction or the function epilogue ignores the value of the stack
pointer; in other words, if it is safe to delete an instruction to
adjust the stack pointer before a return from the function. The
default is 0.
1996-09-25 01:21:45 +02:00
Note that this macro's value is relevant only for functions for which
frame pointers are maintained. It is never safe to delete a final
stack adjustment in a function that has no frame pointer, and the
compiler knows this regardless of @code{EXIT_IGNORE_STACK}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac EPILOGUE_USES (@var{regno})
Define this macro as a C expression that is nonzero for registers that are
1996-09-25 01:21:45 +02:00
used by the epilogue or the @samp{return} pattern. The stack and frame
pointer registers are already assumed to be used as needed.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac EH_USES (@var{regno})
Define this macro as a C expression that is nonzero for registers that are
used by the exception handling mechanism, and so should be considered live
on entry to an exception edge.
@end defmac
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_MI_THUNK (FILE *@var{file}, tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, HOST_WIDE_INT @var{vcall_offset}, tree @var{function})
target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. (TARGET_ASM_OUT): Add them. * target.h (asm_out): Add output_mi_thunk and output_mi_vcall_thunk. * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. * config/arm/arm.c (arm_output_mi_thunk): Define. * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust prototype. (x86_output_mi_vcall_thunk): Declare. * config/i386/i386.c (override_options): Clear output_mi_vcall_thunk in 64-bit mode. (ix86_fntype_regparm): New function. (ix86_return_pops_args): Use it. (ia32_this_parameter): New function. (x86_output_mi_vcall_thunk): New function. (x86_output_mi_thunk): Use it * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. * config/i960/i960.c (i960_output_mi_thunk): New function. * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. * config/ia64/ia64.c (ia64_output_mi_thunk): Define. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. * config/s390/s390.c (s390_output_mi_thunk): Define. * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. * config/vax/vax.c (vax_output_mi_thunk): Define. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * doc/tm.texi: Adjust documentation. From-SVN: r58293
2002-10-19 01:35:40 +02:00
A function that outputs the assembler code for a thunk
1996-09-25 01:21:45 +02:00
function, used to implement C++ virtual function calls with multiple
inheritance. The thunk acts as a wrapper around a virtual function,
adjusting the implicit object parameter before handing control off to
the real function.
First, emit code to add the integer @var{delta} to the location that
contains the incoming first argument. Assume that this argument
contains a pointer, and is the one used to pass the @code{this} pointer
in C++. This is the incoming argument @emph{before} the function prologue,
e.g.@: @samp{%o0} on a sparc. The addition must preserve the values of
1996-09-25 01:21:45 +02:00
all other incoming arguments.
Then, if @var{vcall_offset} is nonzero, an additional adjustment should be
made after adding @code{delta}. In particular, if @var{p} is the
adjusted pointer, the following adjustment should be made:
@smallexample
p += (*((ptrdiff_t **)p))[vcall_offset/sizeof(ptrdiff_t)]
@end smallexample
After the additions, emit code to jump to @var{function}, which is a
1996-09-25 01:21:45 +02:00
@code{FUNCTION_DECL}. This is a direct pure jump, not a call, and does
not touch the return address. Hence returning from @var{FUNCTION} will
return to whoever called the current @samp{thunk}.
The effect must be as if @var{function} had been called directly with
the adjusted first argument. This macro is responsible for emitting all
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
of the code for a thunk function; @code{TARGET_ASM_FUNCTION_PROLOGUE}
and @code{TARGET_ASM_FUNCTION_EPILOGUE} are not invoked.
1996-09-25 01:21:45 +02:00
The @var{thunk_fndecl} is redundant. (@var{delta} and @var{function}
have already been extracted from it.) It might possibly be useful on
some targets, but probably not.
1997-08-11 17:56:58 +02:00
If you do not define this macro, the target-independent code in the C++
front end will generate a less efficient heavyweight thunk that calls
1997-08-11 17:56:58 +02:00
@var{function} instead of jumping to it. The generic approach does
not support varargs.
target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. (TARGET_ASM_OUT): Add them. * target.h (asm_out): Add output_mi_thunk and output_mi_vcall_thunk. * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. * config/arm/arm.c (arm_output_mi_thunk): Define. * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust prototype. (x86_output_mi_vcall_thunk): Declare. * config/i386/i386.c (override_options): Clear output_mi_vcall_thunk in 64-bit mode. (ix86_fntype_regparm): New function. (ix86_return_pops_args): Use it. (ia32_this_parameter): New function. (x86_output_mi_vcall_thunk): New function. (x86_output_mi_thunk): Use it * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. * config/i960/i960.c (i960_output_mi_thunk): New function. * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. * config/ia64/ia64.c (ia64_output_mi_thunk): Define. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. * config/s390/s390.c (s390_output_mi_thunk): Define. * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. * config/vax/vax.c (vax_output_mi_thunk): Define. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * doc/tm.texi: Adjust documentation. From-SVN: r58293
2002-10-19 01:35:40 +02:00
@end deftypefn
@deftypefn {Target Hook} bool TARGET_ASM_CAN_OUTPUT_MI_THUNK (const_tree @var{thunk_fndecl}, HOST_WIDE_INT @var{delta}, HOST_WIDE_INT @var{vcall_offset}, const_tree @var{function})
A function that returns true if TARGET_ASM_OUTPUT_MI_THUNK would be able
to output the assembler code for the thunk function specified by the
arguments it is passed, and false otherwise. In the latter case, the
generic approach will be used by the C++ front end, with the limitations
previously exposed.
target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. * target-def.h (TARGET_ASM_OUTPUT_MI_THUNK): Default to NULL. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Likewise. (TARGET_ASM_OUT): Add them. * target.h (asm_out): Add output_mi_thunk and output_mi_vcall_thunk. * config/alpha/alpha.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/arm/arm-protos.h (arm_output_mi_thunk): Declare. * config/arm/arm.c (arm_output_mi_thunk): Define. * config/arm/arm.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/cris/cris.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/frv/frv.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/i386/i386-protos.h (x86_output_mi_thunk): Adjust prototype. (x86_output_mi_vcall_thunk): Declare. * config/i386/i386.c (override_options): Clear output_mi_vcall_thunk in 64-bit mode. (ix86_fntype_regparm): New function. (ix86_return_pops_args): Use it. (ia32_this_parameter): New function. (x86_output_mi_vcall_thunk): New function. (x86_output_mi_thunk): Use it * config/i386/unix.h (TARGET_ASM_OUTPUT_MI_THUNK): Adjust. (TARGET_ASM_OUTPUT_MI_VCALL_THUNK): Define. * config/i960/i960-protos.h (i960_output_mi_thunk): Declare. * config/i960/i960.c (i960_output_mi_thunk): New function. * config/i960/i960.h (ASM_OUTPUT_MI_THUNK): Adjust. * config/ia64/ia64-protos.h (ia64_output_mi_thunk): Declare. * config/ia64/ia64.c (ia64_output_mi_thunk): Define. * config/ia64/ia64.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/m68k-protos.h (m68k_output_mi_thunk): New function. * config/m68k/linux.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/m68k/netbsd-elf.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/mmix/mmix.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/pa/pa.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/rs6000/sysv4.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/s390/s390-protos.h (s390_output_mi_thunk): Declare. * config/s390/s390.c (s390_output_mi_thunk): Define. * config/s390/s390.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/sparc/sparc.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/stormy16/stormy16.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * config/vax/vax-protos.h (vax_output_mi_thunk): Declare. * config/vax/vax.c (vax_output_mi_thunk): Define. * config/vax/vax.h (ASM_OUTPUT_MI_THUNK): Rename to ... (TARGET_ASM_OUTPUT_MI_THUNK): ... this. * doc/tm.texi: Adjust documentation. From-SVN: r58293
2002-10-19 01:35:40 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Profiling
@subsection Generating Code for Profiling
@cindex profiling, code generation
These macros will help you generate code for profiling.
@defmac FUNCTION_PROFILER (@var{file}, @var{labelno})
1996-09-25 01:21:45 +02:00
A C statement or compound statement to output to @var{file} some
assembler code to call the profiling subroutine @code{mcount}.
@findex mcount
The details of how @code{mcount} expects to be called are determined by
your operating system environment, not by GCC@. To figure them out,
compile a small program for profiling using the system's installed C
compiler and look at the assembler code that results.
Older implementations of @code{mcount} expect the address of a counter
variable to be loaded into some register. The name of this variable is
@samp{LP} followed by the number @var{labelno}, so you would generate
the name using @samp{LP%d} in a @code{fprintf}.
@end defmac
@defmac PROFILE_HOOK
A C statement or compound statement to output to @var{file} some assembly
code to call the profiling subroutine @code{mcount} even the target does
not support profiling.
@end defmac
@defmac NO_PROFILE_COUNTERS
Define this macro to be an expression with a nonzero value if the
@code{mcount} subroutine on your system does not need a counter variable
allocated for each function. This is true for almost all modern
implementations. If you define this macro, you must not use the
@var{labelno} argument to @code{FUNCTION_PROFILER}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PROFILE_BEFORE_PROLOGUE
1996-09-25 01:21:45 +02:00
Define this macro if the code for function profiling should come before
the function prologue. Normally, the profiling code comes after.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_KEEP_LEAF_WHEN_PROFILED (void)
This target hook returns true if the target wants the leaf flag for the current function to stay true even if it calls mcount. This might make sense for targets using the leaf flag only to determine whether a stack frame needs to be generated or not and for which the call to mcount is generated before the function prologue.
@end deftypefn
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@node Tail Calls
@subsection Permitting tail calls
@cindex tail calls
@deftypefn {Target Hook} bool TARGET_FUNCTION_OK_FOR_SIBCALL (tree @var{decl}, tree @var{exp})
2013-07-22 19:46:05 +02:00
True if it is OK to do sibling call optimization for the specified
call expression @var{exp}. @var{decl} will be the called function,
or @code{NULL} if this is an indirect call.
It is not uncommon for limitations of calling conventions to prevent
tail calls to functions outside the current unit of translation, or
during PIC compilation. The hook is used to enforce these restrictions,
as the @code{sibcall} md pattern can not fail, or fall over to a
``normal'' call. The criteria for successful sibling call optimization
may vary greatly between different architectures.
@end deftypefn
@deftypefn {Target Hook} void TARGET_EXTRA_LIVE_ON_ENTRY (bitmap @var{regs})
re PR rtl-optimization/24762 ([killloop-branch] code motion of non-invariant expressions with hard registers.) 2006-01-27 Daniel Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/24762 * doc/tm.texi: Added TARGET_EXTRA_LIVE_ON_ENTRY. * targhooks.c (hook_void_bitmap): New hook prototype. * targhoohs.h (hook_void_bitmap): Ditto. * bitmap.h (bitmap_head_def): Moved to coretypes.h. * coretypes.h (bitmap_head_def): Moved from bitmap.h. * target.h (live_on_entry): New function pointer. * df-scan.c (df_all_hard_regs): Removed. (df_scan_dump, df_hard_reg_init): Removed df_all_hard_regs. (df_scan_free_internal): Added df->entry_block_defs. (df_scan_alloc): Ditto. (df_scan_dump): Ditto. (df_uses_record): Plumbed flag field properly thru calls. Record EH_RETURN_DATA_REGNO in eh blocks unconditionally. This part fixes PR24762. (df_bb_refs_record): Added code to make the frame and arg pointers live in EH blocks. (df_refs_record): Added call to df_record_entry_block_defs. (df_record_entry_block_defs): New function. * df-core.c: Added comments to describe new artifical defs. * df.h (DF_REF_DIES_AFTER_THIS_USE): New flag in enum df_ref_flags. (entry_block_defs): New field in struct df. (df_all_hard_regs): Deleted. * target-def.h: Added TARGET_EXTRA_LIVE_ON_ENTRY. * df-problems.c (df_ru_bb_local_compute_process_def): Added code to handle artifical defs in the entry to a function. (df_ru_bb_local_compute): Ditto. (df_rd_bb_local_compute_process_def): Ditto. (df_rd_bb_local_compute): Ditto. (df_lr_bb_local_compute): Ditto. (df_ur_bb_local_compute): Ditto. (df_urec_bb_local_compute): Ditto. (df_chain_create_bb): Ditto. (df_ur_local_finalize): Removed entry. (df_urec_init): Ditto. (df_urec_local_finalize): Ditto. (df_ri_bb_compute): Added detection of last use of pseudos. * Makefile.in (df-scan.o): Updated dependencies. * config/mips/mips-protos.h (mips_set_live_on_entry): Added. * config/mips/mips.c (mips_set_live_on_entry): Added. * config/mips/mips.c (TARGET_EXTRA_LIVE_ON_ENTRY): Added value for target hook. * dce.c (marked_insn_p): Added code to handle artifical defs. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r110312
2006-01-27 23:23:32 +01:00
Add any hard registers to @var{regs} that are live on entry to the
function. This hook only needs to be defined to provide registers that
cannot be found by examination of FUNCTION_ARG_REGNO_P, the callee saved
registers, STATIC_CHAIN_INCOMING_REGNUM, STATIC_CHAIN_REGNUM,
TARGET_STRUCT_VALUE_RTX, FRAME_POINTER_REGNUM, EH_USES,
FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, and the PIC_OFFSET_TABLE_REGNUM.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SET_UP_BY_PROLOGUE (struct hard_reg_set_container *@var{})
This hook should add additional registers that are computed by the prologue to the hard regset for shrink-wrapping optimization purposes.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_WARN_FUNC_RETURN (tree)
True if a function's return statements should be checked for matching the function's return type. This includes checking for falling off the end of a non-void function. Return false if no such check should be made.
@end deftypefn
c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-27 09:41:16 +02:00
@node Stack Smashing Protection
@subsection Stack smashing protection
@cindex stack smashing protection
@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void)
This hook returns a @code{DECL} node for the external variable to use
for the stack protection guard. This variable is initialized by the
c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-27 09:41:16 +02:00
runtime to some random value and is used to initialize the guard value
that is placed at the top of the local stack frame. The type of this
variable must be @code{ptr_type_node}.
The default version of this hook creates a variable called
@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_FAIL (void)
This hook returns a @code{CALL_EXPR} that alerts the runtime that the
c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-27 09:41:16 +02:00
stack protect guard variable has been modified. This expression should
involve a call to a @code{noreturn} function.
The default version of this hook invokes a function called
@samp{__stack_chk_fail}, taking no arguments. This function is
c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-27 09:41:16 +02:00
normally defined in @file{libgcc2.c}.
@end deftypefn
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypefn {Common Target Hook} bool TARGET_SUPPORTS_SPLIT_STACK (bool @var{report}, struct gcc_options *@var{opts})
target.def (supports_split_stack, [...]): Take gcc_options parameters. * target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-25 14:16:03 +01:00
Whether this target supports splitting the stack when the options described in @var{opts} have been passed. This is called after options have been parsed, so the target may reject splitting the stack in some configurations. The default version of this hook returns false. If @var{report} is true, this function may issue a warning or error; if @var{report} is false, it must simply return a value
common.opt (fsplit-stack): New option. gcc/: * common.opt (fsplit-stack): New option. * opts.c (decode_options): Set flag_split_stack to final value. * target.def (supports_split_stack): New hook. * gcc.c (STACK_SPLIT_SPEC): Define. (LINK_COMMAND_SPEC): Use STACK_SPLIT_SPEC. * doc/invoke.texi (Option Summary): Mention -fsplit-stack. (Code Gen Options): Document -fsplit-stack. * doc/extend.texi (Function Attributes): Mention no_split_stack. (Function Attributes): Document no_split_stack. * doc/tm.texi.in (Stack Smashing Protection): Add @hook TARGET_SUPPORTS_SPLIT_STACK. * doc/tm.texi: Rebuild. * function.c (thread_prologue_and_epilogue_insns): If flag_split_stack, add split stack prologue. * explow.c (allocate_dynamic_stack_space): Support -fsplit-stack. * varasm.c (saw_no_split_stack): New static variable. (assemble_start_function): Set saw_no_split_stack if the function has the no_split_stack attribute. (file_end_indicate_split_stack): New function. * output.h (file_end_indicate_split_stack): Declare. * libgcc-std.ver (GCC_4.6.0): Add -fsplit-stack support variables and function. * doc/libgcc.texi (Miscellaneous routines): Document -fsplit-stack routines. * config/i386/i386.c (ix86_option_override_internal): Don't set expand_builtin_va_start to NULL if -fsplit-stack. (ix86_function_regparm): Reduce local regparm by 1 for 32-bit -fsplit-stack. (ix86_va_start): If -fsplit-stack, get overflow pointer from scratch register set by prologue. (ix86_code_end): If -fsplit-stack, call file_end_indicate_split_stack. (ix86_supports_split_stack): New static function. (SPLIT_STACK_AVAILABLE): Define. (split_stack_prologue_scratch_regno): New static function. (split_stack_fn): New static variable. (ix86_expand_split_stack_prologue): New function. (ix86_live_on_entry): New static function. (ix86_legitimate_address_p): Handle UNSPEC_STACK_CHECK. (output_pic_addr_const): Likewise. (i386_asm_output_addr_const_extra): Likewise. (ix86_expand_call): Change return type to rtx. Return the new call instruction. (TARGET_SUPPORTS_SPLIT_STACK): Define. (TARGET_EXTRA_LIVE_ON_ENTRY): Define. * config/i386/i386.md (UNSPEC_STACK_CHECK): Define. (split_stack_prologue, split_stack_return): New insns. (split_stack_space_check): New insn. * config/i386/i386.h (struct machine_function): Add split_stack_varargs_pointer field. * config/i386/linux.h (TARGET_CAN_SPLIT_STACK): Define. (TARGET_THREAD_SPLIT_STACK_OFFSET): Define. * config/i386/linux64.h (TARGET_CAN_SPLIT_STACK): Define. (TARGET_THREAD_SPLIT_STACK_OFFSET): Define. * config/i386/i386-protos.h (ix86_expand_split_stack_prologue): Declare. (ix86_expand_call): Update declaration. gcc/c-family/: * c-common.c (c_common_attribute_table): Add no_split_stack. (handle_no_split_stack_attribute): New static function. gcc/testsuite/: * lib/target-supports.exp (check_effective_target_split_stack): New procedure. * gcc.dg/split-1.c: New test. * gcc.dg/split-2.c: New test. * gcc.dg/split-3.c: New test. * gcc.dg/split-4.c: New test. libgcc/: * generic-morestack.h: New file. * generic-morestack.c: New file. * generic-morestack-thread.c: New file. * config/i386/morestack.S: New file. * config/t-stack: New file. * config/i386/t-stack-i386: New file. * config.host (i[34567]86-*-linux* and friends): Add t-stack and i386/t-stack-i386 to tmake_file. From-SVN: r164661
2010-09-27 21:48:20 +02:00
@end deftypefn
@node Miscellaneous Register Hooks
@subsection Miscellaneous register hooks
@cindex miscellaneous register hooks
@deftypevr {Target Hook} bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS
Set to true if each call that binds to a local definition explicitly
clobbers or sets all non-fixed registers modified by performing the call.
That is, by the call pattern itself, or by code that might be inserted by the
linker (e.g. stubs, veneers, branch islands), but not including those
modifiable by the callee. The affected registers may be mentioned explicitly
in the call pattern, or included as clobbers in CALL_INSN_FUNCTION_USAGE.
The default version of this hook is set to false. The purpose of this hook
is to enable the fuse-caller-save optimization.
@end deftypevr
1996-09-25 01:21:45 +02:00
@node Varargs
@section Implementing the Varargs Macros
@cindex varargs implementation
GCC comes with an implementation of @code{<varargs.h>} and
@code{<stdarg.h>} that work without change on machines that pass arguments
1996-09-25 01:21:45 +02:00
on the stack. Other machines require their own implementations of
varargs, and the two machine independent header files must have
conditionals to include it.
ISO @code{<stdarg.h>} differs from traditional @code{<varargs.h>} mainly in
1996-09-25 01:21:45 +02:00
the calling convention for @code{va_start}. The traditional
implementation takes just one argument, which is the variable in which
to store the argument pointer. The ISO implementation of
1996-09-25 01:21:45 +02:00
@code{va_start} takes an additional second argument. The user is
supposed to write the last named argument of the function here.
However, @code{va_start} should not use this argument. The way to find
the end of the named arguments is with the built-in functions described
below.
@defmac __builtin_saveregs ()
1996-09-25 01:21:45 +02:00
Use this built-in function to save the argument registers in memory so
that the varargs mechanism can access them. Both ISO and traditional
1996-09-25 01:21:45 +02:00
versions of @code{va_start} must use @code{__builtin_saveregs}, unless
you use @code{TARGET_SETUP_INCOMING_VARARGS} (see below) instead.
1996-09-25 01:21:45 +02:00
On some machines, @code{__builtin_saveregs} is open-coded under the
control of the target hook @code{TARGET_EXPAND_BUILTIN_SAVEREGS}. On
other machines, it calls a routine written in assembler language,
found in @file{libgcc2.c}.
1996-09-25 01:21:45 +02:00
Code generated for the call to @code{__builtin_saveregs} appears at the
beginning of the function, as opposed to where the call to
@code{__builtin_saveregs} is written, regardless of what the code is.
This is because the registers must be saved before the function starts
to use them for its own purposes.
@c i rewrote the first sentence above to fix an overfull hbox. --mew
@c 10feb93
@end defmac
1996-09-25 01:21:45 +02:00
@defmac __builtin_next_arg (@var{lastarg})
This builtin returns the address of the first anonymous stack
argument, as type @code{void *}. If @code{ARGS_GROW_DOWNWARD}, it
1996-09-25 01:21:45 +02:00
returns the address of the location above the first anonymous stack
argument. Use it in @code{va_start} to initialize the pointer for
fetching arguments from the stack. Also use it in @code{va_start} to
verify that the second parameter @var{lastarg} is the last named argument
of the current function.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac __builtin_classify_type (@var{object})
1996-09-25 01:21:45 +02:00
Since each machine has its own conventions for which data types are
passed in which kind of register, your implementation of @code{va_arg}
has to embody these conventions. The easiest way to categorize the
specified data type is to use @code{__builtin_classify_type} together
with @code{sizeof} and @code{__alignof__}.
@code{__builtin_classify_type} ignores the value of @var{object},
considering only its data type. It returns an integer describing what
kind of type that is---integer, floating, pointer, structure, and so on.
The file @file{typeclass.h} defines an enumeration that you can use to
interpret the values of @code{__builtin_classify_type}.
@end defmac
1996-09-25 01:21:45 +02:00
These machine description macros help implement varargs:
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@deftypefn {Target Hook} rtx TARGET_EXPAND_BUILTIN_SAVEREGS (void)
If defined, this hook produces the machine-specific code for a call to
@code{__builtin_saveregs}. This code will be moved to the very
beginning of the function, before any parameter access are made. The
return value of this function should be an RTX that contains the value
to use as the return of @code{__builtin_saveregs}.
@end deftypefn
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
This target hook offers an alternative to using
@code{__builtin_saveregs} and defining the hook
@code{TARGET_EXPAND_BUILTIN_SAVEREGS}. Use it to store the anonymous
register arguments into the stack so that all the arguments appear to
have been passed consecutively on the stack. Once this is done, you can
use the standard implementation of varargs that works for machines that
pass all their arguments on the stack.
1996-09-25 01:21:45 +02:00
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data
structure, containing the values that are obtained after processing the
1996-09-25 01:21:45 +02:00
named arguments. The arguments @var{mode} and @var{type} describe the
last named argument---its machine mode and its data type as a tree node.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
The target hook should do two things: first, push onto the stack all the
argument registers @emph{not} used for the named arguments, and second,
store the size of the data thus pushed into the @code{int}-valued
variable pointed to by @var{pretend_args_size}. The value that you
store here will serve as additional offset for setting up the stack
frame.
1996-09-25 01:21:45 +02:00
Because you must generate code to push the anonymous arguments at
compile time without knowing their data types,
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@code{TARGET_SETUP_INCOMING_VARARGS} is only useful on machines that
have just a single category of argument register and use it uniformly
for all data types.
1996-09-25 01:21:45 +02:00
If the argument @var{second_time} is nonzero, it means that the
arguments of the function are being analyzed for the second time. This
happens for an inline function, which is not actually compiled until the
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
end of the source file. The hook @code{TARGET_SETUP_INCOMING_VARARGS} should
1996-09-25 01:21:45 +02:00
not generate any instructions in this case.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (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" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
@deftypefn {Target Hook} bool TARGET_STRICT_ARGUMENT_NAMING (cumulative_args_t @var{ca})
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
Define this hook to return @code{true} if the location where a function
argument is passed depends on whether or not it is a named argument.
1996-09-25 01:21:45 +02:00
This hook controls how the @var{named} argument to @code{TARGET_FUNCTION_ARG}
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
is set for varargs and stdarg functions. If this hook returns
@code{true}, the @var{named} argument is always true for named
arguments, and false for unnamed arguments. If it returns @code{false},
but @code{TARGET_PRETEND_OUTGOING_VARARGS_NAMED} returns @code{true},
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
then all arguments are treated as named. Otherwise, all named arguments
except the last are treated as named.
You need not define this hook if it always returns @code{false}.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@end deftypefn
re PR middle-end/46500 (target.h includes tm.h) PR middle-end/46500 gcc: * doc/tm.texi.in: Update Copyright date. * doc/tm.texi: Regenerate. * targhooks.c (default_setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * targhooks.h (default_setup_incoming_varargs): Likewise. (default_pretend_outgoing_varargs_named): Likewise. (hook_pass_by_reference_must_pass_in_stack): Likewise. (hook_callee_copies_named): Likewise. (default_function_arg_advance): Likewise. (default_function_arg): Likewise. (default_function_incoming_arg): Likewise. (hook_bool_CUMULATIVE_ARGS_false): Likewise. (hook_bool_CUMULATIVE_ARGS_true): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Likewise. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_int_CUMULATIVE_ARGS_mode_tree_bool_0): Likewise. * target.def (pass_by_reference): Likewise. (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" . (cumulative_args_t): New typedef. [GCC_TM_H] (get_cumulative_args): New static inline function. [GCC_TM_H] (pack_cumulative_args): Likewise. * config/alpha/alpha.c (alpha_function_arg): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (alpha_function_arg_advance, alpha_arg_partial_bytes): Likewise. (alpha_pass_by_reference, alpha_setup_incoming_varargs): Likewise. * config/frv/frv.c (frv_setup_incoming_varargs): Likewise. (frv_arg_partial_bytes, frv_function_arg): Likewise. (frv_function_incoming_arg, frv_function_arg_advance): Likewise. (frv_function_arg_1): Likewise. * config/s390/s390.c (s390_pass_by_reference): Likewise. (s390_function_arg_advance, s390_function_arg): Likewise. * config/m32c/m32c.c (m32c_function_arg): Likewise. (m32c_pass_by_reference, m32c_function_arg_advance): Likewise. (m32c_strict_argument_naming): Likewise. * config/spu/spu.c (spu_pass_by_reference, spu_function_arg): Likewise. (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Likewise. Make static. * config/spu/spu-protos.h (spu_setup_incoming_varargs): Remove prototype. * config/sparc/sparc.c (sparc_strict_argument_naming): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (sparc_pass_by_reference, sparc_function_arg_advance): Likewise. (sparc_function_arg, sparc_function_incoming_arg): Likewise. (sparc_arg_partial_bytes, sparc_function_arg_1): Likewise. * config/mep/mep.c (mep_setup_incoming_varargs): Likewise. (mep_pass_by_reference, mep_function_arg): Likewise. (mep_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise. (m32r_pass_by_reference, m32r_arg_partial_bytes): Likewise. (m32r_function_arg, m32r_function_arg_advance): Likewise. * config/rx/rx.c (rx_function_arg, rx_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_function_arg, ix86_pass_by_reference): Likewise. (ix86_setup_incoming_varargs): Likewise. * config/sh/sh.c (sh_setup_incoming_varargs): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named, sh_pass_by_reference): Likewise. (sh_callee_copies, sh_arg_partial_bytes): Likewise. (sh_function_arg_advance, sh_function_arg): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg): Likewise. (pdp11_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_function_arg, function_arg_partial_bytes): Likewise. * config/avr/avr.c (avr_function_arg): Likewise. (avr_function_arg_advance): Likewise. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Likewise. (xtensa_function_arg, xtensa_function_incoming_arg): Likewise. (xtensa_function_arg_1): Likewise. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Likewise. (xstormy16_function_arg): Likewise. * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise. (fr30_arg_partial_bytes, fr30_function_arg): Likewise. (fr30_function_arg_advance): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. (lm32_function_arg, lm32_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise. (moxie_function_arg, moxie_function_arg_advance): Likewise. (moxie_pass_by_reference, moxie_arg_partial_bytes): Likewise. * config/cris/cris.c (cris_setup_incoming_varargs): Likewise. (cris_pass_by_reference, cris_arg_partial_bytes): Likewise. (cris_function_arg, cris_function_incoming_arg): Likewise. (cris_function_arg_advance, cris_function_arg_1): Likewise. * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise. (iq2000_pass_by_reference, iq2000_arg_partial_bytes): Likewise. (iq2000_function_arg, iq2000_function_arg_advance): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. (mn10300_function_arg, mn10300_function_arg_advance): Likewise. (mn10300_arg_partial_bytes): Likewise. * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise. (ia64_arg_partial_bytes, ia64_function_arg): Likewise. (ia64_function_incoming_arg, ia64_function_arg_advance): Likewise. (ia64_function_arg_1): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. (m68k_function_arg): Likewise. * config/rs6000/rs6000.c (rs6000_function_arg_advance): Likewise. (rs6000_function_arg, setup_incoming_varargs): Likewise. (rs6000_pass_by_reference, rs6000_arg_partial_bytes): Likewise. * config/picochip/picochip.c (picochip_arg_partial_bytes): Likewise. (picochip_function_arg, picochip_incoming_function_arg): Likewise. (picochip_arg_advance): Likewise. * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise. (mcore_arg_partial_bytes, mcore_function_arg): Likewise. (mcore_function_arg_advance): Likewise. * config/score/score.c (score_pass_by_reference): Likewise. (score_function_arg_advance): Likewise. (score_arg_partial_bytes): Likewise. Make static. * config/score/score-protos.h (score_arg_partial_bytes): Don't declare. * config/arm/arm.c (arm_arg_partial_bytes): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (arm_function_arg, arm_function_arg_advance): Likewise. (arm_setup_incoming_varargs, arm_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. (pa_arg_partial_bytes, pa_function_arg_advance): Likewise. (pa_function_arg): Likewise. * config/mips/mips.c (mips_strict_argument_naming): Likewise. (mips_function_arg, mips_function_arg_advance): Likewise. (mips_arg_partial_bytes, mips_pass_by_reference): Likewise. (mips_callee_copies, mips_setup_incoming_varargs): Likewise. * config/vax/vax.c (vax_function_arg): Likewise. (vax_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg): Likewise. (h8300_function_arg_advance): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. (v850_strict_argument_naming, v850_function_arg): Likewise. (v850_arg_partial_bytes, v850_function_arg_advance): Likewise. (v850_setup_incoming_varargs): Likewise. * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise. (mmix_function_arg_advance, mmix_function_incoming_arg): Likewise. (mmix_function_arg, mmix_pass_by_reference): Likewise. (mmix_function_arg_1): Replace const CUMULATIVE_ARGS* argument type with const void *. * config/bfin/bfin.c (setup_incoming_varargs): Replace CUMULATIVE_ARGS* argument type with cumulative_args_t. (bfin_function_arg_advance, bfin_function_arg): Likewise. (bfin_arg_partial_bytes, bfin_pass_by_reference): Likewise. * calls.c (emit_call_1): Change type of args_so_far to cumulative_args_t. Changed all callers. (initialize_argument_information): Likewise. (expand_call, emit_library_call_value_1): Use pack_cumulative_args. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (pass_by_reference, reference_callee_copied): Likewise. (struct assign_parm_data_all): Rename args_so_far to args_so_far_v. New member args_so_far_v. Changed all users. * var-tracking.c (prepare_call_arguments): Use pack_cumulative_args. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/mips/mips.c (mips_output_args_xfer): Likewise. * config/s390/s390.c (s390_call_saved_register_used): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/microblaze/microblaze.c (microblaze_expand_prologue): Likewise. * config/m32r/m32r.c (m32r_return_in_memory): Adjust for changed m32r_pass_by_reference. gcc/ada: * gcc-interface/decl.c (gnat_to_gnu_param): Use pack_cumulative_args. From-SVN: r175103
2011-06-16 15:45:47 +02:00
@deftypefn {Target Hook} bool TARGET_PRETEND_OUTGOING_VARARGS_NAMED (cumulative_args_t @var{ca})
If you need to conditionally change ABIs so that one works with
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
@code{TARGET_SETUP_INCOMING_VARARGS}, but the other works like neither
@code{TARGET_SETUP_INCOMING_VARARGS} nor @code{TARGET_STRICT_ARGUMENT_NAMING} was
defined, then define this hook to return @code{true} if
@code{TARGET_SETUP_INCOMING_VARARGS} is used, @code{false} otherwise.
targhooks.c: New file. * targhooks.c: New file. * targhooks.h: New file. * Makefile.in: Add targhooks.o support. (function.o): Depend on$(TARGET_H). (stmt.o): Likewise. (combine.o): Depend on $(TREE_H) and $(TARGET_H). * builtins.c (apply_args_size, expand_builtin_apply_args_1, expand_builtin_apply): Convert to calls.struct_value_rtx hook. (expand_builtin_saveregs): Convert to calls.expand_builtin_saveregs hook. * c-decl.c (start_decl): Handle new calls.promote_prototypes hook here, instead of ... (get_parm_info) ... here. (store_parm_decls_oldstyle): Convert to calls.promote_prototypes hook. (finish_function): Handle calls.promote_prototypes hook here too. * c-typeck.c (convert_arguments): Convert to calls.promote_prototypes hook. (c_convert_parm_for_inlining): Likewise. * calls.c (initialize_argument_information): Convert to calls.promote_function_args hook. (expand_call): Convert to calls.struct_value_rtx, calls.strict_argument_naming, calls.pretend_outgoing_varargs_named, and calls.promote_function_return hooks. Pass fndecl to aggregate_value_p. Initialize CUMULATIVE_ARGS before calling hooks, so they can use that. (emit_library_call_value_1): Likewise. * combine.c (setup_incoming_promotions): Convert to calls.promote_function_args hook. * emit-rtl.c: Convert to calls.struct_value_rtx hook. * expr.c (expand_assignment): Pass call to aggregate_value_p. (expand_expr): Likewise. * expr.h: Remove support for SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, RETURN_IN_MEMORY macro defaults. * final.c (profile_function): Convert to calls.struct_value_rtx hook. * function.c (aggregate_value_p): Accept function type tree as second parameter; try to deduce fntype from it. Convert to calls.return_in_memory hook. (assign_parms): Convert to calls.setup_incoming_varargs, calls.strict_argument_naming, calls.promote_function_args, calls.pretend_outgoing_varargs_named hooks. Pass fndecl to aggregate_value_p. (expand_function_start): Likewise. Convert to calls.struct_value_rtx hook. (expand_function_end): Convert to calls.promote_function_return hook. (allocate_struct_function): Pass fndecl to aggregate_value_p. * hard-reg-set.h: Update comments to new hook names. * integrate.c (expand_inline_function): Pass fndecl to aggregate_value_p. * reg-stack.c (stack_result): Likewise. * rtl.h (struct_value_rtx, struct_value_incoming_rtx): Delete. * stmt.c (expand_value_return): Convert to calls.promote_function_return hook. * target-def.h: Add TARGET_PROMOTE_FUNCTION_ARGS, TARGET_PROMOTE_FUNCTION_RETURN, TARGET_PROMOTE_PROTOTYPES, TARGET_STRUCT_VALUE_RTX, TARGET_RETURN_IN_MEMORY, TARGET_EXPAND_BUILTIN_SAVEREGS, TARGET_SETUP_INCOMING_VARARGS, TARGET_STRICT_ARGUMENT_NAMING, TARGET_PRETEND_OUTGOING_VARARGS_NAMED, and TARGET_CALLS. * target.h: Likewise. * tree.h (aggregate_value_p): Also takes a tree to deduce function attributes from (for target hooks). * doc/tm.texi (PROMOTE_FUNCTION_ARGS, PROMOTE_FUNCTION_RETURN, PROMOTE_PROTOTYPES, RETURN_IN_MEMORY, STRUCT_VALUE_REGNUM, STRUCT_VALUE, STRUCT_VALUE_INCOMING_REGNUM, STRUCT_VALUE_INCOMING, EXPAND_BUILTIN_SAVEREGS, SETUP_INCOMING_VARARGS, STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED): Convert to hooks. * config/alpha/alpha.c (alpha_output_mi_thunk_osf): Pass function to aggregate_value_p. * config/arm/arm.c (arm_init_cumulative_args, arm_output_mi_thunk): Likewise. * config/i386/i386.c (ix86_return_pops_args, x86_this_parameter): Likewise. * config/mips/mips.c (mips_save_reg_p, mips_expand_prologue, mips_can_use_return_insn): Likewise. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/s390/s390.c (s390_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Pass function to aggregate_value_p. * config/story16/stormy16.c (xstormy16_asm_output_mi_thunk): Pass function to aggregate_value_p. * objc/objc-act.c (generate_struct_by_value_array): Pass NULL to aggregate_value_p. * config/sh/sh-protos.h (sh_builtin_saveregs): Remove. (sh_attr_renesas_p, sh_cfun_attr_renesas_p, sh_function_arg, sh_function_arg_advance, sh_pass_in_reg_p): New. * config/sh/sh.c (sh_handle_renesas_attribute, sh_promote_prototypes, sh_struct_value_rtx, sh_return_in_memory, sh_builtin_saveregs, sh_setup_incoming_varargs, sh_strict_argument_naming, sh_pretend_outgoing_varargs_named): New decls. (targetm): Add new hooks. (calc_live_regs): Save MACL and MACH if the function has the renesas attribute. (sh_expand_prologue): Support renesas attribute. (sh_builtin_saveregs): Make static. (sh_build_va_list): Support renesas attribute. (sh_va_start): Likewise. (sh_va_arg): Likewise. (sh_promote_prototypes): New. (sh_function_arg): New, moved from sh.h. Support renesas attribute. (sh_function_arg_advance): Likewise. (sh_return_in_memory): Likewise. (sh_strict_argument_naming): Likewise. (sh_pretend_outgoing_varargs_named): Likewise. (sh_struct_value_rtx): New. (sh_attribute): Add renesas attribute. (sh_handle_renesas_attribute): New. (sh_attr_renesas_p, sh_cfun_attr_renesas_p): New. (sh_ms_bitfield_layout_p): Support renesas attribute also. (sh_output_mi_thunk): Pass function to aggregate_value_p. * config/sh/sh.h (TARGET_SWITCHES): Add -mrenesas as an alias for -mhitachi. (STRUCT_VALUE_REGNUM, STRUCT_VALUE, RETURN_IN_MEMORY): Moved to target hooks. (sh_args): Add renesas_abi flag. (INIT_CUMULATIVE_ARGS): Set it. Pass fndecl to aggregate_value_p. (FUNCTION_ARG_ADVANCE, FUNCTION_ARG): Move to sh.c. (PASS_IN_REG_P): Support renesas attribute. Pass DF and TF on the stack for the renesas abi. (STRICT_ARGUMENT_NAMING, PRETEND_OUTGOING_VARARGS_NAMED, SETUP_INCOMING_VARARGS, EXPAND_BUILTIN_SAVEREGS, PROMOTE_PROTOTYPES): Moved to sh.c. * config/sh/sh.md (call): Set call cookie to indicate renesas calls. * decl.c (finish_function): Pass fndecl to aggregate_value_p. * misc.c (default_pass_by_ref): Convert to calls.return_in_memory hook. From-SVN: r71048
2003-09-04 05:18:05 +02:00
Otherwise, you should not define this hook.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Trampolines
@section Trampolines for Nested Functions
@cindex trampolines for nested functions
@cindex nested functions, trampolines for
A @dfn{trampoline} is a small piece of code that is created at run time
when the address of a nested function is taken. It normally resides on
the stack, in the stack frame of the containing function. These macros
tell GCC how to generate code to allocate and initialize a
1996-09-25 01:21:45 +02:00
trampoline.
The instructions in the trampoline must do two things: load a constant
address into the static chain register, and jump to the real address of
the nested function. On CISC machines such as the m68k, this requires
two instructions, a move immediate and a jump. Then the two addresses
exist in the trampoline as word-long immediate operands. On RISC
machines, it is often necessary to load each address into a register in
two parts. Then pieces of each address form separate immediate
operands.
The code generated to initialize the trampoline must store the variable
parts---the static chain value and the function address---into the
immediate operands of the instructions. On a CISC machine, this is
simply a matter of copying each address to a memory reference at the
proper offset from the start of the trampoline. On a RISC machine, it
may be necessary to take out pieces of the address and store them
separately.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
@deftypefn {Target Hook} void TARGET_ASM_TRAMPOLINE_TEMPLATE (FILE *@var{f})
This hook is called by @code{assemble_trampoline_template} to output,
on the stream @var{f}, assembler code for a block of data that contains
the constant parts of a trampoline. This code should not include a
label---the label is taken care of automatically.
1996-09-25 01:21:45 +02:00
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
If you do not define this hook, it means no template is needed
for the target. Do not define this hook on systems where the block move
1996-09-25 01:21:45 +02:00
code to copy the trampoline into place would be larger than the code
to generate it on the spot.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac TRAMPOLINE_SECTION
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
Return the section into which the trampoline template is to be placed
(@pxref{Sections}). The default value is @code{readonly_data_section}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac TRAMPOLINE_SIZE
1996-09-25 01:21:45 +02:00
A C expression for the size in bytes of the trampoline, as an integer.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac TRAMPOLINE_ALIGNMENT
1996-09-25 01:21:45 +02:00
Alignment required for trampolines, in bits.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
If you don't define this macro, the value of @code{FUNCTION_ALIGNMENT}
1996-09-25 01:21:45 +02:00
is used for aligning trampolines.
@end defmac
1996-09-25 01:21:45 +02:00
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
@deftypefn {Target Hook} void TARGET_TRAMPOLINE_INIT (rtx @var{m_tramp}, tree @var{fndecl}, rtx @var{static_chain})
This hook is called to initialize a trampoline.
@var{m_tramp} is an RTX for the memory block for the trampoline; @var{fndecl}
is the @code{FUNCTION_DECL} for the nested function; @var{static_chain} is an
1996-09-25 01:21:45 +02:00
RTX for the static chain value that should be passed to the function
when it is called.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
If the target defines @code{TARGET_ASM_TRAMPOLINE_TEMPLATE}, then the
first thing this hook should do is emit a block move into @var{m_tramp}
from the memory block returned by @code{assemble_trampoline_template}.
Note that the block move need only cover the constant parts of the
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
trampoline. If the target isolates the variable parts of the trampoline
to the end, not all @code{TRAMPOLINE_SIZE} bytes need be copied.
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
If the target requires any other actions, such as flushing caches or
enabling stack execution, these actions should be performed after
re PR target/41246 (should "sorry" when regparm=3 and nested functions are encountered) PR target/41246 * target.h (struct gcc_target): Add asm_out.trampoline_template, calls.static_chain, calls.trampoline_init, calls.trampoline_adjust_address. * target-def.h (TARGET_ASM_TRAMPOLINE_TEMPLATE): New. (TARGET_STATIC_CHAIN, TARGET_TRAMPOLINE_INIT): New. (TARGET_TRAMPOLINE_ADJUST_ADDRESS): New. * builtins.c (expand_builtin_setjmp_receiver): Use targetm.calls.static_chain; only clobber registers. (expand_builtin_init_trampoline): Use targetm.calls.trampoline_init; set up memory attributes properly for the trampoline block. (expand_builtin_adjust_trampoline): Use targetm.calls.trampoline_adjust_address. * calls.c (prepare_call_address): Add fndecl argument. Use targetm.calls.static_chain. * df-scan.c (df_need_static_chain_reg): Remove. (df_get_entry_block_def_set): Use targetm.calls.static_chain; consolodate static chain handling. * doc/tm.texi: Document new hooks. * emit-rtl.c (static_chain_rtx, static_chain_incoming_rtx): Remove. (init_emit_regs): Don't initialize them. * expr.h (prepare_call_address): Update decl. * final.c (profile_function): Use targetm.calls.static_chain. * function.c (expand_function_start): Likewise. * rtl.h (static_chain_rtx, static_chain_incoming_rtx): Remove. * stmt.c (expand_nl_goto_receiver): Use targetm.calls.static_chain; only clobber registers. * targhooks.c (default_static_chain): New. (default_asm_trampoline_template, default_trampoline_init): New. (default_trampoline_adjust_address): New. * targhooks.h: Declare them. * varasm.c (assemble_trampoline_template): Use targetm.asm_out.trampoline_template. Make the memory block const and set its size. From-SVN: r151983
2009-09-22 17:11:37 +02:00
initializing the trampoline proper.
@end deftypefn
@deftypefn {Target Hook} rtx TARGET_TRAMPOLINE_ADJUST_ADDRESS (rtx @var{addr})
This hook should perform any machine-specific adjustment in
the address of the trampoline. Its argument contains the address of the
memory block that was passed to @code{TARGET_TRAMPOLINE_INIT}. In case
the address to be used for a function call should be different from the
address at which the template was stored, the different address should
be returned; otherwise @var{addr} should be returned unchanged.
If this hook is not defined, @var{addr} will be used for function calls.
@end deftypefn
1996-09-25 01:21:45 +02:00
Implementing trampolines is difficult on many machines because they have
separate instruction and data caches. Writing into a stack location
fails to clear the memory in the instruction cache, so when the program
jumps to that location, it executes the old contents.
Here are two possible solutions. One is to clear the relevant parts of
the instruction cache whenever a trampoline is set up. The other is to
make all trampolines identical, by having them jump to a standard
subroutine. The former technique makes trampoline execution faster; the
latter makes initialization faster.
To clear the instruction cache when a trampoline is initialized, define
uwin.h: Remove SUBTARGET_PROLOGUE. * config/i386/uwin.h: Remove SUBTARGET_PROLOGUE. * config/i386/i386.c (ix86_expand_prologue): Do not use SUBTARGET_PROLOGUE. * system.h: Poision SUBTARGET_PROLOGUE. * config/arm/arm-protos.h: Remove unused rdate_section prototype. * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP dependend code. * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP. * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed. (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM. (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL. (dbxout_block): Remove usage of DBX_OUTPUT_CATCH. (dbxout_block): Remove usage of DBX_LBRAC_FIRST. (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME. (dbxout_init): Remove test for DBX_WORKING_DIRECTORY. * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST, DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and DBX_WORKING_DIRECTORY. * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM, DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY. * config/frv/frv-protos.h: Remove unused const_section declaration. * config/vax/vax-protos.h: Likewise. * output.h: Remove CONST_SECTION_ASM_OP usage. * system.h: Poison CONST_SECTION_ASM_OP. * crtstuff.c (__do_global_dtors_aux): Remove usage of CRT_GET_RFIB_TEXT (frame_dummy): Likewise. * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. * system.h: Poison CRT_GET_RFIB_TEXT. From-SVN: r67423
2003-06-04 07:21:41 +02:00
the following macro.
1996-09-25 01:21:45 +02:00
@defmac CLEAR_INSN_CACHE (@var{beg}, @var{end})
1996-09-25 01:21:45 +02:00
If defined, expands to a C expression clearing the @emph{instruction
uwin.h: Remove SUBTARGET_PROLOGUE. * config/i386/uwin.h: Remove SUBTARGET_PROLOGUE. * config/i386/i386.c (ix86_expand_prologue): Do not use SUBTARGET_PROLOGUE. * system.h: Poision SUBTARGET_PROLOGUE. * config/arm/arm-protos.h: Remove unused rdate_section prototype. * output.h: Remove TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP dependend code. * system.h: Poison TDESC_SECTION_ASM_OP and RDATA_SECTION_ASM_OP. * system.h: Poison INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * libgcc2.c (INSN_CACHE_PLANE_SIZE): Removed. (__clear_cache): Remove code dependend on INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * doc/tm.texi (Trampolines): Remove INSN_CACHE_DEPTH, INSN_CACHE_SIZE and INSN_CACHE_LINE_WIDTH. * dbxout.c (dbxout_type): Remove usage of DBX_OUTPUT_ENUM. (dbxout_symbol): Remove usage of DBX_OUTPUT_CONSTANT_SYMBOL. (dbxout_block): Remove usage of DBX_OUTPUT_CATCH. (dbxout_block): Remove usage of DBX_LBRAC_FIRST. (dbxout_source_file): Remove usage of DBX_OUTPUT_SOURCE_FILENAME. (dbxout_init): Remove test for DBX_WORKING_DIRECTORY. * doc/tm.texi (DBX Options): Do not document DBX_LBRAC_FIRST, DBX_OUTPUT_SOURCE_FILENAME and DBX_OUTPUT_ENUM and DBX_WORKING_DIRECTORY. * system.h: Poison DBX_LBRAC_FIRST, DBX_OUTPUT_ENUM, DBX_OUTPUT_SOURCE_FILENAME and DBX_WORKING_DIRECTORY. * config/frv/frv-protos.h: Remove unused const_section declaration. * config/vax/vax-protos.h: Likewise. * output.h: Remove CONST_SECTION_ASM_OP usage. * system.h: Poison CONST_SECTION_ASM_OP. * crtstuff.c (__do_global_dtors_aux): Remove usage of CRT_GET_RFIB_TEXT (frame_dummy): Likewise. * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Likewise. * system.h: Poison CRT_GET_RFIB_TEXT. From-SVN: r67423
2003-06-04 07:21:41 +02:00
cache} in the specified interval. The definition of this macro would
typically be a series of @code{asm} statements. Both @var{beg} and
@var{end} are both pointer expressions.
@end defmac
1996-09-25 01:21:45 +02:00
To use a standard subroutine, define the following macro. In addition,
you must make sure that the instructions in a trampoline fill an entire
cache line with identical instructions, or else ensure that the
beginning of the trampoline code is always aligned at the same point in
its cache line. Look in @file{m68k.h} as a guide.
@defmac TRANSFER_FROM_TRAMPOLINE
1996-09-25 01:21:45 +02:00
Define this macro if trampolines need a special subroutine to do their
work. The macro should expand to a series of @code{asm} statements
which will be compiled with GCC@. They go in a library function named
1996-09-25 01:21:45 +02:00
@code{__transfer_from_trampoline}.
If you need to avoid executing the ordinary prologue code of a compiled
C function when you jump to the subroutine, you can do so by placing a
special label of your own in the assembler code. Use one @code{asm}
statement to generate an assembler label, and another to make the label
global. Then trampolines can use that label to jump directly to your
special assembler code.
@end defmac
1996-09-25 01:21:45 +02:00
@node Library Calls
@section Implicit Calls to Library Routines
@cindex library subroutine names
@cindex @file{libgcc.a}
@c prevent bad page break with this line
Here is an explanation of implicit calls to library routines.
@defmac DECLARE_LIBRARY_RENAMES
This macro, if defined, should expand to a piece of C code that will get
expanded when compiling functions for libgcc.a. It can be used to
provide alternate names for GCC's internal library functions if there
are ABI-mandated names that the compiler should provide.
@end defmac
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
@findex set_optab_libfunc
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@findex init_one_libfunc
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
@deftypefn {Target Hook} void TARGET_INIT_LIBFUNCS (void)
This hook should declare additional library routines or rename
existing ones, using the functions @code{set_optab_libfunc} and
@code{init_one_libfunc} defined in @file{optabs.c}.
@code{init_optabs} calls this macro after initializing all the normal
library routines.
1996-09-25 01:21:45 +02:00
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
The default is to do nothing. Most ports don't need to define this hook.
@end deftypefn
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
@deftypevr {Target Hook} bool TARGET_LIBFUNC_GNU_PREFIX
If false (the default), internal library routines start with two
underscores. If set to true, these routines start with @code{__gnu_}
instead. E.g., @code{__muldi3} changes to @code{__gnu_muldi3}. This
currently only affects functions defined in @file{libgcc2.c}. If this
is set to true, the @file{tm.h} file must also
@code{#define LIBGCC2_GNU_PREFIX}.
@end deftypevr
@defmac FLOAT_LIB_COMPARE_RETURNS_BOOL (@var{mode}, @var{comparison})
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
This macro should return @code{true} if the library routine that
implements the floating point comparison operator @var{comparison} in
mode @var{mode} will return a boolean, and @var{false} if it will
return a tristate.
GCC's own floating point libraries return tristates from the
comparison operators, so the default returns false always. Most ports
don't need to define this macro.
@end defmac
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
@defmac TARGET_LIB_INT_CMP_BIASED
This macro should evaluate to @code{true} if the integer comparison
functions (like @code{__cmpdi2}) return 0 to indicate that the first
operand is smaller than the second, 1 to indicate that they are equal,
and 2 to indicate that the first operand is greater than the second.
If this macro evaluates to @code{false} the comparison functions return
@minus{}1, 0, and 1 instead of 0, 1, and 2. If the target uses the routines
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
in @file{libgcc.a}, you do not need to define this macro.
@end defmac
@defmac TARGET_HAS_NO_HW_DIVIDE
This macro should be defined if the target has no hardware divide
instructions. If this macro is defined, GCC will use an algorithm which
make use of simple logical and arithmetic operations for 64-bit
division. If the macro is not defined, GCC will use an algorithm which
make use of a 64-bit by 32-bit divide primitive.
@end defmac
1996-09-25 01:21:45 +02:00
@cindex @code{EDOM}, implicit usage
@findex matherr
@defmac TARGET_EDOM
1996-09-25 01:21:45 +02:00
The value of @code{EDOM} on the target machine, as a C integer constant
expression. If you don't define this macro, GCC does not attempt to
1996-09-25 01:21:45 +02:00
deposit the value of @code{EDOM} into @code{errno} directly. Look in
@file{/usr/include/errno.h} to find the value of @code{EDOM} on your
system.
If you do not define @code{TARGET_EDOM}, then compiled code reports
domain errors by calling the library function and letting it report the
error. If mathematical functions on your system use @code{matherr} when
there is an error, then you should leave @code{TARGET_EDOM} undefined so
that @code{matherr} is used normally.
@end defmac
1996-09-25 01:21:45 +02:00
@cindex @code{errno}, implicit usage
@defmac GEN_ERRNO_RTX
1996-09-25 01:21:45 +02:00
Define this macro as a C expression to create an rtl expression that
refers to the global ``variable'' @code{errno}. (On certain systems,
@code{errno} may not actually be a variable.) If you don't define this
macro, a reasonable default is used.
@end defmac
1996-09-25 01:21:45 +02:00
target.def (TARGET_LIBC_HAS_FUNCTION): New target hook. * target.def (TARGET_LIBC_HAS_FUNCTION): New target hook. * builtins.c (default_libc_has_function): New. (gnu_libc_has_function): Ditto. (no_c99_libc_has_function): Ditto. (expand_builtin_cexpi): Using new target hook TARGET_LIBC_HAS_FUNCTION instead of TARGET_HAS_SINCOS and TARGET_C99_FUNCTIONS. (fold_builtin_sincos): Likewise. (fold_builtin_cexp): Likewise. * builtins.def (DEF_C94_BUILTIN): Likewise. (DEF_C99_BUILTIN): Likewise. (DEF_C99_C90RES_BUILTIN): Likewise. (DEF_C99_COMPL_BUILTIN): New define. Change all complex c99 builtin definitions to using this define. * config/darwin-protos.h (darwin_libc_has_function): New. * config/darwin.c: (darwin_libc_has_function: Ditto. * config/alpha/linux.h: Remove TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. Redefine TARGET_LIBC_HAS_FUNCTION. * config/darwin.h: Ditto. * config/elfos.h: Ditto. * config/freebsd.h: Ditto. * config/i386/cygming.h: Ditto. * config/i386/djgpp.h: Ditto. * config/i386/i386-interix.h: Ditto. * config/microblaze/microblaze.h: Ditto. * config/mmix/mmix.h: Ditto. * config/gnu-user.h: Ditto. * config/ia64/hpux.h: Ditto. * config/pa/pa-hpux.h: Ditto. * config/pdp11/pdp11.h: Ditto. * config/picochip/picochip.h: Ditto. * config/linux.h: Ditto. * config/netbsd.h: Ditto. * config/openbsd.h: Ditto. * config/rs6000/aix43.h: Ditto. * config/rs6000/aix51.h: Ditto. * config/rs6000/aix52.h: Ditto. * config/rs6000/aix53.h: Ditto. * config/rs6000/aix61.h: Ditto. * config/rs6000/darwin.h: Ditto. * config/rs6000/linux.h: Ditto. * config/rs6000/linux64.h: Ditto. * config/s390/tpf.h: Ditto. * config/sol2-10.h: Ditto. * config/sol2.h: Ditto. * config/vms/vms.h: Ditto. * config/vxworks.h: Ditto. * config/linux-android.c (linux_android_libc_has_function): New linux-specific implementation of TARGET_LIBC_HAS_FUNCTION. * config/linux-protos.h (linux_android_libc_has_function): New declaration. * config/i386/i386.c (ix86_libc_has_function): New. * config/i386/i386-protos.h (ix86_libc_has_function): New declaration. * config/i386/i386.md ("isinfxf2"): Change condition for TARGET_LIBC_HAS_FUNCTION. ("isinf<mode>2): Likewise. * convert.c (convert_to_integer): Using new target hook TARGET_LIBC_HAS_FUNCTION istead of TARGET_HAS_SINCOS and TARGET_C99_FUNCTIONS. * fortran/f95-lang.c (gfc_init_builtin_functions): Ditto. * tree-ssa-math-opts.c (execute_cse_sincos): Ditto. * coretypes.h (function_class): New enum for different classes of functions. * defaults.h: Remove TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. * doc/tm.texi.in (TARGET_C99_FUNCTIONS): Remove documentation. (TARGET_HAS_SINCOS): Likewise. (TARGET_LIBC_HAS_FUNCTION): New. * doc/tm.texi: Regenerated. * targhooks.h (default_libc_has_function): New declaration. (no_c99_libc_has_function): Ditto. (gnu_libc_has_function): Ditto. * system.h: Add the poisoning of TARGET_C99_FUNCTIONS and TARGET_HAS_SINCOS. From-SVN: r201838
2013-08-19 14:21:26 +02:00
@deftypefn {Target Hook} bool TARGET_LIBC_HAS_FUNCTION (enum function_class @var{fn_class})
This hook determines whether a function from a class of functions
@var{fn_class} is present at the runtime.
@end deftypefn
@defmac NEXT_OBJC_RUNTIME
Set this macro to 1 to use the "NeXT" Objective-C message sending conventions
by default. This calling convention involves passing the object, the selector
and the method arguments all at once to the method-lookup library function.
This is the usual setting when targeting Darwin/Mac OS X systems, which have
the NeXT runtime installed.
If the macro is set to 0, the "GNU" Objective-C message sending convention
will be used by default. This convention passes just the object and the
selector to the method-lookup function, which returns a pointer to the method.
In either case, it remains possible to select code-generation for the alternate
scheme, by means of compiler command line switches.
@end defmac
1996-09-25 01:21:45 +02:00
@node Addressing Modes
@section Addressing Modes
@cindex addressing modes
@c prevent bad page break with this line
This is about addressing modes.
@defmac HAVE_PRE_INCREMENT
@defmacx HAVE_PRE_DECREMENT
@defmacx HAVE_POST_INCREMENT
@defmacx HAVE_POST_DECREMENT
A C expression that is nonzero if the machine supports pre-increment,
pre-decrement, post-increment, or post-decrement addressing respectively.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HAVE_PRE_MODIFY_DISP
@defmacx HAVE_POST_MODIFY_DISP
A C expression that is nonzero if the machine supports pre- or
post-address side-effect generation involving constants other than
the size of the memory operand.
@end defmac
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. Restoring tm.texi after corruption. From-SVN: r35713
2000-08-15 17:27:11 +02:00
@defmac HAVE_PRE_MODIFY_REG
@defmacx HAVE_POST_MODIFY_REG
A C expression that is nonzero if the machine supports pre- or
post-address side-effect generation involving a register displacement.
@end defmac
cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. * cse.c (canon_hash): Handle PRE_MODIFY/POST_MODIFY. (cse_insn): Likewise. (addr_affects_sp_p): Likewise. * expr.c (move_by_pieces): Likewise. (clear_by_pieces): Likewise. * gcse.c (oprs_unchanged_p): Likewise. * haifa-sched.c (sched_analyze_2): Likewise. * recog.c (offsettable_address_p): Likewise. * regclass.c (record_address_regs): Likewise. * reload.c (find_reusable_reload): Likewise. (push_reload): Likewise. (operands_match_p): Likewise. (decompose): Likewise. (find_reloads_address_1): Likewise. (find_inc_amount): Likewise. * reload1.c (elimination_effects): Likewise. * resource.c (mark_set_resources): Likewise. * flow.c (attempt_auto_inc): New function; mostly broken out of find_auto_inc. (find_auto_inc): Split into two functions and enhanced to generate POST_MODIFY. * rtl.def (PRE_MODIFY, POST_MODIFY): Adjust comment. * rtl.h (count_all_occurrences): Declare. (HAVE_{PRE,POST}_MODIFY_{DISP,REG}): Provide default of 0 if not defined. * rtlanal.c (count_all_occurrences): New function. * tm.texi (HAVE_POST_MODIFY_DISP, HAVE_PRE_MODIFY_DISP, HAVE_POST_MODIFY_REG, HAVE_PRE_MODIFY_REG): Document. * config/ia64/ia64-protos.h (destination_operand): Declare. * config/ia64/ia64.c (destination_operand): New function. (ia64_print_operand): Handle POST_MODIFY. (rtx_needs_barrier): Likewise. * config/ia64/ia64.h (HAVE_POST_MODIFY_DISP): Define to 1. (HAVE_POST_MODIFY_REG): Define to 1. (MAX_REGS_PER_ADDRESS): Change to 2. (GO_IF_LEGITIMATE_ADDRESS): Accept POST_MODIFY too. (LEGITIMATE_ADDRESS_REG): New helper macro. (LEGITIMATE_ADDRESS_DISP): Likewise. (PREDICATE_CODES): Add entry for destination_operand. * config/ia64/ia64.md (all mov patterns): Use destination_operand predicate for operand 0. Restoring tm.texi after corruption. From-SVN: r35713
2000-08-15 17:27:11 +02:00
@defmac CONSTANT_ADDRESS_P (@var{x})
1996-09-25 01:21:45 +02:00
A C expression that is 1 if the RTX @var{x} is a constant which
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
is a valid address. On most machines the default definition of
@code{(CONSTANT_P (@var{x}) && GET_CODE (@var{x}) != CONST_DOUBLE)}
is acceptable, but a few machines are more restrictive as to which
constant addresses are supported.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CONSTANT_P (@var{x})
@code{CONSTANT_P}, which is defined by target-independent code,
accepts integer-values expressions whose values are not explicitly
known, such as @code{symbol_ref}, @code{label_ref}, and @code{high}
expressions and @code{const} arithmetic expressions, in addition to
@code{const_int} and @code{const_double} expressions.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MAX_REGS_PER_ADDRESS
1996-09-25 01:21:45 +02:00
A number, the maximum number of registers that can appear in a valid
memory address. Note that it is up to you to specify a value equal to
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
the maximum number that @code{TARGET_LEGITIMATE_ADDRESS_P} would ever
1996-09-25 01:21:45 +02:00
accept.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_LEGITIMATE_ADDRESS_P (machine_mode @var{mode}, rtx @var{x}, bool @var{strict})
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
A function that returns whether @var{x} (an RTX) is a legitimate memory
address on the target machine for a memory operand of mode @var{mode}.
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
Legitimate addresses are defined in two variants: a strict variant and a
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
non-strict one. The @var{strict} parameter chooses which variant is
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
desired by the caller.
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
The strict variant is used in the reload pass. It must be defined so
that any pseudo-register that has not been allocated a hard register is
considered a memory reference. This is because in contexts where some
kind of register is required, a pseudo-register with no hard register
must be rejected. For non-hard registers, the strict variant should look
up the @code{reg_renumber} array; it should then proceed using the hard
register number in the array, or treat the pseudo as a memory reference
if the array holds @code{-1}.
1996-09-25 01:21:45 +02:00
The non-strict variant is used in other passes. It must be defined to
accept all pseudo-registers in every context where some kind of
register is required.
Normally, constant addresses which are the sum of a @code{symbol_ref}
and an integer are stored inside a @code{const} RTX to mark them as
constant. Therefore, there is no need to recognize such sums
specifically as legitimate addresses. Normally you would simply
recognize any @code{const} as legitimate.
Usually @code{PRINT_OPERAND_ADDRESS} is not prepared to handle constant
sums that are not marked with @code{const}. It assumes that a naked
@code{plus} indicates indexing. If so, then you @emph{must} reject such
naked constant sums as illegitimate addresses, so that none of them will
be given to @code{PRINT_OPERAND_ADDRESS}.
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
@cindex @code{TARGET_ENCODE_SECTION_INFO} and address validation
1996-09-25 01:21:45 +02:00
On some machines, whether a symbolic address is legitimate depends on
the section that the address refers to. On these machines, define the
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
target hook @code{TARGET_ENCODE_SECTION_INFO} to store the information
into the @code{symbol_ref}, and then check for it here. When you see a
1996-09-25 01:21:45 +02:00
@code{const}, you will have to look inside it to find the
@code{symbol_ref} in order to determine the section. @xref{Assembler
Format}.
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
@cindex @code{GO_IF_LEGITIMATE_ADDRESS}
Some ports are still using a deprecated legacy substitute for
this hook, the @code{GO_IF_LEGITIMATE_ADDRESS} macro. This macro
has this syntax:
@example
#define GO_IF_LEGITIMATE_ADDRESS (@var{mode}, @var{x}, @var{label})
@end example
@noindent
and should @code{goto @var{label}} if the address @var{x} is a valid
address on the target machine for a memory operand of mode @var{mode}.
@findex REG_OK_STRICT
Compiler source files that want to use the strict variant of this
macro define the macro @code{REG_OK_STRICT}. You should use an
@code{#ifdef REG_OK_STRICT} conditional to define the strict variant in
that case and the non-strict variant otherwise.
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
Using the hook is usually simpler because it limits the number of
files that are recompiled when changes are made.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac TARGET_MEM_CONSTRAINT
A single character to be used instead of the default @code{'m'}
character for general memory addresses. This defines the constraint
letter which matches the memory addresses accepted by
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
@code{TARGET_LEGITIMATE_ADDRESS_P}. Define this macro if you want to
support new address formats in your back end without changing the
semantics of the @code{'m'} constraint. This is necessary in order to
preserve functionality of inline assembly constructs using the
@code{'m'} constraint.
@end defmac
@defmac FIND_BASE_TERM (@var{x})
A C expression to determine the base term of address @var{x},
or to provide a simplified version of @var{x} from which @file{alias.c}
can easily find the base term. This macro is used in only two places:
@code{find_base_value} and @code{find_base_term} in @file{alias.c}.
It is always safe for this macro to not be defined. It exists so
that alias analysis can understand machine-dependent addresses.
The typical use of this macro is to handle addresses containing
a label_ref or symbol_ref within an UNSPEC@.
@end defmac
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_LEGITIMIZE_ADDRESS (rtx @var{x}, rtx @var{oldx}, machine_mode @var{mode})
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
This hook is given an invalid memory address @var{x} for an
operand of mode @var{mode} and should try to return a valid memory
address.
1996-09-25 01:21:45 +02:00
@findex break_out_memory_refs
@var{x} will always be the result of a call to @code{break_out_memory_refs},
and @var{oldx} will be the operand that was given to that function to produce
@var{x}.
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
The code of the hook should not alter the substructure of
1996-09-25 01:21:45 +02:00
@var{x}. If it transforms @var{x} into a more legitimate form, it
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
should return the new @var{x}.
1996-09-25 01:21:45 +02:00
It is not necessary for this hook to come up with a legitimate address,
with the exception of native TLS addresses (@pxref{Emulated TLS}).
The compiler has standard ways of doing so in all cases. In fact, if
the target supports only emulated TLS, it
tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. 2009-05-04 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (LEGITIMIZE_ADDRESS): Revise documentation. * gcc/defaults.h (LEGITIMIZE_ADDRESS): Delete. * gcc/explow.c (memory_address): Use target hook. * gcc/targhooks.c (default_legitimize_address): New. * gcc/targhooks.h (default_legitimize_address): New. * gcc/target.h (legitimize_address): New. * gcc/target-def.h (TARGET_LEGITIMIZE_ADDRESS): New. (TARGET_INITIALIZER): Include it. * gcc/system.h (LEGITIMIZE_ADDRESS): Poison. * config/bfin/bfin-protos.h (legitimize_address): Remove. * config/bfin/bfin.c (legitimize_address): Remove. * config/bfin/bfin.h (LEGITIMIZE_ADDRESS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_legitimize_address): Remove. * config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Remove. * gcc/config/arm/arm.h (LEGITIMIZE_ADDRESS, ARM_LEGITIMIZE_ADDRESS, THUMB_LEGITIMIZE_ADDRESS, THUMB2_LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32c/m32c.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sparc/sparc.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m32r/m32r.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/i386/i386.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/sh/sh.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/avr/avr.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68hc11/m68hc11.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/iq2000/iq2000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mn10300/mn10300.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/m68k/m68k.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/score/score.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/pa/pa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/mips/mips.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/alpha/alpha.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/frv/frv.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/spu/spu.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/xtensa/xtensa.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/cris/cris.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/rs6000/rs6000.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/picochip/picochip.h (LEGITIMIZE_ADDRESS): Delete. * gcc/config/s390/s390-protos.h (legitimize_address): Delete. * gcc/config/m32c/m32c-protos.h (m32c_legitimize_address): Delete. * gcc/config/sparc/sparc-protos.h (legitimize_address): Delete. * gcc/config/i386/i386-protos.h (legitimize_address): Delete. * gcc/config/avr/avr-protos.h (legitimize_address): Delete. * gcc/config/mn10300/mn10300-protos.h (legitimize_address): Delete. * gcc/config/score/score-protos.h (score_legitimize_address): Delete. * gcc/config/arm/arm-protos.h (arm_legitimize_address, (thumb_legitimize_address): Delete. * gcc/config/pa/pa-protos.h (hppa_legitimize_address): Delete. * gcc/config/mips/mips-protos.h (mips_legitimize_address): Delete. * gcc/config/alpha/alpha-protos.h (alpha_legitimize_address): Delete. * gcc/config/frv/frv-protos.h (frv_legitimize_address): Delete. * gcc/config/spu/spu-protos.h (spu_legitimize_address): Delete. * gcc/config/xtensa/xtensa-protos.h (xtensa_legitimize_address): Delete. * gcc/config/rs6000/rs6000-protos.h (rs6000_legitimize_address): Delete. * config/arm/arm.c (arm_legitimize_address): Maybe call Thumb version. * config/m32c/m32c.c (m32c_legitimize_address): Standardize. * config/m32r/m32r.c (m32r_legitimize_address): New. * config/m68k/m68k.c (m68k_legitimize_address): New. * config/score/score.c (score_legitimize_address): Standardize. * config/score/score3.c (score3_legitimize_address): Standardize. * config/score/score3.h (score3_legitimize_address): Adjust. * config/score/score7.c (score7_legitimize_address): Standardize. * config/score/score7.h (score7_legitimize_address): Adjust. * config/sh/sh.c (sh_legitimize_address): New. * config/iq2000/iq2000.c (iq2000_legitimize_address): New. * gcc/config/s390/s390.c (legitimize_address): Rename to... (s390_legitimize_address): ... this. * gcc/config/sparc/sparc.c (legitimize_address): Rename to... (sparc_legitimize_address): ... this. * gcc/config/i386/i386.c (legitimize_address): Rename to... (ix86_legitimize_address): ... this. * gcc/config/avr/avr.c (legitimize_address): Rename to... (avr_legitimize_address): ... this. * gcc/config/mn10300/mn10300.c (legitimize_address): Rename to... (mn10300_legitimize_address): ... this. * config/alpha/alpha.c (alpha_legitimize_address): Wrap... (alpha_legitimize_address_1): ... the old alpha_legitimize_address. (alpha_expand_mov): Adjust call. * config/frv/frv.c (frv_legitimize_address): Return x on failure. * config/spu/spu.c (spu_legitimize_address): Likewise. * config/xtensa/xtensa.c (xtensa_legitimize_address): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address): Likewise. From-SVN: r147098
2009-05-04 14:52:41 +02:00
is safe to omit this hook or make it return @var{x} if it cannot find
a valid way to legitimize the address. But often a machine-dependent
strategy can generate better code.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac LEGITIMIZE_RELOAD_ADDRESS (@var{x}, @var{mode}, @var{opnum}, @var{type}, @var{ind_levels}, @var{win})
A C compound statement that attempts to replace @var{x}, which is an address
that needs reloading, with a valid memory address for an operand of mode
@var{mode}. @var{win} will be a C statement label elsewhere in the code.
It is not necessary to define this macro, but it might be useful for
performance reasons.
For example, on the i386, it is sometimes possible to use a single
reload register instead of two by reloading a sum of two pseudo
registers into a register. On the other hand, for number of RISC
processors offsets are limited so that often an intermediate address
needs to be generated in order to address a stack slot. By defining
@code{LEGITIMIZE_RELOAD_ADDRESS} appropriately, the intermediate addresses
generated for adjacent some stack slots can be made identical, and thus
be shared.
@emph{Note}: This macro should be used with caution. It is necessary
to know something of how reload works in order to effectively use this,
and it is quite easy to produce macros that build in too much knowledge
of reload internals.
@emph{Note}: This macro must be able to reload an address created by a
previous invocation of this macro. If it fails to handle such addresses
then the compiler may generate incorrect code or abort.
@findex push_reload
The macro definition should use @code{push_reload} to indicate parts that
need reloading; @var{opnum}, @var{type} and @var{ind_levels} are usually
suitable to be passed unaltered to @code{push_reload}.
The code generated by this macro must not alter the substructure of
@var{x}. If it transforms @var{x} into a more legitimate form, it
should assign @var{x} (which will always be a C variable) a new value.
This also applies to parts that you change indirectly by calling
@code{push_reload}.
@findex strict_memory_address_p
The macro definition may use @code{strict_memory_address_p} to test if
the address has become legitimate.
@findex copy_rtx
If you want to change only a part of @var{x}, one standard way of doing
this is to use @code{copy_rtx}. Note, however, that it unshares only a
single level of rtl. Thus, if the part to be changed is not at the
top level, you'll need to replace first the top level.
It is not necessary for this macro to come up with a legitimate
address; but often a machine-dependent strategy can generate better code.
@end defmac
re PR middle-end/54635 (Add addr_space_t argument to TARGET_MODE_DEPENDENT_ADDRESS_P) PR middle-end/54635 * doc/tm.texi.in (TARGET_MODE_DEPENDENT_ADDRESS_P): Document new parameter addrspace. * doc/tm.texi: Regenerate. * target.def (mode_dependent_address_p): Add addr_space_t parameter. * targhooks.h (default_mode_dependent_address_p): Ditto. * targhooks.c (default_mode_dependent_address_p): Ditto. * expr.c (convert_move): Pass address space to mode_dependent_address_p. * combine.c (combine_simplify_rtx): Ditto. (make_extraction): Ditto. (simplify_shift_const_1): Ditto. (gen_lowpart_for_combine): Ditto. * lower-subreg.c (simple_move_operand): Ditto. * recog.c (simplify_while_replacing): Ditto. (offsettable_address_addr_space_p): Ditto. (mode_dependent_address_p): Ditto. * simplify-rtx.c (simplify_unary_operation_1): Ditto. (simplify_subreg): Ditto. * config/m68k/m68k.md: Ditto. * config/vax/vax.md: Ditto. * config/vax/constraints.md (Q): Ditto. * config/vax/predicates.md (indexed_memory_operand): Ditto. * config/alpha/alpha.c (alpha_mode_dependent_address_p): Add unused addr_space_t parameter. * config/avr/avr.c (avr_mode_dependent_address_p): Ditto. * config/h8300/h8300.c (h8300_mode_dependent_address_p): Ditto. * config/m32r/m32r.c (m32r_mode_dependent_address_p): Ditto. * config/rs6000/rs6000.c (rs6000_mode_dependent_address_p): Ditto. * config/rx/rx.c (rx_mode_dependent_address_p): Ditto. * config/sparc/sparc.c (sparc_mode_dependent_address_p): Ditto. * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): Ditto. * config/vax/vax.c (vax_mode_dependent_address_p): Ditto. * config/xtensa/xtensa.c (xtensa_mode_dependent_address_p): Ditto. From-SVN: r191761
2012-09-26 15:46:29 +02:00
@deftypefn {Target Hook} bool TARGET_MODE_DEPENDENT_ADDRESS_P (const_rtx @var{addr}, addr_space_t @var{addrspace})
This hook returns @code{true} if memory address @var{addr} in address
space @var{addrspace} can have
different meanings depending on the machine mode of the memory
reference it is used for or if the address is valid for some modes
but not others.
Autoincrement and autodecrement addresses typically have mode-dependent
effects because the amount of the increment or decrement is the size
of the operand being addressed. Some machines have other mode-dependent
addresses. Many RISC machines have no mode-dependent addresses.
You may assume that @var{addr} is a valid address for the machine.
The default version of this hook returns @code{false}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_LEGITIMATE_CONSTANT_P (machine_mode @var{mode}, rtx @var{x})
target.def (legitimate_constant_p): New hook. gcc/ * target.def (legitimate_constant_p): New hook. * doc/tm.texi.in (LEGITIMATE_CONSTANT_P): Replace with... (TARGET_LEGITIMATE_CONSTANT_P): ...this. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_true): Declare. * hooks.c (hook_bool_mode_rtx_true): Define. * system.h (LEGITIMATE_CONSTANT_P): Poison. * calls.c (precompute_register_parameters): Replace uses of LEGITIMATE_CONSTANT_P with targetm.legitimate_constant_p. (emit_library_call_value_1): Likewise. * expr.c (move_block_to_reg, can_store_by_pieces, emit_move_insn) (compress_float_constant, emit_push_insn, expand_expr_real_1): Likewise. * ira-costs.c (scan_one_insn): Likewise. * recog.c (general_operand, immediate_operand): Likewise. * reload.c (find_reloads_toplev, find_reloads_address_part): Likewise. * reload1.c (init_eliminable_invariants): Likewise. * config/alpha/alpha-protos.h (alpha_legitimate_constant_p): Add a mode argument. * config/alpha/alpha.h (LEGITIMATE_CONSTANT_P): Delete. * config/alpha/alpha.c (alpha_legitimate_constant_p): Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/alpha/predicates.md (input_operand): Update call to alpha_legitimate_constant_p. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Delete. * config/arm/arm.h (ARM_LEGITIMATE_CONSTANT_P): Likewise. (THUMB_LEGITIMATE_CONSTANT_P, LEGITIMATE_CONSTANT_P): Likewise. * config/arm/arm.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (arm_legitimate_constant_p_1, thumb_legitimate_constant_p) (arm_legitimate_constant_p): New functions. (arm_cannot_force_const_mem): Make static. * config/avr/avr.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_constant_p): Delete. * config/bfin/bfin.h (LEGITIMATE_CONSTANT_P): Delete. * config/bfin/bfin.c (expand_move): Use targetm.legitimate_constant_p instead of bfin_legitimate_constant_p. (bfin_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/cris/cris.h (LEGITIMATE_CONSTANT_P): Delete. * config/fr30/fr30.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_constant_p): Delete. * config/frv/frv.h (LEGITIMATE_CONSTANT_P): Delete. * config/frv/frv.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (frv_legitimate_constant_p): Make static. Add a mode argument. * config/h8300/h8300-protos.h (h8300_legitimate_constant_p): Delete. * config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/h8300/h8300.c (h8300_legitimate_constant_p): Likewise. * config/i386/i386-protos.h (legitimate_constant_p): Delete. * config/i386/i386.h (LEGITIMATE_CONSTANT_P): Likewise. * config/i386/i386.c (legitimate_constant_p): Rename to... (ix86_legitimate_constant_p): ...this. Make static. Add a mode argument. (ix86_cannot_force_const_mem): Update accordingly. (ix86_legitimate_address_p): Likewise. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/i386/i386.md: Update commentary. * config/ia64/ia64-protos.h (ia64_legitimate_constant_p): Delete. * config/ia64/ia64.h (LEGITIMATE_CONSTANT_P): Likewise. * config/ia64/ia64.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (ia64_legitimate_constant_p): Make static. Add a mode argument. * config/iq2000/iq2000.h (LEGITIMATE_CONSTANT_P): Delete. * config/lm32/lm32-protos.h (lm32_legitimate_constant_p): Delete. * config/lm32/lm32.h (LEGITIMATE_CONSTANT_P): Likewise. * config/lm32/lm32.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (lm32_legitimate_constant_p): Make static. Add a mode argument. * config/m32c/m32c-protos.h (m32c_legitimate_constant_p): Delete. * config/m32c/m32c.h (LEGITIMATE_CONSTANT_P): Likewise. * config/m32c/m32c.c (m32c_legitimate_constant_p): Likewise. * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Delete. * config/m32r/m32r.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (m32r_legitimate_constant_p): New function. * config/m68k/m68k-protos.h (m68k_legitimate_constant_p): Declare. * config/m68k/m68k.h (CONSTANT_ADDRESS_P): Call it instead of LEGITIMATE_CONSTANT_P. (LEGITIMATE_CONSTANT_P): Delete. * config/m68k/m68k.c (m68k_expand_prologue): Call m68k_legitimate_constant_p instead of LEGITIMATE_CONSTANT_P. (m68k_legitimate_constant_p): New function. * config/m68k/m68k.md: Update comments. * config/mcore/mcore.h (LEGITIMATE_CONSTANT_P): Delete. * config/mcore/mcore.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mcore_legitimate_constant_p): New function. * config/mep/mep-protos.h (mep_legitimate_constant_p): Delete. * config/mep/mep.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mep/mep.c (mep_legitimate_constant_p): Make static. Add a mode argument. (mep_legitimate_address): Update accordingly. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/microblaze/microblaze-protos.h (microblaze_const_double_ok): Delete. * config/microblaze/microblaze.h (LEGITIMATE_CONSTANT_P): Likewise. * config/microblaze/microblaze.c (microblaze_const_double_ok): Make static. Check OP's mode for VOIDmode. (microblaze_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/mips.h (LEGITIMATE_CONSTANT_P): Delete. * config/mips/mips.c (mips_legitimate_constant_p): New function. (mips_cannot_force_const_mem): Use it instead of LEGITIMATE_CONSTANT_P. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/mips/predicates.md: Update comments. * config/mmix/mmix-protos.h (mmix_legitimate_constant_p): Delete. * config/mmix/mmix.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mmix/mmix.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (mmix_legitimate_constant_p): Make static, return a bool, and take a mode argument. (mmix_print_operand_address): Update accordingly. * config/mn10300/mn10300-protos.h (mn10300_legitimate_constant_p): Delete. * config/mn10300/mn10300.h (LEGITIMATE_CONSTANT_P): Likewise. * config/mn10300/mn10300.c (mn10300_legitimate_constant_p): Make static. Add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/moxie/moxie.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.h (LEGITIMATE_CONSTANT_P): Delete. * config/pa/pa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pa_legitimate_constant_p): New function. * config/picochip/picochip.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.h (LEGITIMATE_CONSTANT_P): Delete. * config/pdp11/pdp11.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (pdp11_legitimate_constant_p): New function. * config/rs6000/rs6000.h (LEGITIMATE_CONSTANT_P): Delete. * config/rs6000/rs6000.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (rs6000_legitimate_constant_p): New function. * config/rx/rx-protos.h (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. * config/rx/rx.h (LEGITIMATE_CONSTANT_P): Delete. * config/rx/rx.c (rx_is_legitimate_constant): Replace with... (rx_legitimate_constant_p): ...this. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/rx/rx.md (mov<register_modes:mode>): Update accordingly. * config/s390/s390-protos.h (legitimate_constant_p): Delete. * config/s390/s390.h (LEGITIMATE_CONSTANT_P): Likewise. * config/s390/s390.c (legitimate_constant_p): Rename to... (s390_legitimate_constant_p): ...this. Make static, return a bool, and add a mode argument. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/score/score.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.h (LEGITIMATE_CONSTANT_P): Delete. * config/sh/sh.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (sh_legitimate_constant_p): New function. * config/sparc/sparc-protos.h (legitimate_constant_p): Delete. * config/sparc/sparc.h (LEGITIMATE_CONSTANT_P): Delete. * config/sparc/sparc.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (legitimate_constant_p): Rename to... (sparc_legitimate_constant_p): ...this. Make static. Add a mode argument. (constant_address_p): Update accordingly. * config/spu/spu-protos.h (spu_legitimate_constant_p): Add a mode argument and return a bool. * config/spu/spu.h (LEGITIMATE_CONSTANT_P): Delete. * config/spu/spu.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (spu_legitimate_constant_p): Add a mode argument and return a bool. (spu_rtx_costs): Update accordingly. * config/spu/predicates.md (vec_imm_operand): Likewise. * config/stormy16/stormy16.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.h (LEGITIMATE_CONSTANT_P): Delete. * config/v850/v850.c (v850_legitimate_constant_p): New function. (TARGET_LEGITIMATE_CONSTANT_P): Define. * config/vax/vax-protos.h (legitimate_constant_p): Delete. * config/vax/vax.h (LEGITIMATE_CONSTANT_P): Likewise. * config/vax/vax.c (legitimate_constant_p): Likewise. * config/xtensa/xtensa.h (LEGITIMATE_CONSTANT_P): Delete. * config/xtensa/xtensa.c (TARGET_LEGITIMATE_CONSTANT_P): Define. (xtensa_legitimate_constant_p): New function. From-SVN: r172814
2011-04-21 11:38:43 +02:00
This hook returns true if @var{x} is a legitimate constant for a
@var{mode}-mode immediate operand on the target machine. You can assume that
@var{x} satisfies @code{CONSTANT_P}, so you need not check this.
The default definition returns true.
@end deftypefn
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} rtx TARGET_DELEGITIMIZE_ADDRESS (rtx @var{x})
This hook is used to undo the possibly obfuscating effects of the
@code{LEGITIMIZE_ADDRESS} and @code{LEGITIMIZE_RELOAD_ADDRESS} target
macros. Some backend implementations of these macros wrap symbol
references inside an @code{UNSPEC} rtx to represent PIC or similar
addressing modes. This target hook allows GCC's optimizers to understand
the semantics of these opaque @code{UNSPEC}s by converting them back
into their original form.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CONST_NOT_OK_FOR_DEBUG_P (rtx @var{x})
This hook should return true if @var{x} should not be emitted into
debug sections.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_CANNOT_FORCE_CONST_MEM (machine_mode @var{mode}, rtx @var{x})
This hook should return true if @var{x} is of a form that cannot (or
target.def (cannot_force_const_mem): Add a mode argument. gcc/ * target.def (cannot_force_const_mem): Add a mode argument. * doc/tm.texi.in (TARGET_CANNOT_FORCE_CONST_MEM): Update accordingly. * doc/tm.texi: Regenerate. * hooks.h (hook_bool_mode_rtx_false): Declare. * hooks.c (hook_bool_mode_const_rtx_false): Fix commentary. (hook_bool_mode_const_rtx_true): Likewise. (hook_bool_mode_rtx_false): New function. * reload.c (CONST_POOL_OK_P): Take a mode argument and require it to be non-VOID. Update call to cannot_force_const_mem. (find_reloads): Update accordingly. * varasm.c (force_const_mem): Update call to cannot_force_const_mem. * config/alpha/alpha.c (alpha_cannot_force_const_mem): Add a mode argument. * config/arm/arm-protos.h (arm_cannot_force_const_mem): Likewise. * config/arm/arm.h (LEGITIMATE_CONSTANT_P): Update call. * config/arm/arm.c (arm_cannot_force_const_mem): Add a mode argument. * config/bfin/bfin.c (bfin_cannot_force_const_mem): Likewise. * config/frv/frv.c (frv_cannot_force_const_mem): Likewise. * config/i386/i386.c (ix86_cannot_force_const_mem): Likewise. * config/ia64/ia64.c (ia64_cannot_force_const_mem): Likewise. * config/m68k/m68k.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine to... (m68k_cannot_force_const_mem): ...this new function. * config/mips/mips.c (mips_cannot_force_const_mem): Add a mode argument. (mips_const_insns, mips_legitimize_const_move): Update calls. (mips_secondary_reload_class): Likewise. * config/pa/pa.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine to... (pa_cannot_force_const_mem): ...this new function. * config/rs6000/rs6000.c (TARGET_CANNOT_FORCE_CONST_MEM): Reefine to... (rs6000_cannot_force_const_mem): ...this new function. * config/s390/s390.c (s390_cannot_force_const_mem): Add a mode argument. * config/sparc/sparc.c (sparc_cannot_force_const_mem): Likewise. * config/xtensa/xtensa.c (TARGET_CANNOT_FORCE_CONST_MEM): Redefine to... (xtensa_cannot_force_const_mem): ...this new function. From-SVN: r172813
2011-04-21 11:37:44 +02:00
should not) be spilled to the constant pool. @var{mode} is the mode
of @var{x}.
The default version of this hook returns false.
The primary reason to define this hook is to prevent reload from
deciding that a non-legitimate constant would be better reloaded
from the constant pool instead of spilling and reloading a register
holding the constant. This restriction is often true of addresses
of TLS symbols for various targets.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_USE_BLOCKS_FOR_CONSTANT_P (machine_mode @var{mode}, const_rtx @var{x})
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
This hook should return true if pool entries for constant @var{x} can
be placed in an @code{object_block} structure. @var{mode} is the mode
of @var{x}.
The default version returns false for all constants.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_USE_BLOCKS_FOR_DECL_P (const_tree @var{decl})
This hook should return true if pool entries for @var{decl} should
be placed in an @code{object_block} structure.
The default version returns true for all decls.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_BUILTIN_RECIPROCAL (unsigned @var{fn}, bool @var{md_fn}, bool @var{sqrt})
re PR middle-end/31723 (Use reciprocal and reciprocal square root with -ffast-math) PR middle-end/31723 * hooks.c (hook_tree_tree_bool_null): New hook. * hooks.h (hook_tree_tree_bool_null): Add prototype. * tree-pass.h (pass_convert_to_rsqrt): Declare. * passes.c (init_optimization_passes): Add pass_convert_to_rsqrt. * tree-ssa-math-opts.c (execute_cse_reciprocals): Scan for a/func(b) and convert it to reciprocal a*rfunc(b). (execute_convert_to_rsqrt): New function. (gate_convert_to_rsqrt): New function. (pass_convert_to_rsqrt): New pass definition. * target.h (struct gcc_target): Add builtin_reciprocal. * target-def.h (TARGET_BUILTIN_RECIPROCAL): New define. (TARGET_INITIALIZER): Initialize builtin_reciprocal with TARGET_BUILTIN_RECIPROCAL. * doc/tm.texi (TARGET_BUILTIN_RECIPROCAL): Document. * config/i386/i386.h (TARGET_RECIP): New define. * config/i386/i386.md (divsf3): Expand by calling ix86_emit_swdivsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (*rcpsf2_sse): New insn pattern. (*rsqrtsf2_sse): Ditto. (rsqrtsf2): New expander. Expand by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (sqrt<mode>2): Expand SFmode operands by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. * config/i386/sse.md (divv4sf): Expand by calling ix86_emit_swdivsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (*sse_rsqrtv4sf2): Do not export. (sqrtv4sf2): Ditto. (sse_rsqrtv4sf2): New expander. Expand by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (sqrtv4sf2): Ditto. * config/i386/i386.opt (mrecip): New option. * config/i386/i386-protos.h (ix86_emit_swdivsf): Declare. (ix86_emit_swsqrtsf): Ditto. * config/i386/i386.c (IX86_BUILTIN_RSQRTF): New constant. (ix86_init_mmx_sse_builtins): __builtin_ia32_rsqrtf: New builtin definition. (ix86_expand_builtin): Expand IX86_BUILTIN_RSQRTF using ix86_expand_unop1_builtin. (ix86_emit_swdivsf): New function. (ix86_emit_swsqrtsf): Ditto. (ix86_builtin_reciprocal): New function. (TARGET_BUILTIN_RECIPROCAL): Use it. (ix86_vectorize_builtin_conversion): Rename from ix86_builtin_conversion. (TARGET_VECTORIZE_BUILTIN_CONVERSION): Use renamed function. * doc/invoke.texi (Machine Dependent Options): Add -mrecip to "i386 and x86_64 Options" section. (Intel 386 and AMD x86_64 Options): Document -mrecip. testsuite/ChangeLog: PR middle-end/31723 * gcc.target/i386/recip-divf.c: New test. * gcc.target/i386/recip-sqrtf.c: Ditto. * gcc.target/i386/recip-vec-divf.c: Ditto. * gcc.target/i386/recip-vec-sqrtf.c: Ditto. * gcc.target/i386/sse-recip.c: Ditto. From-SVN: r125756
2007-06-16 11:52:48 +02:00
This hook should return the DECL of a function that implements reciprocal of
the builtin function with builtin function code @var{fn}, or
@code{NULL_TREE} if such a function is not available. @var{md_fn} is true
when @var{fn} is a code of a machine-dependent builtin function. When
@var{sqrt} is true, additional optimizations that apply only to the reciprocal
of a square root function are performed, and only reciprocals of @code{sqrt}
function are valid.
re PR middle-end/31723 (Use reciprocal and reciprocal square root with -ffast-math) PR middle-end/31723 * hooks.c (hook_tree_tree_bool_null): New hook. * hooks.h (hook_tree_tree_bool_null): Add prototype. * tree-pass.h (pass_convert_to_rsqrt): Declare. * passes.c (init_optimization_passes): Add pass_convert_to_rsqrt. * tree-ssa-math-opts.c (execute_cse_reciprocals): Scan for a/func(b) and convert it to reciprocal a*rfunc(b). (execute_convert_to_rsqrt): New function. (gate_convert_to_rsqrt): New function. (pass_convert_to_rsqrt): New pass definition. * target.h (struct gcc_target): Add builtin_reciprocal. * target-def.h (TARGET_BUILTIN_RECIPROCAL): New define. (TARGET_INITIALIZER): Initialize builtin_reciprocal with TARGET_BUILTIN_RECIPROCAL. * doc/tm.texi (TARGET_BUILTIN_RECIPROCAL): Document. * config/i386/i386.h (TARGET_RECIP): New define. * config/i386/i386.md (divsf3): Expand by calling ix86_emit_swdivsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (*rcpsf2_sse): New insn pattern. (*rsqrtsf2_sse): Ditto. (rsqrtsf2): New expander. Expand by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (sqrt<mode>2): Expand SFmode operands by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. * config/i386/sse.md (divv4sf): Expand by calling ix86_emit_swdivsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (*sse_rsqrtv4sf2): Do not export. (sqrtv4sf2): Ditto. (sse_rsqrtv4sf2): New expander. Expand by calling ix86_emit_swsqrtsf for TARGET_SSE_MATH and TARGET_RECIP when flag_unsafe_math_optimizations is set and not optimizing for size. (sqrtv4sf2): Ditto. * config/i386/i386.opt (mrecip): New option. * config/i386/i386-protos.h (ix86_emit_swdivsf): Declare. (ix86_emit_swsqrtsf): Ditto. * config/i386/i386.c (IX86_BUILTIN_RSQRTF): New constant. (ix86_init_mmx_sse_builtins): __builtin_ia32_rsqrtf: New builtin definition. (ix86_expand_builtin): Expand IX86_BUILTIN_RSQRTF using ix86_expand_unop1_builtin. (ix86_emit_swdivsf): New function. (ix86_emit_swsqrtsf): Ditto. (ix86_builtin_reciprocal): New function. (TARGET_BUILTIN_RECIPROCAL): Use it. (ix86_vectorize_builtin_conversion): Rename from ix86_builtin_conversion. (TARGET_VECTORIZE_BUILTIN_CONVERSION): Use renamed function. * doc/invoke.texi (Machine Dependent Options): Add -mrecip to "i386 and x86_64 Options" section. (Intel 386 and AMD x86_64 Options): Document -mrecip. testsuite/ChangeLog: PR middle-end/31723 * gcc.target/i386/recip-divf.c: New test. * gcc.target/i386/recip-sqrtf.c: Ditto. * gcc.target/i386/recip-vec-divf.c: Ditto. * gcc.target/i386/recip-vec-sqrtf.c: Ditto. * gcc.target/i386/sse-recip.c: Ditto. From-SVN: r125756
2007-06-16 11:52:48 +02:00
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD (void)
This hook should return the DECL of a function @var{f} that given an
address @var{addr} as an argument returns a mask @var{m} that can be
used to extract from two vectors the relevant data that resides in
@var{addr} in case @var{addr} is not properly aligned.
The autovectorizer, when vectorizing a load operation from an address
@var{addr} that may be unaligned, will generate two vector loads from
the two aligned addresses around @var{addr}. It then generates a
@code{REALIGN_LOAD} operation to extract the relevant data from the
two loaded vectors. The first two arguments to @code{REALIGN_LOAD},
@var{v1} and @var{v2}, are the two vectors, each of size @var{VS}, and
the third argument, @var{OFF}, defines how the data will be extracted
from these two vectors: if @var{OFF} is 0, then the returned vector is
@var{v2}; otherwise, the returned vector is composed from the last
@var{VS}-@var{OFF} elements of @var{v1} concatenated to the first
@var{OFF} elements of @var{v2}.
If this hook is defined, the autovectorizer will generate a call
to @var{f} (using the DECL tree that this hook returns) and will
use the return value of @var{f} as the argument @var{OFF} to
@code{REALIGN_LOAD}. Therefore, the mask @var{m} returned by @var{f}
should comply with the semantics expected by @code{REALIGN_LOAD}
described above.
If this hook is not defined, then @var{addr} will be used as
the argument @var{OFF} to @code{REALIGN_LOAD}, in which case the low
log2(@var{VS}) @minus{} 1 bits of @var{addr} will be considered.
@end deftypefn
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
@deftypefn {Target Hook} int TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST (enum vect_cost_for_stmt @var{type_of_cost}, tree @var{vectype}, int @var{misalign})
Returns cost of different scalar or vector statements for vectorization cost model.
For vector memory operations the cost may depend on type (@var{vectype}) and
tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST): Document new arguments. * doc/tm.texi: Regenerate. * targhooks.c (default_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * targhooks.h (default_builtin_vectorization_cost): Add new arguments. * target.def (builtin_vectorization_cost): Add new arguments. * target.h (enum vect_cost_for_stmt): Add unaligned_store. * tree-vect-loop-manip.c (vect_gen_niters_for_prolog_loop): Take number of iterations of prolog loop directly from LOOP_PEELING_FOR_ALIGNMENT. (vect_vfa_segment_size): Fix indentation. * tree-vectorizer.h (struct _vect_peel_info): New. (struct _vect_peel_extended_info): New. (struct _loop_vec_info): Add new field for peeling hash table and a macro for its access. (VECT_MAX_COST): Define. (vect_get_load_cost): Declare. (vect_get_store_cost, vect_get_known_peeling_cost, vect_get_single_scalar_iteraion_cost): Likewise. (vect_supportable_dr_alignment): Add new argument. * tree-vect-loop.c (new_loop_vec_info): Initialize peeling hash table field. (destroy_loop_vec_info): Free peeling hash table. (vect_analyze_loop_form): Update call to builtin_vectorization_cost. (vect_analyze_loop): Move vect_enhance_data_refs_alignment before vect_analyze_slp. Fix indentation. (vect_get_single_scalar_iteraion_cost): New function. (vect_get_known_peeling_cost): Likewise. (vect_estimate_min_profitable_iters): Rename byte_misalign to npeel. Call vect_get_single_scalar_iteraion_cost instead of cost_for_stmt per statement. Move outside cost calculation inside unknown peeling case. Call vect_get_known_peeling_cost for known amount of peeling. * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Add data reference to the print message of forced alignment. (vect_verify_datarefs_alignment): Update call to vect_supportable_dr_alignment. (vect_get_data_access_cost): New function. (vect_peeling_hash, vect_peeling_hash_eq, vect_peeling_hash_insert, vect_peeling_hash_get_most_frequent, vect_peeling_hash_get_lowest_cost, vect_peeling_hash_choose_best_peeling): Likewise. (vect_enhance_data_refs_alignment): Fix documentation. Use hash table to store all the accesses in the loop and find best possible access to align using peeling for known alignment case. For unknown alignment check if stores are preferred or if peeling is worthy. (vect_find_same_alignment_drs): Analyze pairs of loads too. (vect_supportable_dr_alignment): Add new argument and check aligned accesses according to it. * tree-vect-stmts.c (vect_get_stmt_cost): New function. (cost_for_stmt): Call vect_get_stmt_cost. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Call vect_get_stmt_cost. Call vect_get_store_cost to calculate the cost of the statement. (vect_get_store_cost): New function. (vect_model_load_cost): Call vect_get_stmt_cost. Call vect_get_load_cost to calculate the cost of the statement. (vect_get_load_cost): New function. (vectorizable_store): Update call to vect_supportable_dr_alignment. (vectorizable_load): Likewise. * config/spu/spu.c (spu_builtin_vectorization_cost): Add new arguments. * config/i386/i386.c (ix86_builtin_vectorization_cost): Add new arguments. Handle unaligned store. * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): New. (rs6000_builtin_support_vector_misalignment): Return true for word and double word alignments for VSX. * tree-vect-slp.c (vect_build_slp_tree): Update calls to vect_supportable_dr_alignment and builtin_vectorization_cost. Co-Authored-By: Revital Eres <eres@il.ibm.com> From-SVN: r161797
2010-07-04 10:54:52 +02:00
misalignment value (@var{misalign}).
@end deftypefn
@deftypefn {Target Hook} bool TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE (const_tree @var{type}, bool @var{is_packed})
Return true if vector alignment is reachable (by peeling N iterations) for the given type.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_VECTORIZE_VEC_PERM_CONST_OK (machine_mode, const unsigned char *@var{sel})
Return true if a vector created for @code{vec_perm_const} is valid.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_CONVERSION (unsigned @var{code}, tree @var{dest_type}, tree @var{src_type})
This hook should return the DECL of a function that implements conversion of the
input vector of type @var{src_type} to type @var{dest_type}.
The value of @var{code} is one of the enumerators in @code{enum tree_code} and
specifies how the conversion is to be applied
(truncation, rounding, etc.).
If this hook is defined, the autovectorizer will use the
@code{TARGET_VECTORIZE_BUILTIN_CONVERSION} target hook when vectorizing
conversion. Otherwise, it will return @code{NULL_TREE}.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION (tree @var{fndecl}, tree @var{vec_type_out}, tree @var{vec_type_in})
This hook should return the decl of a function that implements the
vectorized variant of the builtin function with builtin function code
@var{code} or @code{NULL_TREE} if such a function is not available.
The value of @var{fndecl} is the builtin function declaration. The
return type of the vectorized function shall be of vector type
@var{vec_type_out} and the argument types should be @var{vec_type_in}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT (machine_mode @var{mode}, const_tree @var{type}, int @var{misalignment}, bool @var{is_packed})
This hook should return true if the target supports misaligned vector
store/load of a specific factor denoted in the @var{misalignment}
parameter. The vector store/load should be of machine mode @var{mode} and
the elements in the vectors should be of type @var{type}. @var{is_packed}
parameter is true if the memory access is defined in a packed struct.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_VECTORIZE_PREFERRED_SIMD_MODE (machine_mode @var{mode})
This hook should return the preferred mode for vectorizing scalar
mode @var{mode}. The default is
equal to @code{word_mode}, because the vectorizer can do some
Turn UNITS_PER_SIMD_WORD into a target hook. 2010-09-14 H.J. Lu <hongjiu.lu@intel.com> * defaults.h (UNITS_PER_SIMD_WORD): Removed. * config/arm/arm.h (UNITS_PER_SIMD_WORD): Likewise. * config/i386/i386.h (UNITS_PER_SIMD_WORD): Likewise. * config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise. * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise. * config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise. * target.def: Add units_per_simd_word to vectorize. * targhooks.c (default_units_per_simd_word): New. * targhooks.h (default_units_per_simd_word): Likewise. * config/arm/arm.c (arm_units_per_simd_word): Likewise. (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. * config/mips/mips.c (mips_units_per_simd_word): Likewise. (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. * config/rs6000/rs6000.c (rs6000_units_per_simd_word): Likewise. (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. * config/sparc/sparc.c (sparc_units_per_simd_word): Likewise. (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Likewise. * tree-vect-loop.c: Replace UNITS_PER_SIMD_WORD with TARGET_VECTORIZE_UNITS_PER_SIMD_WORD in comments. * tree-vect-stmts.c (get_vectype_for_scalar_type): Replace UNITS_PER_SIMD_WORD with targetm.vectorize.units_per_simd_word. * system.h (UNITS_PER_SIMD_WORD): Poisoned. * config/i386/i386-protos.h (ix86_units_per_simd_word): Removed. * config/i386/i386.c (ix86_units_per_simd_word): Make it static. (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): New. * doc/tm.texi.in: Remove UNITS_PER_SIMD_WORD. Add TARGET_VECTORIZE_UNITS_PER_SIMD_WORD. * doc/tm.texi: Regenerated. From-SVN: r164285
2010-09-14 19:02:10 +02:00
transformations even in absence of specialized @acronym{SIMD} hardware.
@end deftypefn
@deftypefn {Target Hook} {unsigned int} TARGET_VECTORIZE_AUTOVECTORIZE_VECTOR_SIZES (void)
This hook should return a mask of sizes that should be iterated over
after trying to autovectorize using the vector size derived from the
mode returned by @code{TARGET_VECTORIZE_PREFERRED_SIMD_MODE}.
The default is zero which means to not iterate over other vector sizes.
@end deftypefn
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
@deftypefn {Target Hook} {void *} TARGET_VECTORIZE_INIT_COST (struct loop *@var{loop_info})
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
This hook should initialize target-specific data structures in preparation for modeling the costs of vectorizing a loop or basic block. The default allocates three unsigned integers for accumulating costs for the prologue, body, and epilogue of the loop or basic block. If @var{loop_info} is non-NULL, it identifies the loop being vectorized; otherwise a single block is being vectorized.
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
@end deftypefn
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
@deftypefn {Target Hook} unsigned TARGET_VECTORIZE_ADD_STMT_COST (void *@var{data}, int @var{count}, enum vect_cost_for_stmt @var{kind}, struct _stmt_vec_info *@var{stmt_info}, int @var{misalign}, enum vect_cost_model_location @var{where})
This hook should update the target-specific @var{data} in response to adding @var{count} copies of the given @var{kind} of statement to a loop or basic block. The default adds the builtin vectorizer cost for the copies of the statement to the accumulator specified by @var{where}, (the prologue, body, or epilogue) and returns the amount added. The return value should be viewed as a tentative cost that may later be revised.
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
@end deftypefn
tm.texi: Regenerate. 2012-07-24 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * targhooks.c (default_init_cost): Add prologue and epilogue costs. (default_add_stmt_cost): Likewise; also handle NULL stmt_info. (default_finish_cost): Add prologue and epilogue costs. * targhooks.h (default_add_stmt_cost): Change parameter list. (default_finish_cost): Likewise. * target.def (init_cost): Change documentation string. (add_stmt_cost): Change documentation string and parameter list. (finish_cost): Likewise. * target.h (vect_cost_model_location): New enum. * tree-vectorizer.h (struct _slp_tree): Remove cost substruct. (struct _slp_instance): Remove cost substruct; rename stmt_cost_vec to body_cost_vec. (SLP_INSTANCE_OUTSIDE_OF_LOOP_COST): Remove. (SLP_INSTANCE_STMT_COST_VEC): Rename to SLP_INSTANCE_BODY_COST_VEC. (SLP_TREE_OUTSIDE_OF_LOOP_COST): Remove. (struct _vect_peel_extended_info): Rename stmt_cost_vec to body_cost_vec. (struct _stmt_vec_info): Remove cost substruct. (STMT_VINFO_OUTSIDE_OF_LOOP_COST): Remove. (stmt_vinfo_set_outside_of_loop_cost): Remove. (builtin_vectorization_cost): New function. (vect_get_stmt_cost): Change to use builtin_vectorization_cost. (add_stmt_cost): Change parameter list. (finish_cost): Likewise. (vect_model_simple_cost): Likewise. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): Likewise. (vect_get_load_cost): Likewise. (vect_get_known_peeling_cost): Likewise. * tree-vect-loop.c (vect_get_known_peeling_cost): Change parameter list; call record_stmt_cost for prologue and epilogue costs. (vect_estimate_min_profitable_iters): Call add_stmt_cost for prologue and epilogue costs; remove computation of vec_outside_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_model_reduction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue and epilogue costs. (vect_model_induction_cost): Revise call to add_stmt_cost for body costs; call add_stmt_cost for prologue costs. * tree-vect-data-refs.c (vect_get_data_access_cost): Change parameter list for function and arguments for calls to vect_get_load_cost and vect_get_store_cost. (vect_peeling_hash_get_lowest_cost): Change argument list for calls to vect_get_data_access_cost and vect_get_known_peeling_cost; use temporary vectors prologue_cost_vec and epilogue_cost_vec for the latter call and discard their results; rename stmt_cost_vec to body_cost_vec; correct possible storage leak for body_cost_vec. (vect_peeling_hash_choose_best_peeling): Rename stmt_cost_vec to body_cost_vec. (vect_enhance_data_refs_alignment): Rename stmt_cost_vec to body_cost_vec; add extra dummy parameter on calls to vect_get_data_access_cost; tolerate null si->stmt; add vect_body to argument list on call to add_stmt_cost. * tree-vect-stmts.c (record_stmt_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; tolerate null stmt_info; call builtin_vectorization_cost; add "where" parameter on call to add_stmt_cost. (vect_model_simple_cost): Change parameter list; call record_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost; rename stmt_cost_vec to body_cost_vec. (vect_model_promotion_demotion_cost): Add vect_body argument to call to add_stmt_cost; call add_stmt_cost for prologue costs; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_model_store_cost): Change parameter list; call record_stmt_cost for prologue costs; add vect_body argument to call to record_stmt_cost; rename stmt_cost_vec to body_cost_vec; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_store_cost): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost. (vect_model_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; remove call to stmt_vinfo_set_outside_of_loop_cost. (vect_get_load_cost): Change parameter list; rename stmt_cost_vec to body_cost_vec; add vect_body argument to calls to record_stmt_cost; call record_stmt_cost for prologue costs. (vectorizable_store): Change argument list for call to vect_model_store_cost. (vectorizable_load): Change argument list for call to vect_model_load_cost. (new_stmt_vec_info): Remove assignment to STMT_VINFO_OUTSIDE_OF_LOOP_COST. * config/spu/spu.c (spu_init_cost): Add prologue and epilogue costs. (spu_add_stmt_cost): Likewise; also handle NULL stmt_info. (spu_finish_cost): Add prologue and epilogue costs. * config/i386/i386.c (i386_init_cost): Add prologue and epilogue costs. (i386_add_stmt_cost): Likewise; also handle NULL stmt_info. (i386_finish_cost): Add prologue and epilogue costs. * config/rs6000/rs6000.c (rs6000_init_cost): Add prologue and epilogue costs. (rs6000_add_stmt_cost): Likewise; also handle NULL stmt_info. (rs6000_finish_cost): Add prologue and epilogue costs. * tree-vect-slp.c (vect_free_slp_instance): Rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC. (vect_create_new_slp_node): Remove assignment to SLP_TREE_OUTSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Change parameter list; change argument lists to calls to vect_model_store_cost and vect_model_simple_cost. (vect_build_slp_tree): Change parameter list; change argument lists to calls to vect_model_load_cost, vect_get_and_check_slp_defs, and recursive self-calls; remove setting of outside_cost from SLP_TREE_OUTSIDE_OF_LOOP_COST; add vect_body argument to call to record_stmt_cost. (vect_analyze_slp_instance): Rename stmt_cost_vec to body_cost_vec; rename SLP_INSTANCE_STMT_COST_VEC to SLP_INSTANCE_BODY_COST_VEC; remove assignment to SLP_INSTANCE_OUTSIDE_OF_LOOP_COST; record SLP prologue costs. (vect_bb_vectorization_profitable_p): Rename stmt_cost_vec to body_cost_vec; handle null ci->stmt; add vect_body argument to call to add_stmt_cost; simplify calls to targetm.vectorize. builtin_vectorization_cost; return vec_prologue_cost and vec_epilogue_cost from finish_cost. (vect_update_slp_costs_according_to_vf): Rename stmt_cost_vec to body_cost_vec; add vect_body argument to call to add_stmt_cost. From-SVN: r189836
2012-07-25 05:07:08 +02:00
@deftypefn {Target Hook} void TARGET_VECTORIZE_FINISH_COST (void *@var{data}, unsigned *@var{prologue_cost}, unsigned *@var{body_cost}, unsigned *@var{epilogue_cost})
This hook should complete calculations of the cost of vectorizing a loop or basic block based on @var{data}, and return the prologue, body, and epilogue costs as unsigned integers. The default returns the value of the three accumulators.
tm.texi: Regenerate. 2012-07-13 Bill Schmidt <wschmidt@linux.ibm.com> * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_VECTORIZE_INIT_COST): New hook. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * targhooks.c (default_init_cost): New function. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * targhooks.h (default_init_cost): New decl. (default_add_stmt_cost): Likewise. (default_finish_cost): Likewise. (default_destroy_cost_data): Likewise. * target.def (init_cost): New DEFHOOK. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. * target.h (struct _stmt_vec_info): New extern decl. (stmt_vectype): Likewise. (stmt_in_inner_loop_p): Likewise. * tree-vectorizer.h (stmt_info_for_cost): New struct/typedef. (stmt_vector_for_cost): New VEC/typedef. (add_stmt_info_to_vec): New function. (struct _slp_tree): Remove cost.inside_of_loop field. (struct _slp_instance): Remove cost.inside_of_loop field; add stmt_cost_vec field. (SLP_INSTANCE_INSIDE_OF_LOOP_COST): Remove macro. (SLP_INSTANCE_STMT_COST_VEC): New accessor macro. (SLP_TREE_INSIDE_OF_LOOP_COST): Remove macro. (struct _vect_peel_extended_info): Add stmt_cost_vec field. (struct _loop_vec_info): Add target_cost_data field. (LOOP_VINFO_TARGET_COST_DATA): New accessor macro. (struct _bb_vec_info): Add target_cost_data field. (BB_VINFO_TARGET_COST_DATA): New accessor macro. (struct _stmt_vec_info): Remove cost.inside_of_loop field. (STMT_VINFO_INSIDE_OF_LOOP_COST): Remove macro. (stmt_vinfo_set_inside_of_loop_cost): Remove function. (init_cost): New function. (add_stmt_cost): Likewise. (finish_cost): Likewise. (destroy_cost_data): Likewise. (vect_model_simple_cost): Change parameter list. (vect_model_store_cost): Likewise. (vect_model_load_cost): Likewise. (record_stmt_cost): New extern decl. (vect_get_load_cost): Change parameter list. (vect_get_store_cost): Likewise. * tree-vect-loop.c (new_loop_vec_info): Call init_cost. (destroy_loop_vec_info): Call destroy_cost_data. (vect_estimate_min_profitable_iters): Remove old calculation of inside costs; call finish_cost instead. (vect_model_reduction_cost): Call add_stmt_cost instead of old inside-costs calculation. (vect_model_induction_cost): Likewise. * tree-vect-data-refs.c (vect_get_data_access_cost): Change to return a stmt_vector_for_cost; modify calls to vect_get_load_cost and vect_get_store_cost to obtain the value to return. (vect_peeling_hash_get_lowest_cost): Obtain a stmt_cost_vec from vect_get_data_access_cost and store it in the minimum peeling structure. (vect_peeling_hash_choose_best_peeling): Change the parameter list to add a (stmt_vector_for_cost *) output parameter, and set its value. (vect_enhance_data_refs_alignment): Ignore the new return value from calls to vect_get_data_access_cost; obtain stmt_cost_vec from vect_peeling_hash_choose_best_peeling and pass its contents to the target cost model. * tree-vect-stmts.c (stmt_vectype): New function. (stmt_in_inner_loop_p): Likewise. (record_stmt_cost): Likewise. (vect_model_simple_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_promotion_demotion_cost): Call add_stmt_cost instead of old calculation; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_model_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_store_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_store_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vect_model_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation; add stmt_cost_vec parameter to vect_get_load_cost call; don't call stmt_vinfo_set_inside_of_loop_cost. (vect_get_load_cost): Add stmt_cost_vec parameter; call record_stmt_cost instead of old calculation. (vectorizable_call): Add NULL parameter to vect_model_simple_cost call. (vectorizable_conversion): Likewise. (vectorizable_assignment): Likewise. (vectorizable_shift): Likewise. (vectorizable_operation): Likewise. (vectorizable_store): Add NULL parameter to vect_model_store_cost call. (vectorizable_load): Add NULL parameter to vect_model_load_cost call. (new_stmt_vec_info): Don't set STMT_VINFO_INSIDE_OF_LOOP_COST. * config/spu/spu.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (spu_init_cost): New function. (spu_add_stmt_cost): Likewise. (spu_finish_cost): Likewise. (spu_destroy_cost_data): Likewise. * config/i386/i386.c (ix86_init_cost): New function. (ix86_add_stmt_cost): Likewise. (ix86_finish_cost): Likewise. (ix86_destroy_cost_data): Likewise. (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. * config/rs6000/rs6000.c (TARGET_VECTORIZE_INIT_COST): New macro def. (TARGET_VECTORIZE_ADD_STMT_COST): Likewise. (TARGET_VECTORIZE_FINISH_COST): Likewise. (TARGET_VECTORIZE_DESTROY_COST_DATA): Likewise. (rs6000_init_cost): New function. (rs6000_add_stmt_cost): Likewise. (rs6000_finish_cost): Likewise. (rs6000_destroy_cost_data): Likewise. * tree-vect-slp.c (vect_free_slp_instance): Free stmt_cost_vec. (vect_create_new_slp_node): Don't set SLP_TREE_INSIDE_OF_LOOP_COST. (vect_get_and_check_slp_defs): Add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_model_store_cost and vect_model_simple_cost calls. (vect_build_slp_tree): Remove inside_cost parameter; add stmt_cost_vec parameter; add stmt_cost_vec parameter to vect_get_and_check_slp_defs, vect_model_load_cost, and recursive vect_build_slp_tree calls; prevent calculating cost more than once for loads; remove inside_cost parameter from recursive vect_build_slp_tree calls; call record_stmt_cost instead of old calculation. (vect_analyze_slp_instance): Allocate stmt_cost_vec and save it with the instance; free it on premature exit; remove inside_cost parameter from vect_build_slp_tree call; add stmt_cost_vec parameter to vect_build_slp_tree call; don't set SLP_INSTANCE_INSIDE_OF_LOOP_COST. (new_bb_vec_info): Call init_cost. (destroy_bb_vec_info): Call destroy_cost_data. (vect_bb_vectorization_profitable_p): Call add_stmt_cost for each statement recorded with an SLP instance; call finish_cost instead of the old calculation. (vect_update_slp_costs_according_to_vf): Record statement costs from SLP instances, multiplying by the appropriate number of copies; don't update SLP_INSTANCE_INSIDE_OF_LOOP_COST. From-SVN: r189460
2012-07-13 13:12:33 +02:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_VECTORIZE_DESTROY_COST_DATA (void *@var{data})
This hook should release @var{data} and any related data structures allocated by TARGET_VECTORIZE_INIT_COST. The default releases the accumulator.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_TM_LOAD (tree)
This hook should return the built-in decl needed to load a vector of the given type within a transaction.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_TM_STORE (tree)
This hook should return the built-in decl needed to store a vector of the given type within a transaction.
@end deftypefn
re PR tree-optimization/50789 (Gather vectorization) PR tree-optimization/50789 * tree-vect-stmts.c (process_use): Add force argument, avoid exist_non_indexing_operands_for_use_p check if true. (vect_mark_stmts_to_be_vectorized): Adjust callers. Handle STMT_VINFO_GATHER_P. (gen_perm_mask): New function. (perm_mask_for_reverse): Use it. (reverse_vec_element): Rename to... (permute_vec_elements): ... this. Add Y and MASK_VEC arguments, generalize for any permutations. (vectorizable_load): Adjust caller. Handle STMT_VINFO_GATHER_P. * target.def (TARGET_VECTORIZE_BUILTIN_GATHER): New hook. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_GATHER): Document it. * doc/tm.texi: Regenerate. * tree-data-ref.c (initialize_data_dependence_relation, compute_self_dependence): No longer static. * tree-data-ref.h (initialize_data_dependence_relation, compute_self_dependence): New prototypes. * tree-vect-data-refs.c (vect_check_gather): New function. (vect_analyze_data_refs): Detect possible gather load data refs. * tree-vectorizer.h (struct _stmt_vec_info): Add gather_p field. (STMT_VINFO_GATHER_P): Define. (vect_check_gather): New prototype. * config/i386/i386-builtin-types.def: Add types for alternate gather builtins. * config/i386/sse.md (AVXMODE48P_DI): Remove. (VEC_GATHER_MODE): Rename mode_attr to... (VEC_GATHER_IDXSI): ... this. (VEC_GATHER_IDXDI, VEC_GATHER_SRCDI): New mode_attrs. (avx2_gathersi<mode>, *avx2_gathersi<mode>): Use <VEC_GATHER_IDXSI> instead of <VEC_GATHER_MODE>. (avx2_gatherdi<mode>): Use <VEC_GATHER_IDXDI> instead of <<AVXMODE48P_DI> and <VEC_GATHER_SRCDI> instead of VEC_GATHER_MODE on src and mask operands. (*avx2_gatherdi<mode>): Likewise. Use VEC_GATHER_MODE iterator instead of AVXMODE48P_DI. (avx2_gatherdi<mode>256, *avx2_gatherdi<mode>256): Removed. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_GATHERALTSIV4DF, IX86_BUILTIN_GATHERALTDIV8SF, IX86_BUILTIN_GATHERALTSIV4DI and IX86_BUILTIN_GATHERALTDIV8SI. (ix86_init_mmx_sse_builtins): Create those builtins. (ix86_expand_builtin): Handle those builtins and adjust expansions of other gather builtins. (ix86_vectorize_builtin_gather): New function. (TARGET_VECTORIZE_BUILTIN_GATHER): Define. * gcc.target/i386/avx2-gather-1.c: New test. * gcc.target/i386/avx2-gather-2.c: New test. * gcc.target/i386/avx2-gather-3.c: New test. * gcc.target/i386/avx2-gather-4.c: New test. From-SVN: r181089
2011-11-07 16:59:07 +01:00
@deftypefn {Target Hook} tree TARGET_VECTORIZE_BUILTIN_GATHER (const_tree @var{mem_vectype}, const_tree @var{index_type}, int @var{scale})
Target builtin that implements vector gather operation. @var{mem_vectype}
is the vector type of the load and @var{index_type} is scalar type of
the index, scaled by @var{scale}.
The default is @code{NULL_TREE} which means to not vectorize gather
loads.
@end deftypefn
cgraph.h (enum cgraph_simd_clone_arg_type): New. * cgraph.h (enum cgraph_simd_clone_arg_type): New. (struct cgraph_simd_clone_arg, struct cgraph_simd_clone): New. (struct cgraph_node): Add simdclone and simd_clones fields. * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen, ix86_simd_clone_adjust, ix86_simd_clone_usable): New functions. (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Define. * doc/tm.texi.in (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): Add. * doc/tm.texi: Regenerated. * ggc.h (ggc_alloc_cleared_simd_clone_stat): New function. * ipa-cp.c (determine_versionability): Fail if "omp declare simd" attribute is present. * omp-low.c: Include pretty-print.h, ipa-prop.h and tree-eh.h. (simd_clone_vector_of_formal_parm_types): New function. (simd_clone_struct_alloc, simd_clone_struct_copy, simd_clone_vector_of_formal_parm_types, simd_clone_clauses_extract, simd_clone_compute_base_data_type, simd_clone_mangle, simd_clone_create, simd_clone_adjust_return_type, create_tmp_simd_array, simd_clone_adjust_argument_types, simd_clone_init_simd_arrays): New functions. (struct modify_stmt_info): New type. (ipa_simd_modify_stmt_ops, ipa_simd_modify_function_body, simd_clone_adjust, expand_simd_clones, ipa_omp_simd_clone): New functions. (pass_data_omp_simd_clone): New variable. (pass_omp_simd_clone): New class. (make_pass_omp_simd_clone): New function. * passes.def (pass_omp_simd_clone): New. * target.def (TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN, TARGET_SIMD_CLONE_ADJUST, TARGET_SIMD_CLONE_USABLE): New target hooks. * target.h (struct cgraph_node, struct cgraph_simd_node): Declare. * tree-core.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Document. * tree.h (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE): Define. * tree-pass.h (make_pass_omp_simd_clone): New prototype. * tree-vect-data-refs.c: Include cgraph.h. (vect_analyze_data_refs): Inline by hand find_data_references_in_loop and find_data_references_in_bb, if find_data_references_in_stmt fails, still allow calls to #pragma omp declare simd functions in #pragma omp simd loops unless they contain data references among the call arguments or in lhs. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle calls with no lhs. (vect_transform_loop): Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * tree-vectorizer.h (enum stmt_vec_info_type): Add call_simd_clone_vec_info_type. (struct _stmt_vec_info): Add simd_clone_fndecl field. (STMT_VINFO_SIMD_CLONE_FNDECL): Define. * tree-vect-stmts.c: Include tree-ssa-loop.h, tree-scalar-evolution.h and cgraph.h. (vectorizable_call): Handle calls without lhs. Assert !stmt_can_throw_internal instead of failing for it. Don't update EH stuff. (struct simd_call_arg_info): New. (vectorizable_simd_clone_call): New function. (vect_transform_stmt): Call it. (vect_analyze_stmt): Likewise. Allow NULL STMT_VINFO_VECTYPE for calls without lhs. * ipa-prop.c (ipa_add_new_function): Only call ipa_analyze_node if cgraph_function_with_gimple_body_p is true. c/ * c-decl.c (c_builtin_function_ext_scope): Avoid binding if external_scope is NULL. cp/ * semantics.c (finish_omp_clauses): For #pragma omp declare simd linear clause step call maybe_constant_value. testsuite/ * g++.dg/gomp/declare-simd-1.C (f38): Make sure simdlen is a power of two. * gcc.dg/gomp/simd-clones-2.c: Compile on all targets. Remove -msse2. Adjust regexps for name mangling changes. * gcc.dg/gomp/simd-clones-3.c: Likewise. * gcc.dg/vect/vect-simd-clone-1.c: New test. * gcc.dg/vect/vect-simd-clone-2.c: New test. * gcc.dg/vect/vect-simd-clone-3.c: New test. * gcc.dg/vect/vect-simd-clone-4.c: New test. * gcc.dg/vect/vect-simd-clone-5.c: New test. * gcc.dg/vect/vect-simd-clone-6.c: New test. * gcc.dg/vect/vect-simd-clone-7.c: New test. * gcc.dg/vect/vect-simd-clone-8.c: New test. * gcc.dg/vect/vect-simd-clone-9.c: New test. * gcc.dg/vect/vect-simd-clone-10.c: New test. * gcc.dg/vect/vect-simd-clone-10.h: New file. * gcc.dg/vect/vect-simd-clone-10a.c: New file. * gcc.dg/vect/vect-simd-clone-11.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r205442
2013-11-27 12:20:06 +01:00
@deftypefn {Target Hook} int TARGET_SIMD_CLONE_COMPUTE_VECSIZE_AND_SIMDLEN (struct cgraph_node *@var{}, struct cgraph_simd_clone *@var{}, @var{tree}, @var{int})
This hook should set @var{vecsize_mangle}, @var{vecsize_int}, @var{vecsize_float}
fields in @var{simd_clone} structure pointed by @var{clone_info} argument and also
@var{simdlen} field if it was previously 0.
The hook should return 0 if SIMD clones shouldn't be emitted,
or number of @var{vecsize_mangle} variants that should be emitted.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SIMD_CLONE_ADJUST (struct cgraph_node *@var{})
This hook should add implicit @code{attribute(target("..."))} attribute
to SIMD clone @var{node} if needed.
@end deftypefn
@deftypefn {Target Hook} int TARGET_SIMD_CLONE_USABLE (struct cgraph_node *@var{})
This hook should return -1 if SIMD clone @var{node} shouldn't be used
in vectorized loops in current function, or non-negative number if it is
usable. In that case, the smaller the number is, the more desirable it is
to use it.
@end deftypefn
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
@node Anchored Addresses
@section Anchored Addresses
@cindex anchored addresses
@cindex @option{-fsection-anchors}
GCC usually addresses every static object as a separate entity.
For example, if we have:
@smallexample
static int a, b, c;
int foo (void) @{ return a + b + c; @}
@end smallexample
the code for @code{foo} will usually calculate three separate symbolic
addresses: those of @code{a}, @code{b} and @code{c}. On some targets,
it would be better to calculate just one symbolic address and access
the three variables relative to it. The equivalent pseudocode would
be something like:
@smallexample
int foo (void)
@{
register int *xr = &x;
return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
@}
@end smallexample
(which isn't valid C). We refer to shared addresses like @code{x} as
``section anchors''. Their use is controlled by @option{-fsection-anchors}.
The hooks below describe the target properties that GCC needs to know
in order to make effective use of section anchors. It won't use
section anchors at all unless either @code{TARGET_MIN_ANCHOR_OFFSET}
or @code{TARGET_MAX_ANCHOR_OFFSET} is set to a nonzero value.
@deftypevr {Target Hook} HOST_WIDE_INT TARGET_MIN_ANCHOR_OFFSET
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
The minimum offset that should be applied to a section anchor.
On most targets, it should be the smallest offset that can be
applied to a base register while still giving a legitimate address
for every mode. The default value is 0.
@end deftypevr
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
@deftypevr {Target Hook} HOST_WIDE_INT TARGET_MAX_ANCHOR_OFFSET
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
Like @code{TARGET_MIN_ANCHOR_OFFSET}, but the maximum (inclusive)
offset that should be applied to section anchors. The default
value is 0.
@end deftypevr
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_ANCHOR (rtx @var{x})
Write the assembly code to define section anchor @var{x}, which is a
@code{SYMBOL_REF} for which @samp{SYMBOL_REF_ANCHOR_P (@var{x})} is true.
The hook is called with the assembly output position set to the beginning
of @code{SYMBOL_REF_BLOCK (@var{x})}.
If @code{ASM_OUTPUT_DEF} is available, the hook's default definition uses
it to define the symbol as @samp{. + SYMBOL_REF_BLOCK_OFFSET (@var{x})}.
If @code{ASM_OUTPUT_DEF} is not available, the hook's default definition
is @code{NULL}, which disables the use of section anchors altogether.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} bool TARGET_USE_ANCHORS_FOR_SYMBOL_P (const_rtx @var{x})
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
Return true if GCC should attempt to use anchors to access @code{SYMBOL_REF}
@var{x}. You can assume @samp{SYMBOL_REF_HAS_BLOCK_INFO_P (@var{x})} and
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
@samp{!SYMBOL_REF_ANCHOR_P (@var{x})}.
The default version is correct for most targets, but you might need to
intercept this hook to handle things like target-specific attributes
or target-specific sections.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Condition Code
@section Condition Code Status
@cindex condition code status
The macros in this section can be split in two families, according to the
two ways of representing condition codes in GCC.
The first representation is the so called @code{(cc0)} representation
(@pxref{Jump Patterns}), where all instructions can have an implicit
clobber of the condition codes. The second is the condition code
register representation, which provides better schedulability for
architectures that do have a condition code register, but on which
most instructions do not affect it. The latter category includes
most RISC machines.
The implicit clobbering poses a strong restriction on the placement of
the definition and use of the condition code. In the past the definition
and use were always adjacent. However, recent changes to support trapping
arithmatic may result in the definition and user being in different blocks.
Thus, there may be a @code{NOTE_INSN_BASIC_BLOCK} between them. Additionally,
the definition may be the source of exception handling edges.
These restrictions can prevent important
optimizations on some machines. For example, on the IBM RS/6000, there
is a delay for taken branches unless the condition code register is set
three instructions earlier than the conditional branch. The instruction
scheduler cannot perform this optimization if it is not permitted to
separate the definition and use of the condition code register.
For this reason, it is possible and suggested to use a register to
represent the condition code for new ports. If there is a specific
condition code register in the machine, use a hard register. If the
condition code or comparison result can be placed in any general register,
or if there are multiple condition registers, use a pseudo register.
Registers used to store the condition code value will usually have a mode
that is in class @code{MODE_CC}.
Alternatively, you can use @code{BImode} if the comparison operator is
specified already in the compare instruction. In this case, you are not
interested in most macros in this section.
@menu
* CC0 Condition Codes:: Old style representation of condition codes.
* MODE_CC Condition Codes:: Modern representation of condition codes.
@end menu
@node CC0 Condition Codes
@subsection Representation of condition codes using @code{(cc0)}
@findex cc0
1996-09-25 01:21:45 +02:00
@findex cc_status
The file @file{conditions.h} defines a variable @code{cc_status} to
describe how the condition code was computed (in case the interpretation of
the condition code depends on the instruction that it was set by). This
variable contains the RTL expressions on which the condition code is
currently based, and several standard flags.
Sometimes additional machine-specific flags must be defined in the machine
description header file. It can also add additional machine-specific
information by defining @code{CC_STATUS_MDEP}.
@defmac CC_STATUS_MDEP
1996-09-25 01:21:45 +02:00
C code for a data type which is used for declaring the @code{mdep}
component of @code{cc_status}. It defaults to @code{int}.
This macro is not used on machines that do not use @code{cc0}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CC_STATUS_MDEP_INIT
1996-09-25 01:21:45 +02:00
A C expression to initialize the @code{mdep} field to ``empty''.
The default definition does nothing, since most machines don't use
the field anyway. If you want to use the field, you should probably
define this macro to initialize it.
This macro is not used on machines that do not use @code{cc0}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac NOTICE_UPDATE_CC (@var{exp}, @var{insn})
1996-09-25 01:21:45 +02:00
A C compound statement to set the components of @code{cc_status}
appropriately for an insn @var{insn} whose body is @var{exp}. It is
this macro's responsibility to recognize insns that set the condition
code as a byproduct of other activity as well as those that explicitly
set @code{(cc0)}.
This macro is not used on machines that do not use @code{cc0}.
If there are insns that do not set the condition code but do alter
other machine registers, this macro must check to see whether they
invalidate the expressions that the condition code is recorded as
reflecting. For example, on the 68000, insns that store in address
registers do not set the condition code, which means that usually
@code{NOTICE_UPDATE_CC} can leave @code{cc_status} unaltered for such
insns. But suppose that the previous insn set the condition code
based on location @samp{a4@@(102)} and the current insn stores a new
value in @samp{a4}. Although the condition code is not changed by
this, it will no longer be true that it reflects the contents of
@samp{a4@@(102)}. Therefore, @code{NOTICE_UPDATE_CC} must alter
@code{cc_status} in this case to say that nothing is known about the
condition code value.
The definition of @code{NOTICE_UPDATE_CC} must be prepared to deal
with the results of peephole optimization: insns whose patterns are
@code{parallel} RTXs containing various @code{reg}, @code{mem} or
constants which are just the operands. The RTL structure of these
insns is not sufficient to indicate what the insns actually do. What
@code{NOTICE_UPDATE_CC} should do when it sees one is just to run
@code{CC_STATUS_INIT}.
A possible definition of @code{NOTICE_UPDATE_CC} is to call a function
that looks at an attribute (@pxref{Insn Attributes}) named, for example,
@samp{cc}. This avoids having detailed information about patterns in
two places, the @file{md} file and in @code{NOTICE_UPDATE_CC}.
@end defmac
1996-09-25 01:21:45 +02:00
@node MODE_CC Condition Codes
@subsection Representation of condition codes using registers
@findex CCmode
@findex MODE_CC
@defmac SELECT_CC_MODE (@var{op}, @var{x}, @var{y})
On many machines, the condition code may be produced by other instructions
than compares, for example the branch can use directly the condition
code set by a subtract instruction. However, on some machines
when the condition code is set this way some bits (such as the overflow
bit) are not set in the same way as a test instruction, so that a different
branch instruction must be used for some conditional branches. When
this happens, use the machine mode of the condition code register to
record different formats of the condition code register. Modes can
also be used to record which compare instruction (e.g. a signed or an
unsigned comparison) produced the condition codes.
If other modes than @code{CCmode} are required, add them to
@file{@var{machine}-modes.def} and define @code{SELECT_CC_MODE} to choose
a mode given an operand of a compare. This is needed because the modes
have to be chosen not only during RTL generation but also, for example,
by instruction combination. The result of @code{SELECT_CC_MODE} should
be consistent with the mode used in the patterns; for example to support
the case of the add on the SPARC discussed above, we have the pattern
@smallexample
(define_insn ""
[(set (reg:CC_NOOV 0)
(compare:CC_NOOV
(plus:SI (match_operand:SI 0 "register_operand" "%r")
(match_operand:SI 1 "arith_operand" "rI"))
(const_int 0)))]
""
"@dots{}")
@end smallexample
@noindent
together with a @code{SELECT_CC_MODE} that returns @code{CC_NOOVmode}
for comparisons whose argument is a @code{plus}:
1996-09-25 01:21:45 +02:00
@smallexample
#define SELECT_CC_MODE(OP,X,Y) \
(GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
? ((OP == EQ || OP == NE) ? CCFPmode : CCFPEmode) \
: ((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS \
|| GET_CODE (X) == NEG) \
? CC_NOOVmode : CCmode))
@end smallexample
Another reason to use modes is to retain information on which operands
were used by the comparison; see @code{REVERSIBLE_CC_MODE} later in
this section.
Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with min-insn-modes.o. * Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with min-insn-modes.o. (STAGESTUFF): Add min-insn-modes.c. (genobjs): Add genmodes.o. (print-rtl.o, print-rtl1.o): Depend on $(TM_P_H). (insn-modes.o): Depend on $(TM_H) not $(GTM_H); also real.h. (min-insn-modes.c, min-insn-modes.o): New rules. (s-modes): Also generate min-insn-modes.c. ($(BUILD_PREFIX_1)insn-modes.o): Kill. * genmodes.c (struct mode_data): Add format field. (blank_mode, validate_mode, complete_mode): Update to match. (make_scalar_mode): Separate into make_int_mode and make_float_mode. (_SCALAR_MODE): Kill. (FLOAT_MODE, FRACTIONAL_FLOAT_MODE): Add format argument. (emit_insn_modes_c_header): Adjust. (emit_min_insn_modes_c_header, emit_real_format_for_mode) (emit_min_insn_modes_c): New functions. (emit_insn_modes_c): Call emit_real_format_for_mode. (main): Add -m option to generate min-insn-modes.c. * machmode.h: Update documentation. Add format argument to all uses of FLOAT_MODE. * real.c: Don't define real_format_for_mode here. * dwarfout.c: Move default definition of PRINT_REG... * defaults.h: ...here. * print-rtl.c: Include tm_p.h. (DEBUG_PRINT_REG, DEBUG_REGISTER_NAMES, debug_reg_names, reg_names): Kill. (print_rtx): Use PRINT_REG, not DEBUG_PRINT_REG. But surround this entire block with #ifndef GENERATOR_FILE. * regclass.c: Unconditionally define reg_names. * config/mips/mips.h, config/rs6000/rs6000.h, config/sh/sh.h Don't define DEBUG_REGISTER_NAMES. * config/rs6000/darwin.h: Don't use DEBUG_REGISTER_NAMES in redefinition of REGISTER_NAMES. * config/i386/i386.h: Don't define DEBUG_PRINT_REG. * combine.c: Change all preprocessor conditionals on EXTRA_CC_MODES to use SELECT_CC_MODE instead; rearrange a bit for clarity. * genopinit.c: Remove mention of EXTRA_CC_MODES in comment. * configure.in: Don't define EXTRA_CC_MODES. * configure, config.in: Regenerate. * doc/tm.texi: Remove documentation of EXTRA_CC_MODES. * config/arc/arc.c, config/m32r/m32r.c, config/sparc/sparc.c: May assume that GET_MODE_CLASS is accurate for extra CC modes at all times. * config/i860/i860.h (INIT_CUMULATIVE_ARGS): Pass correct number of arguments to aggregate_value_p. * genmodes.c (RESET_FLOAT_FORMAT, reset_float_format): New. * machmode.def: Explain ARCH-modes.def. Document RESET_FLOAT_FORMAT. Improve commentary on various mode clusters. Do not define OI, PQI, PHI, PSI, PDI, QF, HF, TQF, XF, or TF modes here. Remove backward-compatibility definition of CC. * config/alpha/alpha-modes.def: New file; define TF mode. * config/arc/arm-modes.def: Define XF mode. * config/c4x/c4x-modes.def: Define QF and HF modes. Unset float format for SF and DF modes. * config/dsp16xx/dsp16xx-modes.def: New file; define HF mode. * config/i386/i386-modes.def: Define XF and TF modes. * config/i960/i960-modes.def: Define TF mode. * config/ia64/ia64-modes.def: Define TF and OI modes. * config/m68k/m68k-modes.def: New file; define XF mode. * config/mips/mips-modes.def: New file; define TF mode, reset formats for SF and DF modes. * config/pa/pa-modes.def: Define TF mode. * config/rs6000/rs6000.c: Define TF and PSI modes. * config/s390/s390-modes.def: Define OI mode. * config/sh/sh-modes.def: New file; define PSI mode. * config/sparc/sparc-modes.def: Define TF mode. * config/vax/vax-modes.def: New file; reset formats for SF and DF modes. * config/c4x/c4x.c (c4x_override_options): No need to mess with real_format_for_mode or set REAL_MODE_FORMATs. (c4x_immed_int_constant): Don't apply GET_MODE_CLASS to rtx variable. * config/i386/i386.c (override_options): No need to set REAL_MODE_FORMATs here. * config/i960/i960.c (i960_initialize): Likewise. * config/m68k/m68k.c (m68k_override_options): Likewise. * config/ia64/ia64.c (ia64_override_options): Set REAL_MODE_FORMAT for TFmode only if not the default. * config/mips/mips.c (override_options): Likewise. * config/vax/vax.c (override_optionms): Set REAL_MODE_FORMAT for DFmode only if not the default. * config/i370/i370.h (RET_REG): Don't consider TFmode. * config/m68hc11/m68hc11.c (print_operand): Don't consider XFmode. * config/dsp16xx/dsp16xx.c (hard_regno_mode_ok): #if 0 out use of modes that don't appear anywhere in the machine description. * config/arc/arc-modes.def, config/arm/arm-modes.def * config/c4x/c4x-modes.def, config/frv/frv-modes.def * config/i386/i386-modes.def, config/i960/i960-modes.def * config/ia64/ia64-modes.def, config/mmix/mmix-modes.def * config/pa/pa-modes.def, config/pdp11/pdp11-modes.def * config/rs6000/rs6000-modes.def, config/s390/s390-modes.def * config/sparc/sparc-modes.def: Convert to new style for declaring extra CC modes. From-SVN: r72440
2003-10-13 23:16:33 +02:00
You should define this macro if and only if you define extra CC modes
in @file{@var{machine}-modes.def}.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} void TARGET_CANONICALIZE_COMPARISON (int *@var{code}, rtx *@var{op0}, rtx *@var{op1}, bool @var{op0_preserve_value})
On some machines not all possible comparisons are defined, but you can
1996-09-25 01:21:45 +02:00
convert an invalid comparison into a valid one. For example, the Alpha
does not have a @code{GT} comparison, but you can use an @code{LT}
comparison instead and swap the order of the operands.
target.def: Define canonicalize_comparison hook. 2012-12-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * target.def: Define canonicalize_comparison hook. * targhooks.h (default_canonicalize_comparison): New prototype. * targhooks.c (default_canonicalize_comparison): New function. * doc/tm.texi: Add documentation for the new target hook. * doc/tm.texi.in: Likewise. * combine.c (try_combine): Adjust to use the target hook. * config/alpha/alpha.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/alpha/alpha.c (alpha_canonicalize_comparison): New function. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/arm/arm-protos.h (arm_canonicalize_comparison): Remove prototype. * config/arm/arm.c (arm_canonicalize_comparison): Add new parameter. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/arm/arm.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/s390/s390-protos.h (s390_canonicalize_comparison): Remove prototype. * config/s390/s390.c (s390_canonicalize_comparison): Add new parameter. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/s390/s390.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/sh/sh-protos.h (sh_canonicalize_comparison): Remove prototype. * config/sh/sh.c (sh_canonicalize_comparison): Add new prototype. New function overloading the old one. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/sh/sh.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/spu/spu.c (spu_canonicalize_comparison): New function. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/spu/spu.h (CANONICALIZE_COMPARISON): Remove macro definition. From-SVN: r194608
2012-12-19 13:39:17 +01:00
On such machines, implement this hook to do any required conversions.
@var{code} is the initial comparison code and @var{op0} and @var{op1}
are the left and right operands of the comparison, respectively. If
@var{op0_preserve_value} is @code{true} the implementation is not
allowed to change the value of @var{op0} since the value might be used
in RTXs which aren't comparisons. E.g. the implementation is not
allowed to swap operands in that case.
1996-09-25 01:21:45 +02:00
GCC will not assume that the comparison resulting from this macro is
1996-09-25 01:21:45 +02:00
valid but will see if the resulting insn matches a pattern in the
@file{md} file.
target.def: Define canonicalize_comparison hook. 2012-12-19 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * target.def: Define canonicalize_comparison hook. * targhooks.h (default_canonicalize_comparison): New prototype. * targhooks.c (default_canonicalize_comparison): New function. * doc/tm.texi: Add documentation for the new target hook. * doc/tm.texi.in: Likewise. * combine.c (try_combine): Adjust to use the target hook. * config/alpha/alpha.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/alpha/alpha.c (alpha_canonicalize_comparison): New function. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/arm/arm-protos.h (arm_canonicalize_comparison): Remove prototype. * config/arm/arm.c (arm_canonicalize_comparison): Add new parameter. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/arm/arm.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/s390/s390-protos.h (s390_canonicalize_comparison): Remove prototype. * config/s390/s390.c (s390_canonicalize_comparison): Add new parameter. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/s390/s390.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/sh/sh-protos.h (sh_canonicalize_comparison): Remove prototype. * config/sh/sh.c (sh_canonicalize_comparison): Add new prototype. New function overloading the old one. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/sh/sh.h (CANONICALIZE_COMPARISON): Remove macro definition. * config/spu/spu.c (spu_canonicalize_comparison): New function. (TARGET_CANONICALIZE_COMPARISON): New macro definition. * config/spu/spu.h (CANONICALIZE_COMPARISON): Remove macro definition. From-SVN: r194608
2012-12-19 13:39:17 +01:00
You need not to implement this hook if it would never change the
comparison code or operands.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac REVERSIBLE_CC_MODE (@var{mode})
1996-09-25 01:21:45 +02:00
A C expression whose value is one if it is always safe to reverse a
comparison whose mode is @var{mode}. If @code{SELECT_CC_MODE}
can ever return @var{mode} for a floating-point inequality comparison,
then @code{REVERSIBLE_CC_MODE (@var{mode})} must be zero.
You need not define this macro if it would always returns zero or if the
floating-point format is anything other than @code{IEEE_FLOAT_FORMAT}.
For example, here is the definition used on the SPARC, where floating-point
1996-09-25 01:21:45 +02:00
inequality comparisons are always given @code{CCFPEmode}:
@smallexample
#define REVERSIBLE_CC_MODE(MODE) ((MODE) != CCFPEmode)
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REVERSE_CONDITION (@var{code}, @var{mode})
A C expression whose value is reversed condition code of the @var{code} for
comparison done in CC_MODE @var{mode}. The macro is used only in case
@code{REVERSIBLE_CC_MODE (@var{mode})} is nonzero. Define this macro in case
machine has some non-standard way how to reverse certain conditionals. For
instance in case all floating point conditions are non-trapping, compiler may
freely convert unordered compares to ordered one. Then definition may look
like:
@smallexample
#define REVERSE_CONDITION(CODE, MODE) \
((MODE) != CCFPmode ? reverse_condition (CODE) \
: reverse_condition_maybe_unordered (CODE))
@end smallexample
@end defmac
@deftypefn {Target Hook} bool TARGET_FIXED_CONDITION_CODE_REGS (unsigned int *@var{p1}, unsigned int *@var{p2})
On targets which do not use @code{(cc0)}, and which use a hard
register rather than a pseudo-register to hold condition codes, the
regular CSE passes are often not able to identify cases in which the
hard register is set to a common value. Use this hook to enable a
small pass which optimizes such cases. This hook should return true
to enable this pass, and it should set the integers to which its
arguments point to the hard register numbers used for condition codes.
When there is only one such register, as is true on most systems, the
integer pointed to by @var{p2} should be set to
@code{INVALID_REGNUM}.
The default version of this hook returns false.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_CC_MODES_COMPATIBLE (machine_mode @var{m1}, machine_mode @var{m2})
On targets which use multiple condition code modes in class
@code{MODE_CC}, it is sometimes the case that a comparison can be
validly done in more than one mode. On such a system, define this
target hook to take two mode arguments and to return a mode in which
both comparisons may be validly done. If there is no such mode,
return @code{VOIDmode}.
The default version of this hook checks whether the modes are the
same. If they are, it returns that mode. If they are different, it
returns @code{VOIDmode}.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Costs
@section Describing Relative Costs of Operations
@cindex costs of instructions
@cindex relative costs
@cindex speed of instructions
These macros let you describe the relative speed of various operations
on the target machine.
@defmac REGISTER_MOVE_COST (@var{mode}, @var{from}, @var{to})
tm.texi (REGISTER_MOVE_COST): Add a mode argument. * tm.texi (REGISTER_MOVE_COST): Add a mode argument. * reload.c (REGISTER_MOVE_COST): Likewise. Adjust all callers. * reload1.c (REGISTER_MOVE_COST): Likewise. * regclass.c (REGISTER_MOVE_COST): Likewise. (move_cost, may_move_in_cost, may_move_out_cost): Add mode dimension. Adjust all users. (init_reg_sets_1): Iterate on all modes. * config/1750a/1750a.h (REGISTER_MOVE_COST): Adjust. * config/a29k/a29k.h (REGISTER_MOVE_COST): Adjust. * config/alpha/alpha.h (REGISTER_MOVE_COST): Adjust. * config/arc/arc.h (REGISTER_MOVE_COST): Adjust. * config/arm/arm.h (REGISTER_MOVE_COST): Adjust. * config/avr/avr.h (REGISTER_MOVE_COST): Adjust. * config/c4x/c4x.h (REGISTER_MOVE_COST): Adjust. * config/d30v/d30v.h (REGISTER_MOVE_COST): Adjust. * config/dsp16xx/dsp16xx.h (REGISTER_MOVE_COST): Adjust. * config/h8300/h8300.h (REGISTER_MOVE_COST): Adjust. * config/i386/i386.h (REGISTER_MOVE_COST): Adjust. * config/ia64/ia64.h (REGISTER_MOVE_COST): Adjust. * config/m32r/m32r.h (REGISTER_MOVE_COST): Adjust. * config/m68hc11/m68hc11.h (REGISTER_MOVE_COST): Adjust. * config/m68k/m68k.h (REGISTER_MOVE_COST): Adjust. * config/mcore/mcore.h (REGISTER_MOVE_COST): Adjust. * config/mips/mips.h (REGISTER_MOVE_COST): Adjust. * config/mn10200/mn10200.h (REGISTER_MOVE_COST): Adjust. * config/mn10300/mn10300.h (REGISTER_MOVE_COST): Adjust. * config/ns32k/ns32k.h (REGISTER_MOVE_COST): Adjust. * config/pa/pa.h (REGISTER_MOVE_COST): Adjust. * config/pdp11/pdp11.h (REGISTER_MOVE_COST): Adjust. * config/pj/pj.h (REGISTER_MOVE_COST): Adjust. * config/romp/romp.h (REGISTER_MOVE_COST): Adjust. * config/rs6000/rs6000.h (REGISTER_MOVE_COST): Adjust. * config/sh/sh.h (REGISTER_MOVE_COST): Adjust. * config/sparc/sparc.h (REGISTER_MOVE_COST): Adjust. From-SVN: r38604
2001-01-02 01:59:52 +01:00
A C expression for the cost of moving data of mode @var{mode} from a
register in class @var{from} to one in class @var{to}. The classes are
expressed using the enumeration values such as @code{GENERAL_REGS}. A
value of 2 is the default; other values are interpreted relative to
that.
1996-09-25 01:21:45 +02:00
It is not required that the cost always equal 2 when @var{from} is the
same as @var{to}; on some machines it is expensive to move between
registers if they are not general registers.
If reload sees an insn consisting of a single @code{set} between two
hard registers, and if @code{REGISTER_MOVE_COST} applied to their
classes returns a value of 2, reload does not check to ensure that the
constraints of the insn are met. Setting a cost of other than 2 will
allow reload to verify that the constraints are met. You should do this
if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
2010-06-27 13:40:42 +02:00
These macros are obsolete, new ports should use the target hook
@code{TARGET_REGISTER_MOVE_COST} instead.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_REGISTER_MOVE_COST (machine_mode @var{mode}, reg_class_t @var{from}, reg_class_t @var{to})
2010-06-27 13:40:42 +02:00
This target hook should return the cost of moving data of mode @var{mode}
from a register in class @var{from} to one in class @var{to}. The classes
are expressed using the enumeration values such as @code{GENERAL_REGS}.
A value of 2 is the default; other values are interpreted relative to
that.
It is not required that the cost always equal 2 when @var{from} is the
same as @var{to}; on some machines it is expensive to move between
registers if they are not general registers.
If reload sees an insn consisting of a single @code{set} between two
hard registers, and if @code{TARGET_REGISTER_MOVE_COST} applied to their
classes returns a value of 2, reload does not check to ensure that the
constraints of the insn are met. Setting a cost of other than 2 will
allow reload to verify that the constraints are met. You should do this
if the @samp{mov@var{m}} pattern's constraints do not allow such copying.
The default version of this function returns 2.
@end deftypefn
@defmac MEMORY_MOVE_COST (@var{mode}, @var{class}, @var{in})
A C expression for the cost of moving data of mode @var{mode} between a
register of class @var{class} and memory; @var{in} is zero if the value
is to be written to memory, nonzero if it is to be read in. This cost
is relative to those in @code{REGISTER_MOVE_COST}. If moving between
registers and memory is more expensive than between two registers, you
should define this macro to express the relative cost.
If you do not define this macro, GCC uses a default cost of 4 plus
1998-05-06 23:09:07 +02:00
the cost of copying via a secondary reload register, if one is
needed. If your machine requires a secondary reload register to copy
between memory and a register of @var{class} but the reload mechanism is
more complex than copying via an intermediate, define this macro to
reflect the actual cost of the move.
GCC defines the function @code{memory_move_secondary_cost} if
secondary reloads are needed. It computes the costs due to copying via
a secondary register. If your machine copies from memory using a
secondary register in the conventional way but the default base value of
4 is not correct for your machine, define this macro to add some other
value to the result of that function. The arguments to that function
are the same as to this macro.
These macros are obsolete, new ports should use the target hook
@code{TARGET_MEMORY_MOVE_COST} instead.
@end defmac
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_MEMORY_MOVE_COST (machine_mode @var{mode}, reg_class_t @var{rclass}, bool @var{in})
This target hook should return the cost of moving data of mode @var{mode}
between a register of class @var{rclass} and memory; @var{in} is @code{false}
if the value is to be written to memory, @code{true} if it is to be read in.
2010-06-27 13:40:42 +02:00
This cost is relative to those in @code{TARGET_REGISTER_MOVE_COST}.
If moving between registers and memory is more expensive than between two
registers, you should add this target hook to express the relative cost.
If you do not add this target hook, GCC uses a default cost of 4 plus
the cost of copying via a secondary reload register, if one is
needed. If your machine requires a secondary reload register to copy
between memory and a register of @var{rclass} but the reload mechanism is
more complex than copying via an intermediate, use this target hook to
reflect the actual cost of the move.
GCC defines the function @code{memory_move_secondary_cost} if
secondary reloads are needed. It computes the costs due to copying via
a secondary register. If your machine copies from memory using a
secondary register in the conventional way but the default base value of
4 is not correct for your machine, use this target hook to add some other
value to the result of that function. The arguments to that function
are the same as to this target hook.
@end deftypefn
optabs.c (expand_abs_nojump): Update BRANCH_COST call. * optabs.c (expand_abs_nojump): Update BRANCH_COST call. * fold-cost.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop): Likewise. * dojump.c (do_jump): Likewise. * ifcvt.c (MAX_CONDITIONAL_EXECUTE): Likewise. (note-if_info): Add BRANCH_COST. (noce_try_store_flag_constants, noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove_arith, noce_try_cmove_arith, noce_try_cmove_arith, noce_find_if_block, find_if_case_1, find_if_case_2): Use compuated branch cost. * expr.h (BRANCH_COST): Update default. * predict.c (predictable_edge_p): New function. * expmed.c (expand_smod_pow2, expand_sdiv_pow2, emit_store_flag): Update BRANCH_COST call. * basic-block.h (predictable_edge_p): Declare. * config/alpha/alpha.h (BRANCH_COST): Update. * config/frv/frv.h (BRANCH_COST): Update. * config/s390/s390.h (BRANCH_COST): Update. * config/spu/spu.h (BRANCH_COST): Update. * config/sparc/sparc.h (BRANCH_COST): Update. * config/m32r/m32r.h (BRANCH_COST): Update. * config/i386/i386.h (BRANCH_COST): Update. * config/i386/i386.c (ix86_expand_int_movcc): Update use of BRANCH_COST. * config/sh/sh.h (BRANCH_COST): Update. * config/pdp11/pdp11.h (BRANCH_COST): Update. * config/avr/avr.h (BRANCH_COST): Update. * config/crx/crx.h (BRANCH_COST): Update. * config/xtensa/xtensa.h (BRANCH_COST): Update. * config/stormy16/stormy16.h (BRANCH_COST): Update. * config/m68hc11/m68hc11.h (BRANCH_COST): Update. * config/iq2000/iq2000.h (BRANCH_COST): Update. * config/ia64/ia64.h (BRANCH_COST): Update. * config/rs6000/rs6000.h (BRANCH_COST): Update. * config/arc/arc.h (BRANCH_COST): Update. * config/score/score.h (BRANCH_COST): Update. * config/arm/arm.h (BRANCH_COST): Update. * config/pa/pa.h (BRANCH_COST): Update. * config/mips/mips.h (BRANCH_COST): Update. * config/vax/vax.h (BRANCH_COST): Update. * config/h8300/h8300.h (BRANCH_COST): Update. * params.def (PARAM_PREDICTABLE_BRANCH_OUTCOME): New. * doc/invoke.texi (predictable-branch-cost-outcome): Document. * doc/tm.texi (BRANCH_COST): Update. From-SVN: r139804
2008-08-30 16:19:01 +02:00
@defmac BRANCH_COST (@var{speed_p}, @var{predictable_p})
A C expression for the cost of a branch instruction. A value of 1 is
the default; other values are interpreted relative to that. Parameter
@var{speed_p} is true when the branch in question should be optimized
for speed. When it is false, @code{BRANCH_COST} should return a value
optimal for code size rather than performance. @var{predictable_p} is
true for well-predicted branches. On many architectures the
@code{BRANCH_COST} can be reduced then.
@end defmac
1996-09-25 01:21:45 +02:00
Here are additional macros which do not specify precise relative costs,
but only that certain actions are more expensive than GCC would
1996-09-25 01:21:45 +02:00
ordinarily expect.
@defmac SLOW_BYTE_ACCESS
1996-09-25 01:21:45 +02:00
Define this macro as a C expression which is nonzero if accessing less
than a word of memory (i.e.@: a @code{char} or a @code{short}) is no
1996-09-25 01:21:45 +02:00
faster than accessing a word of memory, i.e., if such access
require more than one instruction or if there is no difference in cost
between byte and (aligned) word loads.
When this macro is not defined, the compiler will access a field by
finding the smallest containing object; when it is defined, a fullword
load will be used if alignment permits. Unless bytes accesses are
faster than word accesses, using word accesses is preferable since it
may eliminate subsequent memory access if subsequent accesses occur to
other fields in the same word of the structure, but to different bytes.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SLOW_UNALIGNED_ACCESS (@var{mode}, @var{alignment})
Define this macro to be the value 1 if memory accesses described by the
@var{mode} and @var{alignment} parameters have a cost many times greater
than aligned accesses, for example if they are emulated in a trap
handler.
1996-09-25 01:21:45 +02:00
When this macro is nonzero, the compiler will act as if
@code{STRICT_ALIGNMENT} were nonzero when generating code for block
1996-09-25 01:21:45 +02:00
moves. This can cause significantly more instructions to be produced.
Therefore, do not set this macro nonzero if unaligned accesses only add a
1996-09-25 01:21:45 +02:00
cycle or two to the time for a memory access.
If the value of this macro is always zero, it need not be defined. If
this macro is defined, it should produce a nonzero value when
@code{STRICT_ALIGNMENT} is nonzero.
@end defmac
1996-09-25 01:21:45 +02:00
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@defmac MOVE_RATIO (@var{speed})
The threshold of number of scalar memory-to-memory move insns, @emph{below}
which a sequence of insns should be generated instead of a
1996-09-25 01:21:45 +02:00
string move insn or a library call. Increasing the value will always
make code faster, but eventually incurs high cost in increased code size.
Note that on machines where the corresponding move insn is a
@code{define_expand} that emits a sequence of insns, this macro counts
the number of such sequences.
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
The parameter @var{speed} is true if the code is currently being
optimized for speed rather than size.
1996-09-25 01:21:45 +02:00
If you don't define this, a reasonable default is used.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_USE_BY_PIECES_INFRASTRUCTURE_P (unsigned int @var{size}, unsigned int @var{alignment}, enum by_pieces_operation @var{op}, bool @var{speed_p})
GCC will attempt several strategies when asked to copy between
two areas of memory, or to set, clear or store to memory, for example
when copying a @code{struct}. The @code{by_pieces} infrastructure
implements such memory operations as a sequence of load, store or move
insns. Alternate strategies are to expand the
@code{movmem} or @code{setmem} optabs, to emit a library call, or to emit
unit-by-unit, loop-based operations.
This target hook should return true if, for a memory operation with a
given @var{size} and @var{alignment}, using the @code{by_pieces}
infrastructure is expected to result in better code generation.
Both @var{size} and @var{alignment} are measured in terms of storage
units.
The parameter @var{op} is one of: @code{CLEAR_BY_PIECES},
@code{MOVE_BY_PIECES}, @code{SET_BY_PIECES}, @code{STORE_BY_PIECES}.
These describe the type of memory operation under consideration.
The parameter @var{speed_p} is true if the code is currently being
optimized for speed rather than size.
Returning true for higher values of @var{size} can improve code generation
for speed if the target does not provide an implementation of the
@code{movmem} or @code{setmem} standard names, if the @code{movmem} or
@code{setmem} implementation would be more expensive than a sequence of
insns, or if the overhead of a library call would dominate that of
the body of the memory operation.
Returning true for higher values of @code{size} may also cause an increase
in code size, for example where the number of insns emitted to perform a
move would be greater than that of a library call.
@end deftypefn
@defmac MOVE_MAX_PIECES
A C expression used by @code{move_by_pieces} to determine the largest unit
a load or store used to copy memory is. Defaults to @code{MOVE_MAX}.
@end defmac
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@defmac CLEAR_RATIO (@var{speed})
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to clear memory instead of a string clear insn
or a library call. Increasing the value will always make code faster, but
eventually incurs high cost in increased code size.
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
The parameter @var{speed} is true if the code is currently being
optimized for speed rather than size.
If you don't define this, a reasonable default is used.
@end defmac
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@defmac SET_RATIO (@var{speed})
2007-08-25 01:54:05 +02:00
The threshold of number of scalar move insns, @emph{below} which a sequence
of insns should be generated to set memory to a constant value, instead of
a block set insn or a library call.
2007-08-25 01:54:05 +02:00
Increasing the value will always make code faster, but
eventually incurs high cost in increased code size.
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
The parameter @var{speed} is true if the code is currently being
optimized for speed rather than size.
2007-08-25 01:54:05 +02:00
If you don't define this, it defaults to the value of @code{MOVE_RATIO}.
@end defmac
@defmac USE_LOAD_POST_INCREMENT (@var{mode})
A C expression used to determine whether a load postincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_INCREMENT}.
@end defmac
@defmac USE_LOAD_POST_DECREMENT (@var{mode})
A C expression used to determine whether a load postdecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_DECREMENT}.
@end defmac
@defmac USE_LOAD_PRE_INCREMENT (@var{mode})
A C expression used to determine whether a load preincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_INCREMENT}.
@end defmac
@defmac USE_LOAD_PRE_DECREMENT (@var{mode})
A C expression used to determine whether a load predecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_DECREMENT}.
@end defmac
@defmac USE_STORE_POST_INCREMENT (@var{mode})
A C expression used to determine whether a store postincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_INCREMENT}.
@end defmac
@defmac USE_STORE_POST_DECREMENT (@var{mode})
A C expression used to determine whether a store postdecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_POST_DECREMENT}.
@end defmac
@defmac USE_STORE_PRE_INCREMENT (@var{mode})
This macro is used to determine whether a store preincrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_INCREMENT}.
@end defmac
@defmac USE_STORE_PRE_DECREMENT (@var{mode})
This macro is used to determine whether a store predecrement is a good
thing to use for a given mode. Defaults to the value of
@code{HAVE_PRE_DECREMENT}.
@end defmac
@defmac NO_FUNCTION_CSE
1996-09-25 01:21:45 +02:00
Define this macro if it is as good or better to call a constant
function address than to call an address kept in a register.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LOGICAL_OP_NON_SHORT_CIRCUIT
Define this macro if a non-short-circuit operation produced by
@samp{fold_range_test ()} is optimal. This macro defaults to true if
@code{BRANCH_COST} is greater than or equal to the value 2.
@end defmac
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
@deftypefn {Target Hook} bool TARGET_RTX_COSTS (rtx @var{x}, int @var{code}, int @var{outer_code}, int @var{opno}, int *@var{total}, bool @var{speed})
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
This target hook describes the relative costs of RTL expressions.
The cost may depend on the precise form of the expression, which is
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
available for examination in @var{x}, and the fact that @var{x} appears
as operand @var{opno} of an expression with rtx code @var{outer_code}.
That is, the hook can assume that there is some rtx @var{y} such
that @samp{GET_CODE (@var{y}) == @var{outer_code}} and such that
either (a) @samp{XEXP (@var{y}, @var{opno}) == @var{x}} or
(b) @samp{XVEC (@var{y}, @var{opno})} contains @var{x}.
@var{code} is @var{x}'s expression code---redundant, since it can be
obtained with @code{GET_CODE (@var{x})}.
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
In implementing this hook, you can use the construct
@code{COSTS_N_INSNS (@var{n})} to specify a cost equal to @var{n} fast
instructions.
On entry to the hook, @code{*@var{total}} contains a default estimate
for the cost of the expression. The hook should modify this value as
necessary. Traditionally, the default costs are @code{COSTS_N_INSNS (5)}
for multiplications, @code{COSTS_N_INSNS (7)} for division and modulus
operations, and @code{COSTS_N_INSNS (1)} for all other operations.
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
When optimizing for code size, i.e.@: when @code{speed} is
false, this target hook should be used to estimate the relative
size cost of an expression, again relative to @code{COSTS_N_INSNS}.
Makefile.in (cse.o): Depend on TARGET_H. * Makefile.in (cse.o): Depend on TARGET_H. * cse.c (rtx_cost): Use targetm.rtx_costs. * system.h (CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS): Poison. * doc/tm.texi: Update. * target.h (targetm.rtx_costs): New. * target-def.h (TARGET_RTX_COSTS): New. * hooks.c (hook_bool_rtx_int_int_intp_false): New. * hooks.h: Update. * config/alpha/alpha.c (alpha_rtx_cost_data): New. (alpha_rtx_costs, TARGET_RTX_COSTS): New. * config/alpha/alpha.h (PROCESSOR_MAX): New. (CONST_COSTS, RTX_COSTS): Remove. * config/arc/arc.c, config/arc/arc.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris.c, config/cris/cris.h, config/d30v/d30v.c, config/d30v/d30v.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/frv/frv.c, config/frv/frv.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960.c, config/i960/i960.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68k/m68k.c, config/m68k/m68k.h, config/m88k/m88k.c, config/m88k/m88k.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mips/mips.h, config/mn10200/mn10200.c, config/mn10200/mn10200.h, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/pdp11/pdp11.c, config/pdp11/pdp11.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (CONST_COSTS, RTX_COSTS): Move code ... (foo_rtx_costs, TARGET_RTX_COSTS): ... here. * config/arm/arm.c (arm_rtx_costs_1): Rename from arm_rtx_costs. (arm_rtx_costs, TARGET_RTX_COSTS): New. * config/arm/arm-protos.h: Update. * config/arm/arm.h (DEFAULT_RTX_COSTS): Remove. * config/avr/avr.h (CONST_COSTS): Move code ... * config/avr/avr.c (avr_rtx_costs): ... here. (default_rtx_costs): Make static. * config/avr/avr-protos.h: Update. * config/h8300/h8300.c (const_costs): Make static. (h8300_and_costs, h8300_shift_costs): Likewise. * config/h8300/h8300-protos.h: Update. * config/ip2k/ip2k.h (DEFAULT_RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/ip2k/ip2k.c (ip2k_rtx_costs): ... here. Rename from default_rtx_costs; update for signature change. * config/ip2k/ip2k-protos.h: Update. * config/m68hc11/m68hc11.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/m68hc11/m68hc11.c (m68hc11_rtx_costs): ... here. (TARGET_RTX_COSTS): New. (m68hc11_rtx_costs_1): Rename from m68hc11_rtx_costs; make static. * config/m68hc11/m68hc11-protos.h: Update. * config/m68k/m68k.c (const_int_cost): Make static. * config/m68k/m68k-protos.h: Update. * config/mcore/mcore.c (mcore_const_costs): Make static. (mcore_and_cost, mcore_ior_cost): Likewise. * config/mcore/mcore-protos.h: Update. * config/mmix/mmix.c (mmix_rtx_costs, TARGET_RTX_COSTS): New. (mmix_rtx_cost_recalculated): Remove. * config/mmix/mmix.h (DEFAULT_RTX_COSTS): Remove. * config/mmix/mmix-protos.h: Update. * config/sh/sh.c (shiftcosts): Make static. (addsubcosts, andcosts, multcosts): Likewise. * config/sh/sh-protos.h: Update. * config/sparc/sparc.c (TARGET_RTX_COSTS): New. (sparc_rtx_costs): Make static; update for change in signature. * config/sparc/sparc.h (RTX_COSTS_CASES, RTX_COSTS): Remove. * config/sparc/sparc-protos.h: Update. * config/v850/v850.c (const_costs): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.h (RTX_COSTS): Remove. (CONST_COSTS): Move code ... * config/vax/vax.c (vax_rtx_costs_1): ... here; rename from vax_rtx_cost. (vax_rtx_costs, TARGET_RTX_COSTS): New. From-SVN: r61954
2003-01-28 05:46:33 +01:00
The hook returns true when all subexpressions of @var{x} have been
processed, and false when @code{rtx_cost} should recurse.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_ADDRESS_COST (rtx @var{address}, machine_mode @var{mode}, addr_space_t @var{as}, bool @var{speed})
target.h (targetm.address_cost): New. * target.h (targetm.address_cost): New. * target-def.h (TARGET_ADDRESS_COST): New. (TARGET_RTX_COSTS): Uncomment. Oops. * cse.c (address_cost): Use new target hook. (default_address_cost): New. * output.h (default_address_cost): Declare. * hooks.c (hook_int_rtx_0): New. * hooks.h (hook_int_rtx_0): Declare. * loop.c (combine_givs_p): Remove if 0 code. * system.h (ADDRESS_COST): Poison. * config/alpha/alpha.c, config/alpha/alpha.h, config/d30v/d30v.c, config/d30v/d30v.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h (TARGET_ADDRESS_COST): Define as hook_int_rtx_0. (ADDRESS_COST): Remove. * config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c, config/dsp16xx/dsp16xx.h, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h, config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h, config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c, config/ip2k/ip2k.h, config/mips/mips-protos.h, config/mips/mips.c, config/mips/mips.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa-protos.h, config/pa/pa.c, config/pa/pa.h, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h (foo_address_cost): Make static. (TARGET_ADDRESS_COST): New. (ADDRESS_COST): Remove. * config/arm/arm.h, config/arm/arm.c, config/m88k/m88k.h, config/m88k/m88k.c, config/romp/romp.h, config/romp/romp.c, config/sh/sh.c, config/sh/sh.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h (ADDRESS_COST): Move code ... (foo_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/m32r/m32r.c (m32r_address_cost): Remove. * config/m32r/m32r-protos.h: Update. * config/mmix/mmix.c (mmix_address_cost): Remove. * config/mmix/mmix-protos.h: Update. * config/mn10300/mn10300.c (mn10300_address_cost_1): Rename from mn10300_address_cost; move unsig allocation ... (mn10300_address_cost): ... here. (TARGET_ADDRESS_COST): New. * config/mn10300/mn10300-protos.h: Update. * config/mn10300/mn10300.h (ADDRESS_COST): Remove. From-SVN: r61989
2003-01-28 19:14:42 +01:00
This hook computes the cost of an addressing mode that contains
@var{address}. If not defined, the cost is computed from
the @var{address} expression and the @code{TARGET_RTX_COST} hook.
For most CISC machines, the default cost is a good approximation of the
true cost of the addressing mode. However, on RISC machines, all
instructions normally have the same length and execution time. Hence
all addresses will have equal costs.
In cases where more than one form of an address is known, the form with
the lowest cost will be used. If multiple forms have the same, lowest,
cost, the one that is the most complex will be used.
For example, suppose an address that is equal to the sum of a register
and a constant is used twice in the same basic block. When this macro
is not defined, the address will be computed in a register and memory
references will be indirect through that register. On machines where
the cost of the addressing mode containing the sum is no higher than
that of a simple indirect reference, this will produce an additional
instruction and possibly require an additional register. Proper
specification of this macro eliminates this overhead for such machines.
This hook is never called with an invalid address.
On machines where an address involving more than one register is as
cheap as an address computation involving only one register, defining
@code{TARGET_ADDRESS_COST} to reflect this can cause two registers to
be live over a region of code where only one would have been if
@code{TARGET_ADDRESS_COST} were not defined in that manner. This effect
should be considered in the definition of this macro. Equivalent costs
should probably only be given to addresses with different numbers of
registers on machines with lots of registers.
@end deftypefn
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@node Scheduling
@section Adjusting the Instruction Scheduler
The instruction scheduler may need a fair amount of machine-specific
adjustment in order to produce good code. GCC provides several target
hooks for this purpose. It is usually enough to define just a few of
them: try the first ones in this list first.
@deftypefn {Target Hook} int TARGET_SCHED_ISSUE_RATE (void)
This hook returns the maximum number of instructions that can ever
issue at the same time on the target machine. The default is one.
Although the insn scheduler can define itself the possibility of issue
an insn on the same cycle, the value can serve as an additional
constraint to issue insns on the same simulated processor cycle (see
hooks @samp{TARGET_SCHED_REORDER} and @samp{TARGET_SCHED_REORDER2}).
This value must be constant over the entire compilation. If you need
it to vary depending on what the instructions are, you must use
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@samp{TARGET_SCHED_VARIABLE_ISSUE}.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_VARIABLE_ISSUE (FILE *@var{file}, int @var{verbose}, rtx_insn *@var{insn}, int @var{more})
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
This hook is executed by the scheduler after it has scheduled an insn
from the ready list. It should return the number of insns which can
still be issued in the current cycle. The default is
@samp{@w{@var{more} - 1}} for insns other than @code{CLOBBER} and
@code{USE}, which normally are not counted against the issue rate.
You should define this hook if some insns take more machine resources
than others, so that fewer insns can follow them in the same cycle.
@var{file} is either a null pointer, or a stdio stream to write any
debug output to. @var{verbose} is the verbose level provided by
@option{-fsched-verbose-@var{n}}. @var{insn} is the instruction that
was scheduled.
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_ADJUST_COST (rtx_insn *@var{insn}, rtx @var{link}, rtx_insn *@var{dep_insn}, int @var{cost})
This function corrects the value of @var{cost} based on the
relationship between @var{insn} and @var{dep_insn} through the
dependence @var{link}. It should return the new value. The default
is to make no adjustment to @var{cost}. This can be used for example
to specify to the scheduler using the traditional pipeline description
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
that an output- or anti-dependence does not incur the same cost as a
data-dependence. If the scheduler using the automaton based pipeline
description, the cost of anti-dependence is zero and the cost of
output-dependence is maximum of one and the difference of latency
times of the first and the second insns. If these values are not
acceptable, you could use the hook to modify them too. See also
genattr.c (struct range, [...]): Remove them. 2004-07-19 Paolo Bonzini <bonzini@gnu.org> * genattr.c (struct range, struct function_unit, write_units, extend_range, init_range): Remove them. (main): Remove code dealing with DEFINE_FUNCTION_UNIT. Output "#define INSN_SCHEDULING" here. * genattrtab.c (struct range, struct function_unit_op, struct function_unit, struct dimension, enum operator, operate_exp, expand_units, simplify_knowing, encode_units_mask, simplify_by_exploding, find_and_mark_used_attributes, unmark_used_attributes, add_values_to_cover, increment_current_value, test_for_current_value, simplify_with_current_value, simplify_with_current_value_aux, gen_unit, write_unit_name, write_function_unit_info, write_complex_function, write_toplevel_expr, find_single_value, extend_range): Remove. (write_attr_get): Do not handle common_av->value being an FFS. (struct attr_desc): Remove func_units_p and blockage_p. (write_attr_valueq): Do not handle them. (find_attr): Do not clear them. (make_internal_attr): Do not initialize them. (main): Remove code dealing with DEFINE_FUNCTION_UNIT. * sched-vis.c (init_target_units, insn_print_units, init_block_visualization, print_block_visualization, visualize_scheduled_insns, visualize_no_unit, visualize_stall_cycles, visualize_alloc, visualize_free, target_units, get_visual_tbl_length, MAX_VISUAL_LINES, INSN_LEN, n_visual_lines, visual_tbl_line_length, visual_tbl, n_vis_no_unit, MAX_VISUAL_NO_UNIT, vis_no_unit): Remove. * haifa-sched.c (blockage_range, clear_units, schedule_unit, actual_hazard, potential_hazard, insn_unit, unit_last_insn, unit_tick, actual_hazard_this_instance, potential_hazard, schedule_unit, max_insn_queue_index_value): Remove. (MAX_INSN_QUEUE_INDEX): Removed, renamed throughout to max_insn_queue_index. * rtl.def (DEFINE_FUNCTION_UNIT): Remove. * doc/md.texi (Processor pipeline description): Remove references to old pipeline descriptions. (Automaton pipeline description): Merge with the above. (Old pipeline description, Comparison of the two descriptions): Remove. * bt-load.c (migrate_btr_def): Remove references to use_pipeline_interface. * haifa-sched.c (insn_cost, schedule_insn, schedule_block, advance_one_cycle, sched_init, queue_to_ready, sched_finish): Likewise. * modulo-sched.c (sms_schedule, advance_one_cycle, ps_has_conflicts): Likewise. * sched-rgn.c (init_ready): Likewise. (debug_dependencies): Likewise, and remove an "if (1)". * target.h (use_dfa_pipeline_interface): Remove. * config/alpha/alpha.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/arc/arc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/arm/arm.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/c4x/c4x.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/frv/frv.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/i386/i386.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/ia64/ia64.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/iq2000/iq2000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/m32r/m32r.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/mcore/mcore.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/mips/mips.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/pa/pa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/rs6000/rs6000.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/s390/s390.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/sh/sh.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/sparc/sparc.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/v850/v850.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * config/xtensa/xtensa.c (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. * doc/tm.texi (TARGET_USE_DFA_PIPELINE_INTERFACE): Remove. From-SVN: r84944
2004-07-20 09:27:18 +02:00
@pxref{Processor pipeline description}.
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_ADJUST_PRIORITY (rtx_insn *@var{insn}, int @var{priority})
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
This hook adjusts the integer scheduling priority @var{priority} of
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
@var{insn}. It should return the new priority. Increase the priority to
execute @var{insn} earlier, reduce the priority to execute @var{insn}
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
later. Do not define this hook if you do not need to adjust the
scheduling priorities of insns.
@end deftypefn
Strengthen haifa_sched_info callbacks and 3 scheduler hooks gcc/ * target.def (reorder): Strengthen param "ready" of this DEFHOOK from rtx * to rtx_insn **. (reorder2): Likewise. (dependencies_evaluation_hook): Strengthen params "head", "tail" from rtx to rtx_insn *. * doc/tm.texi: Update mechanically for above change to target.def. * sched-int.h (note_list): Strengthen this variable from rtx to rtx_insn *. (remove_notes): Likewise for both params. (restore_other_notes): Likewise for return type and first param. (struct ready_list): Strengthen field "vec" from rtx * to rtx_insn **. (struct dep_replacement): Strenghten field "insn" from rtx to rtx_insn *. (struct deps_desc): Likewise for fields "last_debug_insn", "last_args_size". (struct haifa_sched_info): Likewise for callback field "can_schedule_ready_p"'s param, for first param of "new_ready" callback field, for both params of "rank" callback field, for first field of "print_insn" callback field (with a const), for both params of "contributes_to_priority" callback, for param of "insn_finishes_block_p" callback, for fields "prev_head", "next_tail", "head", "tail", for first param of "add_remove_insn" callback, for first param of "begin_schedule_ready" callback, for both params of "begin_move_insn" callback, and for second param of "advance_target_bb" callback. (add_dependence): Likewise for params 1 and 2. (sched_analyze): Likewise for params 2 and 3. (deps_analyze_insn): Likewise for param 2. (ready_element): Likewise for return type. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (try_ready): Strenghten param from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (record_delay_slot_pair): Likewise for params 1 and 2. (add_delay_dependencies): Likewise for param. (contributes_to_priority): Likewise for both params. (find_modifiable_mems): Likewise. * config/arm/arm.c (cortexa7_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "insn", "first_older_only_insn" from rtx to rtx_insn *. (arm_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. * config/c6x/c6x.c (struct c6x_sched_context): Strengthen field "last_scheduled_iter0" from rtx to rtx_insn *. (init_sched_state): Replace use of NULL_RTX with NULL for insn. (c6x_sched_reorder_1): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (c6x_sched_reorder2): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_variable_issue): Add a checked cast when assigning from insn to ss.last_scheduled_iter0. (split_delayed_branch): Strengthen param "insn" and local "i1" from rtx to rtx_insn *. (split_delayed_nonbranch): Likewise. (undo_split_delayed_nonbranch): Likewise for local "insn". (hwloop_optimize): Likewise for locals "seq", "insn", "prev", "entry_after", "end_packet", "head_insn", "tail_insn", "new_insns", "last_insn", "this_iter", "prev_stage_insn". Strengthen locals "orig_vec", "copies", "insn_copies" from rtx * to rtx_insn **. Remove now-redundant checked cast on last_insn, but add a checked cast on loop->start_label. Consolidate calls to avoid assigning result of gen_spkernel to "insn", now an rtx_insn *. * config/i386/i386.c (do_reorder_for_imul): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (swap_top_of_ready_list): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "top", "next" from rtx to rtx_insn *. (ix86_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (add_parameter_dependencies): Strengthen params "call", "head" and locals "insn", "last", "first_arg" from rtx to rtx_insn *. (avoid_func_arg_motion): Likewise for params "first_arg", "insn". (add_dependee_for_func_arg): Likewise for param "arg" and local "insn". (ix86_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "first_arg". * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "next", "next_tail". (ia64_dfa_sched_reorder): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen locals "insn", "lowest", "highest" from rtx to rtx_insn *. (ia64_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (ia64_sched_reorder2): Likewise. * config/mep/mep.c (mep_find_ready_insn): Strengthen return type and local "insn" from rtx to rtx_insn *. Strengthen param "ready" from rtx * to rtx_insn **. (mep_move_ready_insn): Strengthen param "ready" from rtx * to rtx_insn **. (mep_print_sched_insn): Strengthen param "insn" from rtx to rtx_insn *. (mep_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "core_insn", "cop_insn" from rtx to rtx_insn *. * config/mips/mips.c (mips_promote_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "new_head" from rtx to rtx_insn *. (mips_maybe_swap_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "temp" from rtx to rtx_insn *. (mips_macc_chains_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (vr4130_reorder): Likewise. (mips_74k_agen_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. (mips_sched_reorder_1): Strengthen param "ready" from rtx * to rtx_insn **. (mips_sched_reorder): Likewise. (mips_sched_reorder2): Likewise. * config/picochip/picochip.c (picochip_sched_reorder): Likewise. * config/rs6000/rs6000.c (rs6000_sched_reorder): Likewise. Strengthen local "tmp" from rtx to rtx_insn *. (rs6000_sched_reorder2): Likewise. * config/s390/s390.c (s390_z10_prevent_earlyload_conflicts): Likewise. Update sizeof(rtx) to sizeof(rtx_insn *) in memmove. (s390_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "tmp" from rtx to rtx_insn *. * config/sh/sh.c (rank_for_reorder): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_reorder): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (ready_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Update sizeof(rtx) to sizeof(rtx_insn *) in qsort. (sh_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (sh_reorder2): Likewise. * config/spu/spu.c (spu_sched_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. * haifa-sched.c (note_list): Strengthen this variable from rtx to rtx_insn *. (scheduled_insns): Strengthen this variable from vec<rtx> to vec<rtx_insn *>. (set_modulo_params): Likewise for locals "i1", "i2". (record_delay_slot_pair): Likewise for params "i1", "i2". (add_delay_dependencies): Likewise for param "insn". (cond_clobbered_p): Likewise. (recompute_todo_spec): Likewise for local "prev". (last_scheduled_insn): Likewise for this variable. (nonscheduled_insns_begin): Likewise. (model_set_excess_costs): Strengthen param "insns" from rtx * to rtx_insn **. (rank_for_schedule): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_sort): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (queue_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (ready_add): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first): Likewise for return type and local "t". (ready_element): Likewise for return type. (ready_remove): Likewise for return type and local "t". (ready_sort): Strengthen local "first" from rtx * to rtx_insn **. (check_clobbered_conditions): Strengthen local "x" from rtx to rtx_insn *, adding a checked cast. (schedule_insn): Likewise for param "insn". (remove_notes): Likewise for params "head", "tail" and locals "next_tail", "insn", "next". (struct haifa_saved_data): Likewise for fields "last_scheduled_insn", "nonscheduled_insns_begin". (save_backtrack_point): Update for change to field "vec" of struct ready_list. (toggle_cancelled_flags): Strengthen local "first" from rtx * to rtx_insn **. (restore_last_backtrack_point): Likewise. Strengthen local "insn" from rtx to rtx_insn * (resolve_dependencies): Strengthen param "insn" from rtx to rtx_insn * (restore_other_notes): Likewise for return type, for param "head" and local "note_head". (undo_all_replacements): Likewise for local "insn". (first_nonscheduled_insn): Likewise for return type and local "insn". (queue_to_ready): Likewise for local "insn", adding checked casts. (early_queue_to_ready): Likewise for local "insn". (debug_ready_list_1): Strengthen local "p" from rtx * to rtx_insn **. (move_insn): Strengthen param "insn" and local "note" from rtx to rtx_insn * (insn_finishes_cycle_p): Likewise for param "insn". (max_issue): Likewise for local "insn". (choose_ready): Likewise. Strengthen param "insn_ptr" from rtx * to rtx_insn **. (commit_schedule): Strengthen param "prev_head" and local "insn" from rtx to rtx_insn * (prune_ready_list): Likewise for local "insn". (schedule_block): Likewise for locals "prev_head", "head", "tail", "skip_insn", "insn", "failed_insn", "x", adding a checked cast. (set_priorities): Likewise for local "prev_head". (try_ready): Likewise for param "next". (fix_tick_ready): Likewise. (change_queue_index): Likewise. (sched_extend_ready_list): Update for change to field "vec" of struct ready_list. (generate_recovery_code): Strengthen param "insn" from rtx to rtx_insn *. (begin_speculative_block): Likewise. (create_check_block_twin): Likewise for param "insn" and locals "label", "check", "twin". Introduce local "check_pat" to avoid "check" being used as a plain rtx before being used as an insn. (fix_recovery_deps): Add a checked cast to rtx_insn * when extracting elements from ready_list. (sched_remove_insn): Strengthen param "insn" from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (ready_remove_first_dispatch): Likewise for return type and local "insn". * hw-doloop.c (discover_loop): Add a checked cast to rtx_insn *. * modulo-sched.c (sms_print_insn): Strengthen from const_rtx to const rtx_insn *. * sched-deps.c (add_dependence): Strengthen params "con", "pro" from rtx to rtx_insn *. (add_dependence_list): Likewise for param "insn". Add a checked cast. (add_dependence_list_and_free): Strengthen param "insn" from rtx to rtx_insn *. Strengthen param "list_p" from rtx * to rtx_insn **. (chain_to_prev_insn): Strengthen param "insn" and locals "prec_nonnote", "i" from rtx to rtx_insn *. (flush_pending_lists): Likewise for param "insn". (cur_insn): Likewise for this variable. (haifa_start_insn): Add a checked cast. (note_dep): Strengthen param "e" from rtx to rtx_insn *. (sched_analyze_reg): Likewise for param "insn". (sched_analyze_1): Likewise. (sched_analyze_2): Likewise. Add checked casts. (sched_analyze_insn): Likewise. Also for local "prev". (deps_analyze_insn): Likewise for param "insn". (sched_analyze): Likewise for params "head", "tail" and local "insn". (add_dependence_1): Likewise for params "insn", "elem". (struct mem_inc_info): Likewise for fields "inc_insn", "mem_insn". (parse_add_or_inc): Likewise for param "insn". (find_inc): Likewise for local "inc_cand". (find_modifiable_mems): Likewise for params "head", "tail" and locals "insn", "next_tail". * sched-ebb.c (init_ready_list): Likewise for local "insn". (begin_schedule_ready): Likewise for param "insn". (begin_move_insn): Likewise for params "insn" and "last". (ebb_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. (rank): Strengthen params "insn1", "insn2" from rtx to rtx_insn *. (ebb_contributes_to_priority): Likewise for params "next", "insn". (ebb_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sched-rgn.c (rgn_estimate_number_of_insns): Likewise for local "insn". (check_live): Likewise for param "insn". (init_ready_list): Likewise for local "insn". (can_schedule_ready_p): Likewise for param "insn". (begin_schedule_ready): Likewise. (new_ready): Likewise for param "next". (rgn_print_insn): Likewise for param "insn". (rgn_rank): Likewise for params "insn1", "insn2". (contributes_to_priority): Likewise for params "next", "insn". (rgn_insn_finishes_block_p): Likewise for param "insn". (add_branch_dependences): Likewise for params "head", "tail" and locals "insn", "last". (rgn_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sel-sched-dump.c (sel_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. * sel-sched-dump.h (sel_print_insn): Likewise. * sel-sched-ir.c (advance_deps_context): Add a checked cast. (deps_init_id): Likewise. * sel-sched.c (convert_vec_av_set_to_ready): Likewise. (invoke_reorder_hooks): Strengthen local "arr" from rtx * to rtx_insn **. From-SVN: r214481
2014-08-25 23:19:23 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_REORDER (FILE *@var{file}, int @var{verbose}, rtx_insn **@var{ready}, int *@var{n_readyp}, int @var{clock})
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
This hook is executed by the scheduler after it has scheduled the ready
list, to allow the machine description to reorder it (for example to
combine two small instructions together on @samp{VLIW} machines).
@var{file} is either a null pointer, or a stdio stream to write any
debug output to. @var{verbose} is the verbose level provided by
@option{-fsched-verbose-@var{n}}. @var{ready} is a pointer to the ready
list of instructions that are ready to be scheduled. @var{n_readyp} is
a pointer to the number of elements in the ready list. The scheduler
reads the ready list in reverse order, starting with
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@var{ready}[@var{*n_readyp} @minus{} 1] and going to @var{ready}[0]. @var{clock}
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
is the timer tick of the scheduler. You may modify the ready list and
the number of ready insns. The return value is the number of insns that
can issue this cycle; normally this is just @code{issue_rate}. See also
@samp{TARGET_SCHED_REORDER2}.
@end deftypefn
Strengthen haifa_sched_info callbacks and 3 scheduler hooks gcc/ * target.def (reorder): Strengthen param "ready" of this DEFHOOK from rtx * to rtx_insn **. (reorder2): Likewise. (dependencies_evaluation_hook): Strengthen params "head", "tail" from rtx to rtx_insn *. * doc/tm.texi: Update mechanically for above change to target.def. * sched-int.h (note_list): Strengthen this variable from rtx to rtx_insn *. (remove_notes): Likewise for both params. (restore_other_notes): Likewise for return type and first param. (struct ready_list): Strengthen field "vec" from rtx * to rtx_insn **. (struct dep_replacement): Strenghten field "insn" from rtx to rtx_insn *. (struct deps_desc): Likewise for fields "last_debug_insn", "last_args_size". (struct haifa_sched_info): Likewise for callback field "can_schedule_ready_p"'s param, for first param of "new_ready" callback field, for both params of "rank" callback field, for first field of "print_insn" callback field (with a const), for both params of "contributes_to_priority" callback, for param of "insn_finishes_block_p" callback, for fields "prev_head", "next_tail", "head", "tail", for first param of "add_remove_insn" callback, for first param of "begin_schedule_ready" callback, for both params of "begin_move_insn" callback, and for second param of "advance_target_bb" callback. (add_dependence): Likewise for params 1 and 2. (sched_analyze): Likewise for params 2 and 3. (deps_analyze_insn): Likewise for param 2. (ready_element): Likewise for return type. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (try_ready): Strenghten param from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (record_delay_slot_pair): Likewise for params 1 and 2. (add_delay_dependencies): Likewise for param. (contributes_to_priority): Likewise for both params. (find_modifiable_mems): Likewise. * config/arm/arm.c (cortexa7_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "insn", "first_older_only_insn" from rtx to rtx_insn *. (arm_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. * config/c6x/c6x.c (struct c6x_sched_context): Strengthen field "last_scheduled_iter0" from rtx to rtx_insn *. (init_sched_state): Replace use of NULL_RTX with NULL for insn. (c6x_sched_reorder_1): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (c6x_sched_reorder2): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_variable_issue): Add a checked cast when assigning from insn to ss.last_scheduled_iter0. (split_delayed_branch): Strengthen param "insn" and local "i1" from rtx to rtx_insn *. (split_delayed_nonbranch): Likewise. (undo_split_delayed_nonbranch): Likewise for local "insn". (hwloop_optimize): Likewise for locals "seq", "insn", "prev", "entry_after", "end_packet", "head_insn", "tail_insn", "new_insns", "last_insn", "this_iter", "prev_stage_insn". Strengthen locals "orig_vec", "copies", "insn_copies" from rtx * to rtx_insn **. Remove now-redundant checked cast on last_insn, but add a checked cast on loop->start_label. Consolidate calls to avoid assigning result of gen_spkernel to "insn", now an rtx_insn *. * config/i386/i386.c (do_reorder_for_imul): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (swap_top_of_ready_list): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "top", "next" from rtx to rtx_insn *. (ix86_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (add_parameter_dependencies): Strengthen params "call", "head" and locals "insn", "last", "first_arg" from rtx to rtx_insn *. (avoid_func_arg_motion): Likewise for params "first_arg", "insn". (add_dependee_for_func_arg): Likewise for param "arg" and local "insn". (ix86_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "first_arg". * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "next", "next_tail". (ia64_dfa_sched_reorder): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen locals "insn", "lowest", "highest" from rtx to rtx_insn *. (ia64_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (ia64_sched_reorder2): Likewise. * config/mep/mep.c (mep_find_ready_insn): Strengthen return type and local "insn" from rtx to rtx_insn *. Strengthen param "ready" from rtx * to rtx_insn **. (mep_move_ready_insn): Strengthen param "ready" from rtx * to rtx_insn **. (mep_print_sched_insn): Strengthen param "insn" from rtx to rtx_insn *. (mep_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "core_insn", "cop_insn" from rtx to rtx_insn *. * config/mips/mips.c (mips_promote_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "new_head" from rtx to rtx_insn *. (mips_maybe_swap_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "temp" from rtx to rtx_insn *. (mips_macc_chains_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (vr4130_reorder): Likewise. (mips_74k_agen_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. (mips_sched_reorder_1): Strengthen param "ready" from rtx * to rtx_insn **. (mips_sched_reorder): Likewise. (mips_sched_reorder2): Likewise. * config/picochip/picochip.c (picochip_sched_reorder): Likewise. * config/rs6000/rs6000.c (rs6000_sched_reorder): Likewise. Strengthen local "tmp" from rtx to rtx_insn *. (rs6000_sched_reorder2): Likewise. * config/s390/s390.c (s390_z10_prevent_earlyload_conflicts): Likewise. Update sizeof(rtx) to sizeof(rtx_insn *) in memmove. (s390_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "tmp" from rtx to rtx_insn *. * config/sh/sh.c (rank_for_reorder): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_reorder): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (ready_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Update sizeof(rtx) to sizeof(rtx_insn *) in qsort. (sh_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (sh_reorder2): Likewise. * config/spu/spu.c (spu_sched_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. * haifa-sched.c (note_list): Strengthen this variable from rtx to rtx_insn *. (scheduled_insns): Strengthen this variable from vec<rtx> to vec<rtx_insn *>. (set_modulo_params): Likewise for locals "i1", "i2". (record_delay_slot_pair): Likewise for params "i1", "i2". (add_delay_dependencies): Likewise for param "insn". (cond_clobbered_p): Likewise. (recompute_todo_spec): Likewise for local "prev". (last_scheduled_insn): Likewise for this variable. (nonscheduled_insns_begin): Likewise. (model_set_excess_costs): Strengthen param "insns" from rtx * to rtx_insn **. (rank_for_schedule): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_sort): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (queue_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (ready_add): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first): Likewise for return type and local "t". (ready_element): Likewise for return type. (ready_remove): Likewise for return type and local "t". (ready_sort): Strengthen local "first" from rtx * to rtx_insn **. (check_clobbered_conditions): Strengthen local "x" from rtx to rtx_insn *, adding a checked cast. (schedule_insn): Likewise for param "insn". (remove_notes): Likewise for params "head", "tail" and locals "next_tail", "insn", "next". (struct haifa_saved_data): Likewise for fields "last_scheduled_insn", "nonscheduled_insns_begin". (save_backtrack_point): Update for change to field "vec" of struct ready_list. (toggle_cancelled_flags): Strengthen local "first" from rtx * to rtx_insn **. (restore_last_backtrack_point): Likewise. Strengthen local "insn" from rtx to rtx_insn * (resolve_dependencies): Strengthen param "insn" from rtx to rtx_insn * (restore_other_notes): Likewise for return type, for param "head" and local "note_head". (undo_all_replacements): Likewise for local "insn". (first_nonscheduled_insn): Likewise for return type and local "insn". (queue_to_ready): Likewise for local "insn", adding checked casts. (early_queue_to_ready): Likewise for local "insn". (debug_ready_list_1): Strengthen local "p" from rtx * to rtx_insn **. (move_insn): Strengthen param "insn" and local "note" from rtx to rtx_insn * (insn_finishes_cycle_p): Likewise for param "insn". (max_issue): Likewise for local "insn". (choose_ready): Likewise. Strengthen param "insn_ptr" from rtx * to rtx_insn **. (commit_schedule): Strengthen param "prev_head" and local "insn" from rtx to rtx_insn * (prune_ready_list): Likewise for local "insn". (schedule_block): Likewise for locals "prev_head", "head", "tail", "skip_insn", "insn", "failed_insn", "x", adding a checked cast. (set_priorities): Likewise for local "prev_head". (try_ready): Likewise for param "next". (fix_tick_ready): Likewise. (change_queue_index): Likewise. (sched_extend_ready_list): Update for change to field "vec" of struct ready_list. (generate_recovery_code): Strengthen param "insn" from rtx to rtx_insn *. (begin_speculative_block): Likewise. (create_check_block_twin): Likewise for param "insn" and locals "label", "check", "twin". Introduce local "check_pat" to avoid "check" being used as a plain rtx before being used as an insn. (fix_recovery_deps): Add a checked cast to rtx_insn * when extracting elements from ready_list. (sched_remove_insn): Strengthen param "insn" from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (ready_remove_first_dispatch): Likewise for return type and local "insn". * hw-doloop.c (discover_loop): Add a checked cast to rtx_insn *. * modulo-sched.c (sms_print_insn): Strengthen from const_rtx to const rtx_insn *. * sched-deps.c (add_dependence): Strengthen params "con", "pro" from rtx to rtx_insn *. (add_dependence_list): Likewise for param "insn". Add a checked cast. (add_dependence_list_and_free): Strengthen param "insn" from rtx to rtx_insn *. Strengthen param "list_p" from rtx * to rtx_insn **. (chain_to_prev_insn): Strengthen param "insn" and locals "prec_nonnote", "i" from rtx to rtx_insn *. (flush_pending_lists): Likewise for param "insn". (cur_insn): Likewise for this variable. (haifa_start_insn): Add a checked cast. (note_dep): Strengthen param "e" from rtx to rtx_insn *. (sched_analyze_reg): Likewise for param "insn". (sched_analyze_1): Likewise. (sched_analyze_2): Likewise. Add checked casts. (sched_analyze_insn): Likewise. Also for local "prev". (deps_analyze_insn): Likewise for param "insn". (sched_analyze): Likewise for params "head", "tail" and local "insn". (add_dependence_1): Likewise for params "insn", "elem". (struct mem_inc_info): Likewise for fields "inc_insn", "mem_insn". (parse_add_or_inc): Likewise for param "insn". (find_inc): Likewise for local "inc_cand". (find_modifiable_mems): Likewise for params "head", "tail" and locals "insn", "next_tail". * sched-ebb.c (init_ready_list): Likewise for local "insn". (begin_schedule_ready): Likewise for param "insn". (begin_move_insn): Likewise for params "insn" and "last". (ebb_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. (rank): Strengthen params "insn1", "insn2" from rtx to rtx_insn *. (ebb_contributes_to_priority): Likewise for params "next", "insn". (ebb_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sched-rgn.c (rgn_estimate_number_of_insns): Likewise for local "insn". (check_live): Likewise for param "insn". (init_ready_list): Likewise for local "insn". (can_schedule_ready_p): Likewise for param "insn". (begin_schedule_ready): Likewise. (new_ready): Likewise for param "next". (rgn_print_insn): Likewise for param "insn". (rgn_rank): Likewise for params "insn1", "insn2". (contributes_to_priority): Likewise for params "next", "insn". (rgn_insn_finishes_block_p): Likewise for param "insn". (add_branch_dependences): Likewise for params "head", "tail" and locals "insn", "last". (rgn_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sel-sched-dump.c (sel_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. * sel-sched-dump.h (sel_print_insn): Likewise. * sel-sched-ir.c (advance_deps_context): Add a checked cast. (deps_init_id): Likewise. * sel-sched.c (convert_vec_av_set_to_ready): Likewise. (invoke_reorder_hooks): Strengthen local "arr" from rtx * to rtx_insn **. From-SVN: r214481
2014-08-25 23:19:23 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_REORDER2 (FILE *@var{file}, int @var{verbose}, rtx_insn **@var{ready}, int *@var{n_readyp}, int @var{clock})
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
Like @samp{TARGET_SCHED_REORDER}, but called at a different time. That
function is called whenever the scheduler starts a new cycle. This one
is called once per iteration over a cycle, immediately after
@samp{TARGET_SCHED_VARIABLE_ISSUE}; it can reorder the ready list and
return the number of insns to be scheduled in the same cycle. Defining
this hook can be useful if there are frequent situations where
scheduling one insn causes other insns to become ready in the same
cycle. These other insns can then be taken into account properly.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_SCHED_MACRO_FUSION_P (void)
This hook is used to check whether target platform supports macro fusion.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} bool TARGET_SCHED_MACRO_FUSION_PAIR_P (rtx_insn *@var{condgen}, rtx_insn *@var{condjmp})
This hook is used to check whether two insns could be macro fused for
target microarchitecture. If this hook returns true for the given insn pair
(@var{condgen} and @var{condjmp}), scheduler will put them into a sched
group, and they will not be scheduled apart.
@end deftypefn
Strengthen haifa_sched_info callbacks and 3 scheduler hooks gcc/ * target.def (reorder): Strengthen param "ready" of this DEFHOOK from rtx * to rtx_insn **. (reorder2): Likewise. (dependencies_evaluation_hook): Strengthen params "head", "tail" from rtx to rtx_insn *. * doc/tm.texi: Update mechanically for above change to target.def. * sched-int.h (note_list): Strengthen this variable from rtx to rtx_insn *. (remove_notes): Likewise for both params. (restore_other_notes): Likewise for return type and first param. (struct ready_list): Strengthen field "vec" from rtx * to rtx_insn **. (struct dep_replacement): Strenghten field "insn" from rtx to rtx_insn *. (struct deps_desc): Likewise for fields "last_debug_insn", "last_args_size". (struct haifa_sched_info): Likewise for callback field "can_schedule_ready_p"'s param, for first param of "new_ready" callback field, for both params of "rank" callback field, for first field of "print_insn" callback field (with a const), for both params of "contributes_to_priority" callback, for param of "insn_finishes_block_p" callback, for fields "prev_head", "next_tail", "head", "tail", for first param of "add_remove_insn" callback, for first param of "begin_schedule_ready" callback, for both params of "begin_move_insn" callback, and for second param of "advance_target_bb" callback. (add_dependence): Likewise for params 1 and 2. (sched_analyze): Likewise for params 2 and 3. (deps_analyze_insn): Likewise for param 2. (ready_element): Likewise for return type. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (try_ready): Strenghten param from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (record_delay_slot_pair): Likewise for params 1 and 2. (add_delay_dependencies): Likewise for param. (contributes_to_priority): Likewise for both params. (find_modifiable_mems): Likewise. * config/arm/arm.c (cortexa7_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "insn", "first_older_only_insn" from rtx to rtx_insn *. (arm_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. * config/c6x/c6x.c (struct c6x_sched_context): Strengthen field "last_scheduled_iter0" from rtx to rtx_insn *. (init_sched_state): Replace use of NULL_RTX with NULL for insn. (c6x_sched_reorder_1): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (c6x_sched_reorder2): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (c6x_variable_issue): Add a checked cast when assigning from insn to ss.last_scheduled_iter0. (split_delayed_branch): Strengthen param "insn" and local "i1" from rtx to rtx_insn *. (split_delayed_nonbranch): Likewise. (undo_split_delayed_nonbranch): Likewise for local "insn". (hwloop_optimize): Likewise for locals "seq", "insn", "prev", "entry_after", "end_packet", "head_insn", "tail_insn", "new_insns", "last_insn", "this_iter", "prev_stage_insn". Strengthen locals "orig_vec", "copies", "insn_copies" from rtx * to rtx_insn **. Remove now-redundant checked cast on last_insn, but add a checked cast on loop->start_label. Consolidate calls to avoid assigning result of gen_spkernel to "insn", now an rtx_insn *. * config/i386/i386.c (do_reorder_for_imul): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (swap_top_of_ready_list): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "top", "next" from rtx to rtx_insn *. (ix86_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (add_parameter_dependencies): Strengthen params "call", "head" and locals "insn", "last", "first_arg" from rtx to rtx_insn *. (avoid_func_arg_motion): Likewise for params "first_arg", "insn". (add_dependee_for_func_arg): Likewise for param "arg" and local "insn". (ix86_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "first_arg". * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Likewise for params "head", "tail" and locals "insn", "next", "next_tail". (ia64_dfa_sched_reorder): Strengthen param "ready" and locals "e_ready", "insnp" from rtx * to rtx_insn **. Strengthen locals "insn", "lowest", "highest" from rtx to rtx_insn *. (ia64_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (ia64_sched_reorder2): Likewise. * config/mep/mep.c (mep_find_ready_insn): Strengthen return type and local "insn" from rtx to rtx_insn *. Strengthen param "ready" from rtx * to rtx_insn **. (mep_move_ready_insn): Strengthen param "ready" from rtx * to rtx_insn **. (mep_print_sched_insn): Strengthen param "insn" from rtx to rtx_insn *. (mep_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen locals "core_insn", "cop_insn" from rtx to rtx_insn *. * config/mips/mips.c (mips_promote_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "new_head" from rtx to rtx_insn *. (mips_maybe_swap_ready): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "temp" from rtx to rtx_insn *. (mips_macc_chains_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (vr4130_reorder): Likewise. (mips_74k_agen_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. (mips_sched_reorder_1): Strengthen param "ready" from rtx * to rtx_insn **. (mips_sched_reorder): Likewise. (mips_sched_reorder2): Likewise. * config/picochip/picochip.c (picochip_sched_reorder): Likewise. * config/rs6000/rs6000.c (rs6000_sched_reorder): Likewise. Strengthen local "tmp" from rtx to rtx_insn *. (rs6000_sched_reorder2): Likewise. * config/s390/s390.c (s390_z10_prevent_earlyload_conflicts): Likewise. Update sizeof(rtx) to sizeof(rtx_insn *) in memmove. (s390_sched_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Strengthen local "tmp" from rtx to rtx_insn *. * config/sh/sh.c (rank_for_reorder): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_reorder): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (ready_reorder): Strengthen param "ready" from rtx * to rtx_insn **. Update sizeof(rtx) to sizeof(rtx_insn *) in qsort. (sh_reorder): Strengthen param "ready" from rtx * to rtx_insn **. (sh_reorder2): Likewise. * config/spu/spu.c (spu_sched_reorder): Likewise. Strengthen local "insn" from rtx to rtx_insn *. * haifa-sched.c (note_list): Strengthen this variable from rtx to rtx_insn *. (scheduled_insns): Strengthen this variable from vec<rtx> to vec<rtx_insn *>. (set_modulo_params): Likewise for locals "i1", "i2". (record_delay_slot_pair): Likewise for params "i1", "i2". (add_delay_dependencies): Likewise for param "insn". (cond_clobbered_p): Likewise. (recompute_todo_spec): Likewise for local "prev". (last_scheduled_insn): Likewise for this variable. (nonscheduled_insns_begin): Likewise. (model_set_excess_costs): Strengthen param "insns" from rtx * to rtx_insn **. (rank_for_schedule): Strengthen locals "tmp", "tmp2" from rtx to rtx_insn *. (swap_sort): Strengthen param "a" from rtx * to rtx_insn **. Strengthen local "insn" from rtx to rtx_insn *. (queue_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_lastpos): Strengthen return type from rtx * to rtx_insn **. (ready_add): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first): Likewise for return type and local "t". (ready_element): Likewise for return type. (ready_remove): Likewise for return type and local "t". (ready_sort): Strengthen local "first" from rtx * to rtx_insn **. (check_clobbered_conditions): Strengthen local "x" from rtx to rtx_insn *, adding a checked cast. (schedule_insn): Likewise for param "insn". (remove_notes): Likewise for params "head", "tail" and locals "next_tail", "insn", "next". (struct haifa_saved_data): Likewise for fields "last_scheduled_insn", "nonscheduled_insns_begin". (save_backtrack_point): Update for change to field "vec" of struct ready_list. (toggle_cancelled_flags): Strengthen local "first" from rtx * to rtx_insn **. (restore_last_backtrack_point): Likewise. Strengthen local "insn" from rtx to rtx_insn * (resolve_dependencies): Strengthen param "insn" from rtx to rtx_insn * (restore_other_notes): Likewise for return type, for param "head" and local "note_head". (undo_all_replacements): Likewise for local "insn". (first_nonscheduled_insn): Likewise for return type and local "insn". (queue_to_ready): Likewise for local "insn", adding checked casts. (early_queue_to_ready): Likewise for local "insn". (debug_ready_list_1): Strengthen local "p" from rtx * to rtx_insn **. (move_insn): Strengthen param "insn" and local "note" from rtx to rtx_insn * (insn_finishes_cycle_p): Likewise for param "insn". (max_issue): Likewise for local "insn". (choose_ready): Likewise. Strengthen param "insn_ptr" from rtx * to rtx_insn **. (commit_schedule): Strengthen param "prev_head" and local "insn" from rtx to rtx_insn * (prune_ready_list): Likewise for local "insn". (schedule_block): Likewise for locals "prev_head", "head", "tail", "skip_insn", "insn", "failed_insn", "x", adding a checked cast. (set_priorities): Likewise for local "prev_head". (try_ready): Likewise for param "next". (fix_tick_ready): Likewise. (change_queue_index): Likewise. (sched_extend_ready_list): Update for change to field "vec" of struct ready_list. (generate_recovery_code): Strengthen param "insn" from rtx to rtx_insn *. (begin_speculative_block): Likewise. (create_check_block_twin): Likewise for param "insn" and locals "label", "check", "twin". Introduce local "check_pat" to avoid "check" being used as a plain rtx before being used as an insn. (fix_recovery_deps): Add a checked cast to rtx_insn * when extracting elements from ready_list. (sched_remove_insn): Strengthen param "insn" from rtx to rtx_insn *. (sched_emit_insn): Likewise for return type. (ready_remove_first_dispatch): Likewise for return type and local "insn". * hw-doloop.c (discover_loop): Add a checked cast to rtx_insn *. * modulo-sched.c (sms_print_insn): Strengthen from const_rtx to const rtx_insn *. * sched-deps.c (add_dependence): Strengthen params "con", "pro" from rtx to rtx_insn *. (add_dependence_list): Likewise for param "insn". Add a checked cast. (add_dependence_list_and_free): Strengthen param "insn" from rtx to rtx_insn *. Strengthen param "list_p" from rtx * to rtx_insn **. (chain_to_prev_insn): Strengthen param "insn" and locals "prec_nonnote", "i" from rtx to rtx_insn *. (flush_pending_lists): Likewise for param "insn". (cur_insn): Likewise for this variable. (haifa_start_insn): Add a checked cast. (note_dep): Strengthen param "e" from rtx to rtx_insn *. (sched_analyze_reg): Likewise for param "insn". (sched_analyze_1): Likewise. (sched_analyze_2): Likewise. Add checked casts. (sched_analyze_insn): Likewise. Also for local "prev". (deps_analyze_insn): Likewise for param "insn". (sched_analyze): Likewise for params "head", "tail" and local "insn". (add_dependence_1): Likewise for params "insn", "elem". (struct mem_inc_info): Likewise for fields "inc_insn", "mem_insn". (parse_add_or_inc): Likewise for param "insn". (find_inc): Likewise for local "inc_cand". (find_modifiable_mems): Likewise for params "head", "tail" and locals "insn", "next_tail". * sched-ebb.c (init_ready_list): Likewise for local "insn". (begin_schedule_ready): Likewise for param "insn". (begin_move_insn): Likewise for params "insn" and "last". (ebb_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. (rank): Strengthen params "insn1", "insn2" from rtx to rtx_insn *. (ebb_contributes_to_priority): Likewise for params "next", "insn". (ebb_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sched-rgn.c (rgn_estimate_number_of_insns): Likewise for local "insn". (check_live): Likewise for param "insn". (init_ready_list): Likewise for local "insn". (can_schedule_ready_p): Likewise for param "insn". (begin_schedule_ready): Likewise. (new_ready): Likewise for param "next". (rgn_print_insn): Likewise for param "insn". (rgn_rank): Likewise for params "insn1", "insn2". (contributes_to_priority): Likewise for params "next", "insn". (rgn_insn_finishes_block_p): Likewise for param "insn". (add_branch_dependences): Likewise for params "head", "tail" and locals "insn", "last". (rgn_add_remove_insn): Likewise for param "insn". (advance_target_bb): Likewise. * sel-sched-dump.c (sel_print_insn): Strengthen param "insn" from const_rtx to const rtx_insn *. * sel-sched-dump.h (sel_print_insn): Likewise. * sel-sched-ir.c (advance_deps_context): Add a checked cast. (deps_init_id): Likewise. * sel-sched.c (convert_vec_av_set_to_ready): Likewise. (invoke_reorder_hooks): Strengthen local "arr" from rtx * to rtx_insn **. From-SVN: r214481
2014-08-25 23:19:23 +02:00
@deftypefn {Target Hook} void TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK (rtx_insn *@var{head}, rtx_insn *@var{tail})
This hook is called after evaluation forward dependencies of insns in
chain given by two parameter values (@var{head} and @var{tail}
correspondingly) but before insns scheduling of the insn chain. For
example, it can be used for better insn classification if it requires
analysis of dependencies. This hook can use backward and forward
dependencies of the insn scheduler because they are already
calculated.
@end deftypefn
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@deftypefn {Target Hook} void TARGET_SCHED_INIT (FILE *@var{file}, int @var{verbose}, int @var{max_ready})
This hook is executed by the scheduler at the beginning of each block of
instructions that are to be scheduled. @var{file} is either a null
pointer, or a stdio stream to write any debug output to. @var{verbose}
is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@var{max_ready} is the maximum number of insns in the current scheduling
region that can be live at the same time. This can be used to allocate
scratch space if it is needed, e.g.@: by @samp{TARGET_SCHED_REORDER}.
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FINISH (FILE *@var{file}, int @var{verbose})
This hook is executed by the scheduler at the end of each block of
instructions that are to be scheduled. It can be used to perform
cleanup of any actions done by the other scheduling hooks. @var{file}
is either a null pointer, or a stdio stream to write any debug output
to. @var{verbose} is the verbose level provided by
@option{-fsched-verbose-@var{n}}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_INIT_GLOBAL (FILE *@var{file}, int @var{verbose}, int @var{old_max_uid})
This hook is executed by the scheduler after function level initializations.
@var{file} is either a null pointer, or a stdio stream to write any debug output to.
@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@var{old_max_uid} is the maximum insn uid when scheduling begins.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FINISH_GLOBAL (FILE *@var{file}, int @var{verbose})
This is the cleanup hook corresponding to @code{TARGET_SCHED_INIT_GLOBAL}.
@var{file} is either a null pointer, or a stdio stream to write any debug output to.
@var{verbose} is the verbose level provided by @option{-fsched-verbose-@var{n}}.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} rtx TARGET_SCHED_DFA_PRE_CYCLE_INSN (void)
The hook returns an RTL insn. The automaton state used in the
pipeline hazard recognizer is changed as if the insn were scheduled
when the new simulated processor cycle starts. Usage of the hook may
simplify the automaton pipeline description for some @acronym{VLIW}
processors. If the hook is defined, it is used only for the automaton
based pipeline description. The default is not to change the state
when the new simulated processor cycle starts.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN (void)
The hook can be used to initialize data used by the previous hook.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} {rtx_insn *} TARGET_SCHED_DFA_POST_CYCLE_INSN (void)
The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used
to changed the state as if the insn were scheduled when the new
simulated processor cycle finishes.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_INIT_DFA_POST_CYCLE_INSN (void)
The hook is analogous to @samp{TARGET_SCHED_INIT_DFA_PRE_CYCLE_INSN} but
used to initialize data used by the previous hook.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE (void)
The hook to notify target that the current simulated cycle is about to finish.
The hook is analogous to @samp{TARGET_SCHED_DFA_PRE_CYCLE_INSN} but used
to change the state in more complicated situations - e.g., when advancing
state on a single insn is not enough.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_SCHED_DFA_POST_ADVANCE_CYCLE (void)
The hook to notify target that new simulated cycle has just started.
The hook is analogous to @samp{TARGET_SCHED_DFA_POST_CYCLE_INSN} but used
to change the state in more complicated situations - e.g., when advancing
state on a single insn is not enough.
@end deftypefn
@deftypefn {Target Hook} int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD (void)
This hook controls better choosing an insn from the ready insn queue
for the @acronym{DFA}-based insn scheduler. Usually the scheduler
chooses the first insn from the queue. If the hook returns a positive
value, an additional scheduler code tries all permutations of
@samp{TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ()}
subsequent ready insns to choose an insn whose issue will result in
maximal number of issued insns on the same cycle. For the
@acronym{VLIW} processor, the code could actually solve the problem of
packing simple insns into the @acronym{VLIW} insn. Of course, if the
rules of @acronym{VLIW} packing are described in the automaton.
This code also could be used for superscalar @acronym{RISC}
processors. Let us consider a superscalar @acronym{RISC} processor
with 3 pipelines. Some insns can be executed in pipelines @var{A} or
@var{B}, some insns can be executed only in pipelines @var{B} or
@var{C}, and one insn can be executed in pipeline @var{B}. The
processor may issue the 1st insn into @var{A} and the 2nd one into
@var{B}. In this case, the 3rd insn will wait for freeing @var{B}
until the next cycle. If the scheduler issues the 3rd insn the first,
the processor could issue all 3 insns per cycle.
Actually this code demonstrates advantages of the automaton based
pipeline hazard recognizer. We try quickly and easy many insn
schedules to choose the best one.
The default is no multipass scheduling.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD (rtx_insn *@var{insn}, int @var{ready_index})
This hook controls what insns from the ready insn queue will be
considered for the multipass insn scheduling. If the hook returns
zero for @var{insn}, the insn will be considered in multipass scheduling.
Positive return values will remove @var{insn} from consideration on
the current round of multipass scheduling.
Negative return values will remove @var{insn} from consideration for given
number of cycles.
Backends should be careful about returning non-zero for highest priority
instruction at position 0 in the ready list. @var{ready_index} is passed
to allow backends make correct judgements.
The default is that any ready insns can be chosen to be issued.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BEGIN (void *@var{data}, signed char *@var{ready_try}, int @var{n_ready}, bool @var{first_cycle_insn_p})
Model decoder of Core 2/i7 for multipass scheduling. * config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
2010-11-02 17:02:09 +01:00
This hook prepares the target backend for a new round of multipass
scheduling.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_ISSUE (void *@var{data}, signed char *@var{ready_try}, int @var{n_ready}, rtx_insn *@var{insn}, const void *@var{prev_data})
Model decoder of Core 2/i7 for multipass scheduling. * config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
2010-11-02 17:02:09 +01:00
This hook is called when multipass scheduling evaluates instruction INSN.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_BACKTRACK (const void *@var{data}, signed char *@var{ready_try}, int @var{n_ready})
Model decoder of Core 2/i7 for multipass scheduling. * config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
2010-11-02 17:02:09 +01:00
This is called when multipass scheduling backtracks from evaluation of
an instruction.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_END (const void *@var{data})
This hook notifies the target about the result of the concluded current
round of multipass scheduling.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_INIT (void *@var{data})
This hook initializes target-specific data used in multipass scheduling.
Model decoder of Core 2/i7 for multipass scheduling. * config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
2010-11-02 17:02:09 +01:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FIRST_CYCLE_MULTIPASS_FINI (void *@var{data})
This hook finalizes target-specific data used in multipass scheduling.
Model decoder of Core 2/i7 for multipass scheduling. * config/i386/i386-protos.h (struct ix86_first_cycle_multipass_data_): New type to hold target-specific data for multipass scheduling. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. * config/i386/i386.c (ia32_multipass_dfa_lookahead): Update for Core 2/i7. (core2i7_secondary_decoder_max_insn_size,) (core2i7_secondary_ifetch_block_size, core2i7_ifetch_block_max_insns): New static variables. ([const_]ix86_first_cycle_multipass_data_t): New typedefs. ([_]ix86_first_cycle_multipass_data): New static variable. (core2i7_first_cycle_multipass_init, core2i7_dfa_poast_advance_cycle): Implement targetm.sched hooks. (core2i7_first_cycle_multipass_filter_ready_try): New static subroutine of ... (core2i7_first_cycle_multipass_{begin, issue, backtrack, end, fini}): Implement new targetm.sched hooks. (ix86_sched_init_global, TARGET_SCHED_INIT_GLOBAL): Define targetm.sched hook to install multipass scheduling hooks on demand. * doc/tm.texi.in: Document new targetm.sched hooks. * doc/tm.texi: Regenerate. * haifa-sched.c (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DATA_T): Define. (first_cycle_multipass_data_t): New typedef. (struct choice_entry: target_data): New field. (max_issue): Add first_cycle_insn_p parameter. Call new target hooks to allow target model restrictions not represented in DFA. (choose_ready, schedule_block): Update. (sched_extend_ready_list, sched_finish_ready_list): Call new target hooks to initialize target-specific data for multipass scheduling. * sched-int.h (max_issue): Update declaration. * sel-sched.c (choose_best_insn): Update. * target.def (first_cycle_multipass_{begin, issue, backtrack},) (first_cycle_multipass_{init, fini}): Define and document new targetm.sched hooks. From-SVN: r166196
2010-11-02 17:02:09 +01:00
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_DFA_NEW_CYCLE (FILE *@var{dump}, int @var{verbose}, rtx_insn *@var{insn}, int @var{last_clock}, int @var{clock}, int *@var{sort_p})
This hook is called by the insn scheduler before issuing @var{insn}
on cycle @var{clock}. If the hook returns nonzero,
@var{insn} is not issued on this processor cycle. Instead,
the processor cycle is advanced. If *@var{sort_p}
is zero, the insn ready queue is not sorted on the new cycle
start as usually. @var{dump} and @var{verbose} specify the file and
verbosity level to use for debugging output.
@var{last_clock} and @var{clock} are, respectively, the
processor cycle on which the previous insn has been issued,
and the current processor cycle.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_SCHED_IS_COSTLY_DEPENDENCE (struct _dep *@var{_dep}, int @var{cost}, int @var{distance})
This hook is used to define which dependences are considered costly by
the target, so costly that it is not advisable to schedule the insns that
are involved in the dependence too close to one another. The parameters
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
to this hook are as follows: The first parameter @var{_dep} is the dependence
being evaluated. The second parameter @var{cost} is the cost of the
dependence as estimated by the scheduler, and the third
parameter @var{distance} is the distance in cycles between the two insns.
The hook returns @code{true} if considering the distance between the two
insns the dependence between them is considered costly by the target,
and @code{false} otherwise.
Defining this hook can be useful in multiple-issue out-of-order machines,
where (a) it's practically hopeless to predict the actual data/resource
delays, however: (b) there's a better chance to predict the actual grouping
that will be formed, and (c) correctly emulating the grouping can be very
important. In such targets one may want to allow issuing dependent insns
closer to one another---i.e., closer than the dependence distance; however,
not in cases of ``costly dependences'', which this hooks allows to define.
@end deftypefn
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
@deftypefn {Target Hook} void TARGET_SCHED_H_I_D_EXTENDED (void)
This hook is called by the insn scheduler after emitting a new instruction to
the instruction stream. The hook notifies a target backend to extend its
per instruction data structures.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {void *} TARGET_SCHED_ALLOC_SCHED_CONTEXT (void)
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
Return a pointer to a store large enough to hold target scheduling context.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_INIT_SCHED_CONTEXT (void *@var{tc}, bool @var{clean_p})
Initialize store pointed to by @var{tc} to hold target scheduling context.
It @var{clean_p} is true then initialize @var{tc} as if scheduler is at the
beginning of the block. Otherwise, copy the current context into @var{tc}.
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_SET_SCHED_CONTEXT (void *@var{tc})
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
Copy target scheduling context pointed to by @var{tc} to the current context.
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_CLEAR_SCHED_CONTEXT (void *@var{tc})
Deallocate internal data in target scheduling context pointed to by @var{tc}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_FREE_SCHED_CONTEXT (void *@var{tc})
Deallocate a store for target scheduling context pointed to by @var{tc}.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_SCHED_SPECULATE_INSN (rtx_insn *@var{insn}, unsigned int @var{dep_status}, rtx *@var{new_pat})
This hook is called by the insn scheduler when @var{insn} has only
speculative dependencies and therefore can be scheduled speculatively.
The hook is used to check if the pattern of @var{insn} has a speculative
version and, in case of successful check, to generate that speculative
pattern. The hook should return 1, if the instruction has a speculative form,
or @minus{}1, if it doesn't. @var{request} describes the type of requested
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
speculation. If the return value equals 1 then @var{new_pat} is assigned
the generated speculative pattern.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_SCHED_NEEDS_BLOCK_P (unsigned int @var{dep_status})
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
This hook is called by the insn scheduler during generation of recovery code
for @var{insn}. It should return @code{true}, if the corresponding check
instruction should branch to recovery code, or @code{false} otherwise.
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} rtx TARGET_SCHED_GEN_SPEC_CHECK (rtx_insn *@var{insn}, rtx_insn *@var{label}, unsigned int @var{ds})
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
This hook is called by the insn scheduler to generate a pattern for recovery
check instruction. If @var{mutate_p} is zero, then @var{insn} is a
speculative instruction for which the check should be generated.
@var{label} is either a label of a basic block, where recovery code should
be emitted, or a null pointer, when requested check doesn't branch to
recovery code (a simple check). If @var{mutate_p} is nonzero, then
a pattern for a branchy check corresponding to a simple check denoted by
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
@var{insn} should be generated. In this case @var{label} can't be null.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SCHED_SET_SCHED_FLAGS (struct spec_info_def *@var{spec_info})
This hook is used by the insn scheduler to find out what features should be
enabled/used.
The structure *@var{spec_info} should be filled in by the target.
target.h (struct spec_info_def): New opaque declaration. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * target.h (struct spec_info_def): New opaque declaration. (struct gcc_target.sched): New fields: adjust_cost_2, h_i_d_extended, speculate_insn, needs_block_p, gen_check, first_cycle_multipass_dfa_lookahead_guard_spec, set_sched_flags. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): New macros to initialize fields in gcc_target.sched. (TARGET_SCHED): Use new macros. * rtl.h (copy_DEPS_LIST_list): New prototype. * sched-int.h (struct sched_info): Change signature of new_ready field, adjust all initializations. New fields: add_remove_insn, begin_schedule_ready, add_block, advance_target_bb, fix_recovery_cfg, region_head_or_leaf_p. (struct spec_info_def): New structure declaration. (spec_info_t): New typedef. (struct haifa_insn_data): New fields: todo_spec, done_spec, check_spec, recovery_block, orig_pat. (glat_start, glat_end): New variables declaraions. (TODO_SPEC, DONE_SPEC, CHECK_SPEC, RECOVERY_BLOCK, ORIG_PAT): New access macros. (enum SCHED_FLAGS): New constants: SCHED_RGN, SCHED_EBB, DETACH_LIFE_INFO, USE_GLAT. (enum SPEC_SCHED_FLAGS): New enumeration. (NOTE_NOTE_BB_P): New macro. (extend_dependency_caches, xrecalloc, unlink_bb_notes, add_block, attach_life_info, debug_spec_status, check_reg_live): New functions. (get_block_head_tail): Change signature to get_ebb_head_tail, adjust all uses in ddg.c, modulo-sched.c, haifa-sched.c, sched-rgn.c, sched-ebb.c (get_dep_weak, ds_merge): Prototype functions from sched-deps.c . * ddg.c (get_block_head_tail): Adjust all uses. * modulo-sched.c (get_block_head_tail): Adjust all uses. (sms_sched_info): Initialize new fields. (contributes_to_priority): Removed. * haifa-sched.c (params.h): New include. (get_block_head_tail): Adjust all uses. (ISSUE_POINTS): New macro. (glat_start, glat_end): New global variables. (spec_info_var, spec_info, added_recovery_block_p, nr_begin_data, nr_be_in_data, nr_begin_control, nr_be_in_control, bb_header, old_last_basic_block, before_recovery, current_sched_info_var, rgn_n_insns, luid): New static variables. (insn_cost1): New function. Move logic from insn_cost to here. (find_insn_reg_weight1): New function. Move logic from find_insn_reg_weight to here. (reemit_notes, move_insn, max_issue): Change signature. (move_insn1): Removed. (extend_h_i_d, extend_ready, extend_global, extend_all, init_h_i_d, extend_bb): New static functions to support extension of scheduler's data structures. (generate_recovery_code, process_insn_depend_be_in_spec, begin_speculative_block, add_to_speculative_block, init_before_recovery, create_recovery_block, create_check_block_twin, fix_recovery_deps): New static functions to support generation of recovery code. (fix_jump_move, find_fallthru_edge, dump_new_block_header, restore_bb_notes, move_block_after_check, move_succs): New static functions to support ebb scheduling. (init_glat, init_glat1, attach_life_info1, free_glat): New static functions to support handling of register live information. (associate_line_notes_with_blocks, change_pattern, speculate_insn, sched_remove_insn, clear_priorities, calc_priorities, bb_note, add_jump_dependencies): New static functions. (check_cfg, has_edge_p, check_sched_flags): New static functions for consistancy checking. (debug_spec_status): New function to call from debugger. (priority): Added code to handle speculation checks. (rank_for_schedule): Added code to distinguish speculative instructions. (schedule_insn): Added code to handle speculation checks. (unlink_other_notes, rm_line_notes, restore_line_notes, rm_other_notes): Fixed to handle ebbs. (move_insn): Added code to handle ebb scheduling. (max_issue): Added code to use ISSUE_POINTS of instructions. (choose_ready): Added code to choose between speculative and non-speculative instructions. (schedule_block): Added code to handle ebb scheduling and scheduling of speculative instructions. (sched_init): Initialize new variables. (sched_finish): Free new variables. Print statistics. (try_ready): Added code to handle speculative instructions. * lists.c (copy_DEPS_LIST_list): New function. * sched-deps.c (extend_dependency_caches): New function. Move logic from create_dependency_caches to here. (get_dep_weak, ds_merge): Make global. * genattr.c (main): Code to output prototype for dfa_clear_single_insn_cache. * genautomata.c (DFA_CLEAR_SINGLE_INSN_CACHE_FUNC_NAME): New macros. (output_dfa_clean_insn_cache_func): Code to output dfa_clear_single_insn_cache function. * sched-ebb.c (target_n_insns): Remove. Adjust all users to use n_insns. (can_schedule_ready_p, fix_basic_block_boundaries, add_missing_bbs): Removed. (n_insns, dont_calc_deps, ebb_head, ebb_tail, last_bb): New static variables. (begin_schedule_ready, add_remove_insn, add_block1, advance_target_bb, fix_recovery_cfg, ebb_head_or_leaf_p): Implement hooks from struct sched_info. (ebb_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (compute_jump_reg_dependencies): Fixed to use glat_start. (schedule_ebb): Code to remove unreachable last block. (schedule_ebbs): Added code to update register live information. * sched-rgn.c (region_sched_info): Initialize new fields. (get_block_head_tail): Adjust all uses. (last_was_jump): Removed. Adjust users. (begin_schedule_ready, add_remove_insn, insn_points, extend_regions, add_block1, fix_recovery_cfg, advance_target_bb, region_head_or_leaf_p): Implement new hooks. (check_dead_notes1): New static function. (struct region): New fields: dont_calc_deps, has_real_ebb. (RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB): New access macros. (BB_TO_BLOCK): Fixed to handle EBBs. (EBB_FIRST_BB, EBB_LAST_BB): New macros. (ebb_head): New static variable. (debug_regions, contributes_to_priority): Fixed to handle EBBs. (find_single_block_regions, find_rgns, find_more_rgns): Initialize new fields. (compute_dom_prob_ps): New assertion. (check_live_1, update_live_1): Fixed to work with glat_start instead of global_live_at_start. (init_ready_list): New assertions. (can_schedule_ready_p): Split update code to begin_schedule_ready. (new_ready): Add support for BEGIN_CONTROL speculation. (schedule_insns): Fixed code that updates register live information to handle EBBs. (schedule_region): Fixed to handle EBBs. (init_regions): Use extend_regions and check_dead_notes1. * params.def (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY, PARAM_SCHED_SPEC_PROB_CUTOFF): New parameters. * doc/tm.texi (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_H_I_D_EXTENDED, TARGET_SCHED_SPECULATE_INSN, TARGET_SCHED_NEEDS_BLOCK_P, TARGET_SCHED_GEN_CHECK, TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD_SPEC, TARGET_SCHED_SET_SCHED_FLAGS): Document. * doc/invoke.texi (max-sched-insn-conflict-delay, sched-spec-prob-cutoff): Document. From-SVN: r112128
2006-03-16 06:27:03 +01:00
The structure describes speculation types that can be used in the scheduler.
@end deftypefn
@deftypefn {Target Hook} int TARGET_SCHED_SMS_RES_MII (struct ddg *@var{g})
This hook is called by the swing modulo scheduler to calculate a
resource-based lower bound which is based on the resources available in
the machine and the resources required by each instruction. The target
backend can use @var{g} to calculate such bound. A very simple lower
bound will be used in case this hook is not implemented: the total number
of instructions divided by the issue rate.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} bool TARGET_SCHED_DISPATCH (rtx_insn *@var{insn}, int @var{x})
Dispatch scheduling for AMD Bulldozer processors. 2010-09-09 Reza Yazdani <reza.yazdani@amd.com> * config/i386/i386.c: Include sched-int.h. (TARGET_SCHED_DISPATCH): Defined. (TARGET_SCHED_DISPATCH_DO): Defined. (DISPATCH_WINDOW_SIZE): Defined. (MAX_DISPATCH_WINDOWS): Defined. (MAX_INSN): Defined. (MAX_IMM): Defined. (MAX_IMM_SIZE): Defined. (MAX_IMM_32): Defined. (MAX_IMM_64): Defined. (MAX_LOAD): Defined. (MAX_STORE): Defined. (BIG): Defined. (dispatch_group): New. (num_allowable_groups): New. (group_name): New. (sched_insn_info_s): New. (dispatch_windows_s): New. (imm_info_s): New. (dispatch_window_list): New. (dispatch_window_list1): New. (get_mem_group): New. (is_cmp): New. (dispatch_violation): New. (is_branch): New. (is_prefetch): New. (init_window): New. (allocate_window): New. (init_dispatch_sched): New. (is_end_basic_block): New. (process_end_window): New. (allocate_next_window): New. (find_constant_1): New. (find_constant): New. (get_num_immediates): New. (has_immediate): New. (get_insn_path): New. (get_insn_group): New. (count_num_restricted): New. (fits_dispatch_window): New. (add_insn_window): New. (add_to_dispatch_window): New. (debug_dispatch_window_file): New. (debug_dispatch_window): New. (debug_insn_dispatch_info_file): New. (debug_ready_dispatch): New. (do_dispatch): New. (has_dispatch): New. * config/i386/i386.h (debug_ready_dispatch): Declared. (debug_dispatch_window): Declared. * config/i386/i386.opt (mdispatch-scheduler): New flag. * doc/tm.texi.in (TARGET_SCHED_DISPATCH): New. (TARGET_SCHED_DISPATCH_DO): New. * doc/tm.texi: Regererated. * haifa-sched.c (choose_ready): Call targetm.sched.dispatch and ready_remove_first_dispatch (schedule_block): Call targetm.sched.dispatch and targetm.sched.dispatch_do. (sched_init): Call targetm.sched.dispatch and targetm.sched.dispatch_do. (ready_remove_first_dispatch): New. (number_in_ready): New. (get_ready_element): New. * hooks.c (hook_bool_rtx_int_false): New. (hook_void_rtx_int): New. * hooks.h (hook_bool_rtx_int_false): Declared. (hook_void_rtx_int): Declared. * sched-int.h (IS_DISPATCH_ON): Defined. (IS_CMP): Defined. (DISPATCH_VIOLATION): Defined. (FITS_DISPATCH_WINDOW): Defined. (DISPATCH_INIT): Defined. (ADD_TO_DISPATCH_WINDOW): Defined. (get_ready_element): Declared. (number_in_ready): Declared. * target.def (dispatch): Defined. (dispatch_do): Defined. From-SVN: r164133
2010-09-10 01:11:36 +02:00
This hook is called by Haifa Scheduler. It returns true if dispatch scheduling
is supported in hardware and the condition specified in the parameter is true.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} void TARGET_SCHED_DISPATCH_DO (rtx_insn *@var{insn}, int @var{x})
Dispatch scheduling for AMD Bulldozer processors. 2010-09-09 Reza Yazdani <reza.yazdani@amd.com> * config/i386/i386.c: Include sched-int.h. (TARGET_SCHED_DISPATCH): Defined. (TARGET_SCHED_DISPATCH_DO): Defined. (DISPATCH_WINDOW_SIZE): Defined. (MAX_DISPATCH_WINDOWS): Defined. (MAX_INSN): Defined. (MAX_IMM): Defined. (MAX_IMM_SIZE): Defined. (MAX_IMM_32): Defined. (MAX_IMM_64): Defined. (MAX_LOAD): Defined. (MAX_STORE): Defined. (BIG): Defined. (dispatch_group): New. (num_allowable_groups): New. (group_name): New. (sched_insn_info_s): New. (dispatch_windows_s): New. (imm_info_s): New. (dispatch_window_list): New. (dispatch_window_list1): New. (get_mem_group): New. (is_cmp): New. (dispatch_violation): New. (is_branch): New. (is_prefetch): New. (init_window): New. (allocate_window): New. (init_dispatch_sched): New. (is_end_basic_block): New. (process_end_window): New. (allocate_next_window): New. (find_constant_1): New. (find_constant): New. (get_num_immediates): New. (has_immediate): New. (get_insn_path): New. (get_insn_group): New. (count_num_restricted): New. (fits_dispatch_window): New. (add_insn_window): New. (add_to_dispatch_window): New. (debug_dispatch_window_file): New. (debug_dispatch_window): New. (debug_insn_dispatch_info_file): New. (debug_ready_dispatch): New. (do_dispatch): New. (has_dispatch): New. * config/i386/i386.h (debug_ready_dispatch): Declared. (debug_dispatch_window): Declared. * config/i386/i386.opt (mdispatch-scheduler): New flag. * doc/tm.texi.in (TARGET_SCHED_DISPATCH): New. (TARGET_SCHED_DISPATCH_DO): New. * doc/tm.texi: Regererated. * haifa-sched.c (choose_ready): Call targetm.sched.dispatch and ready_remove_first_dispatch (schedule_block): Call targetm.sched.dispatch and targetm.sched.dispatch_do. (sched_init): Call targetm.sched.dispatch and targetm.sched.dispatch_do. (ready_remove_first_dispatch): New. (number_in_ready): New. (get_ready_element): New. * hooks.c (hook_bool_rtx_int_false): New. (hook_void_rtx_int): New. * hooks.h (hook_bool_rtx_int_false): Declared. (hook_void_rtx_int): Declared. * sched-int.h (IS_DISPATCH_ON): Defined. (IS_CMP): Defined. (DISPATCH_VIOLATION): Defined. (FITS_DISPATCH_WINDOW): Defined. (DISPATCH_INIT): Defined. (ADD_TO_DISPATCH_WINDOW): Defined. (get_ready_element): Declared. (number_in_ready): Declared. * target.def (dispatch): Defined. (dispatch_do): Defined. From-SVN: r164133
2010-09-10 01:11:36 +02:00
This hook is called by Haifa Scheduler. It performs the operation specified
in its second parameter.
@end deftypefn
@deftypevr {Target Hook} bool TARGET_SCHED_EXPOSED_PIPELINE
True if the processor has an exposed pipeline, which means that not just
the order of instructions is important for correctness when scheduling, but
also the latencies of operations.
@end deftypevr
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_SCHED_REASSOCIATION_WIDTH (unsigned int @var{opc}, machine_mode @var{mode})
PR middle-end/44382: Tree reassociation improvement gcc/ 2011-09-06 Enkovich Ilya <ilya.enkovich@intel.com> PR middle-end/44382 * target.def (reassociation_width): New hook. * doc/tm.texi.in (reassociation_width): Likewise. * doc/tm.texi (reassociation_width): Likewise. * doc/invoke.texi (tree-reassoc-width): New param documented. * hooks.h (hook_int_uint_mode_1): New default hook. * hooks.c (hook_int_uint_mode_1): Likewise. * config/i386/i386.h (ix86_tune_indices): Add X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL. (TARGET_REASSOC_INT_TO_PARALLEL): New. (TARGET_REASSOC_FP_TO_PARALLEL): Likewise. * config/i386/i386.c (initial_ix86_tune_features): Add X86_TUNE_REASSOC_INT_TO_PARALLEL and X86_TUNE_REASSOC_FP_TO_PARALLEL. (ix86_reassociation_width) implementation of new hook for i386 target. * params.def (PARAM_TREE_REASSOC_WIDTH): New param added. * tree-ssa-reassoc.c (get_required_cycles): New function. (get_reassociation_width): Likewise. (swap_ops_for_binary_stmt): Likewise. (rewrite_expr_tree_parallel): Likewise. (rewrite_expr_tree): Refactored. Part of code moved into swap_ops_for_binary_stmt. (reassociate_bb): Now checks reassociation width to be used and call rewrite_expr_tree_parallel instead of rewrite_expr_tree if needed. gcc/testsuite/ 2011-09-06 Enkovich Ilya <ilya.enkovich@intel.com> * gcc.dg/tree-ssa/pr38533.c (dg-options): Added option --param tree-reassoc-width=1. * gcc.dg/tree-ssa/reassoc-24.c: New test. * gcc.dg/tree-ssa/reassoc-25.c: Likewise. From-SVN: r178602
2011-09-06 18:42:47 +02:00
This hook is called by tree reassociator to determine a level of
parallelism required in output calculations chain.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Sections
@section Dividing the Output into Sections (Texts, Data, @dots{})
@c the above section title is WAY too long. maybe cut the part between
@c the (...)? --mew 10feb93
An object file is divided into sections containing different types of
data. In the most common case, there are three sections: the @dfn{text
section}, which holds instructions and read-only data; the @dfn{data
section}, which holds initialized writable data; and the @dfn{bss
section}, which holds uninitialized data. Some systems have other kinds
of sections.
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@file{varasm.c} provides several well-known sections, such as
@code{text_section}, @code{data_section} and @code{bss_section}.
The normal way of controlling a @code{@var{foo}_section} variable
is to define the associated @code{@var{FOO}_SECTION_ASM_OP} macro,
as described below. The macros are only read once, when @file{varasm.c}
initializes itself, so their values must be run-time constants.
They may however depend on command-line flags.
@emph{Note:} Some run-time files, such @file{crtstuff.c}, also make
use of the @code{@var{FOO}_SECTION_ASM_OP} macros, and expect them
to be string literals.
Some assemblers require a different string to be written every time a
section is selected. If your assembler falls into this category, you
should define the @code{TARGET_ASM_INIT_SECTIONS} hook and use
@code{get_unnamed_section} to set up the sections.
You must always create a @code{text_section}, either by defining
@code{TEXT_SECTION_ASM_OP} or by initializing @code{text_section}
in @code{TARGET_ASM_INIT_SECTIONS}. The same is true of
@code{data_section} and @code{DATA_SECTION_ASM_OP}. If you do not
create a distinct @code{readonly_data_section}, the default is to
reuse @code{text_section}.
All the other @file{varasm.c} sections are optional, and are null
if the target does not provide them.
1996-09-25 01:21:45 +02:00
@defmac TEXT_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation that should precede instructions and read-only data.
Normally @code{"\t.text"} is right.
@end defmac
@defmac HOT_TEXT_SECTION_NAME
invoke.texi (-malign-double): Re-add lost warning. * invoke.texi (-malign-double): Re-add lost warning. * i386-protos.h (x86_output_mi_thunk): Declare. * unix.h (ASM_OUTPUT_MI_THUNK): Move offline to ... * i386.c (x86_output_mi_thunk): ... here; handle 64bits. * dwarf2out.c (output_call_frame_info): Do not skip unwind info when flag_asynchronous_unwind_tables is set. * flags.h (flag_reorder_functions): Declare. * function.c (prepare_function_start): Initialize frequnecy. * params.def (HOT_BB_COUNT_FRACTION, HOT_BB_FREQUENCY_FRACTION): New paramters. * Makefile.in (predict.o): Add dependency on target.h and params.h * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): New macros. * predict.c (choose_function_section): New function. (estimate_bb_frequencies): Use it. * toplev.c (flag_reorder_functions): New global variable. (lang_independent_options): New. (parse_options_and_default_flags): Set. * varasm.c (assemble_start_function): Bypass functdion alignment for never executed functions. * invoke.texi (-freorder-blocks, -freorder-functions): Document. (param hot-bb-count-fraction, hot-bb-frequency-fraction): New. * tm.texi (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Document. Thu Jan 3 21:52:09 CET 2002 Jan Hubicka <jh@suse.cz> * predict.c: Inlude profile.h (MIN_COUNT): Rename to MIN_COUNT_FRACTION (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): Use the information about maximal counter in the program. Thu Dec 20 22:14:00 CET 2001 Jan Hubicka <jh@suse.cz> * basic-block.h (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * cfgcleanup.c (outgoing_edges_match): Use them. * predict.c (MIN_COUNT, MIN_FREQUENCY): New macros. (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * function.h (function): Add new field function_frequency. * predict.c (compute_function_frequency): New function. (estimate_probability): Call it. From-SVN: r53478
2002-05-15 11:00:30 +02:00
If defined, a C string constant for the name of the section containing most
frequently executed functions of the program. If not defined, GCC will provide
a default definition if the target supports named sections.
@end defmac
invoke.texi (-malign-double): Re-add lost warning. * invoke.texi (-malign-double): Re-add lost warning. * i386-protos.h (x86_output_mi_thunk): Declare. * unix.h (ASM_OUTPUT_MI_THUNK): Move offline to ... * i386.c (x86_output_mi_thunk): ... here; handle 64bits. * dwarf2out.c (output_call_frame_info): Do not skip unwind info when flag_asynchronous_unwind_tables is set. * flags.h (flag_reorder_functions): Declare. * function.c (prepare_function_start): Initialize frequnecy. * params.def (HOT_BB_COUNT_FRACTION, HOT_BB_FREQUENCY_FRACTION): New paramters. * Makefile.in (predict.o): Add dependency on target.h and params.h * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): New macros. * predict.c (choose_function_section): New function. (estimate_bb_frequencies): Use it. * toplev.c (flag_reorder_functions): New global variable. (lang_independent_options): New. (parse_options_and_default_flags): Set. * varasm.c (assemble_start_function): Bypass functdion alignment for never executed functions. * invoke.texi (-freorder-blocks, -freorder-functions): Document. (param hot-bb-count-fraction, hot-bb-frequency-fraction): New. * tm.texi (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Document. Thu Jan 3 21:52:09 CET 2002 Jan Hubicka <jh@suse.cz> * predict.c: Inlude profile.h (MIN_COUNT): Rename to MIN_COUNT_FRACTION (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): Use the information about maximal counter in the program. Thu Dec 20 22:14:00 CET 2001 Jan Hubicka <jh@suse.cz> * basic-block.h (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * cfgcleanup.c (outgoing_edges_match): Use them. * predict.c (MIN_COUNT, MIN_FREQUENCY): New macros. (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * function.h (function): Add new field function_frequency. * predict.c (compute_function_frequency): New function. (estimate_probability): Call it. From-SVN: r53478
2002-05-15 11:00:30 +02:00
@defmac UNLIKELY_EXECUTED_TEXT_SECTION_NAME
invoke.texi (-malign-double): Re-add lost warning. * invoke.texi (-malign-double): Re-add lost warning. * i386-protos.h (x86_output_mi_thunk): Declare. * unix.h (ASM_OUTPUT_MI_THUNK): Move offline to ... * i386.c (x86_output_mi_thunk): ... here; handle 64bits. * dwarf2out.c (output_call_frame_info): Do not skip unwind info when flag_asynchronous_unwind_tables is set. * flags.h (flag_reorder_functions): Declare. * function.c (prepare_function_start): Initialize frequnecy. * params.def (HOT_BB_COUNT_FRACTION, HOT_BB_FREQUENCY_FRACTION): New paramters. * Makefile.in (predict.o): Add dependency on target.h and params.h * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): New macros. * predict.c (choose_function_section): New function. (estimate_bb_frequencies): Use it. * toplev.c (flag_reorder_functions): New global variable. (lang_independent_options): New. (parse_options_and_default_flags): Set. * varasm.c (assemble_start_function): Bypass functdion alignment for never executed functions. * invoke.texi (-freorder-blocks, -freorder-functions): Document. (param hot-bb-count-fraction, hot-bb-frequency-fraction): New. * tm.texi (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Document. Thu Jan 3 21:52:09 CET 2002 Jan Hubicka <jh@suse.cz> * predict.c: Inlude profile.h (MIN_COUNT): Rename to MIN_COUNT_FRACTION (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): Use the information about maximal counter in the program. Thu Dec 20 22:14:00 CET 2001 Jan Hubicka <jh@suse.cz> * basic-block.h (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * cfgcleanup.c (outgoing_edges_match): Use them. * predict.c (MIN_COUNT, MIN_FREQUENCY): New macros. (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * function.h (function): Add new field function_frequency. * predict.c (compute_function_frequency): New function. (estimate_probability): Call it. From-SVN: r53478
2002-05-15 11:00:30 +02:00
If defined, a C string constant for the name of the section containing unlikely
executed functions in the program.
@end defmac
invoke.texi (-malign-double): Re-add lost warning. * invoke.texi (-malign-double): Re-add lost warning. * i386-protos.h (x86_output_mi_thunk): Declare. * unix.h (ASM_OUTPUT_MI_THUNK): Move offline to ... * i386.c (x86_output_mi_thunk): ... here; handle 64bits. * dwarf2out.c (output_call_frame_info): Do not skip unwind info when flag_asynchronous_unwind_tables is set. * flags.h (flag_reorder_functions): Declare. * function.c (prepare_function_start): Initialize frequnecy. * params.def (HOT_BB_COUNT_FRACTION, HOT_BB_FREQUENCY_FRACTION): New paramters. * Makefile.in (predict.o): Add dependency on target.h and params.h * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): New macros. * predict.c (choose_function_section): New function. (estimate_bb_frequencies): Use it. * toplev.c (flag_reorder_functions): New global variable. (lang_independent_options): New. (parse_options_and_default_flags): Set. * varasm.c (assemble_start_function): Bypass functdion alignment for never executed functions. * invoke.texi (-freorder-blocks, -freorder-functions): Document. (param hot-bb-count-fraction, hot-bb-frequency-fraction): New. * tm.texi (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Document. Thu Jan 3 21:52:09 CET 2002 Jan Hubicka <jh@suse.cz> * predict.c: Inlude profile.h (MIN_COUNT): Rename to MIN_COUNT_FRACTION (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): Use the information about maximal counter in the program. Thu Dec 20 22:14:00 CET 2001 Jan Hubicka <jh@suse.cz> * basic-block.h (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * cfgcleanup.c (outgoing_edges_match): Use them. * predict.c (MIN_COUNT, MIN_FREQUENCY): New macros. (maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p): New functions. * function.h (function): Add new field function_frequency. * predict.c (compute_function_frequency): New function. (estimate_probability): Call it. From-SVN: r53478
2002-05-15 11:00:30 +02:00
@defmac DATA_SECTION_ASM_OP
A C expression whose value is a string, including spacing, containing the
assembler operation to identify the following data as writable initialized
data. Normally @code{"\t.data"} is right.
@end defmac
1996-09-25 01:21:45 +02:00
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@defmac SDATA_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
initialized, writable small data.
@end defmac
@defmac READONLY_DATA_SECTION_ASM_OP
final.c (HAVE_READONLY_DATA_SECTION): New. * final.c (HAVE_READONLY_DATA_SECTION): New. (shorten_branches): Use it instead of ifdefs. * varasm.c (enum in_section): Add in_readonly_data. (text_section, data_section): Tidy. (readonly_data_section): Use READONLY_DATA_SECTION_ASM_OP if present. * config/darwin.h, config/nextstep.h, config/h8300/elf.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h (READONLY_DATA_SECTION): Don't undef. * config/alpha/unicosmk.h, config/h8300/elf.h, config/i386/aix386ng.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/rs6000/lynx.h (READONLY_DATA_SECTION_ASM_OP): Undef. * config/elfos.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/m88k/m88k.h, config/pa/pa64-hpux.h (USE_CONST_SECTION): Remove. * config/elfos.h, config/netware.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/alpha/vms.h, config/arc/arc.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/dgux.h, config/i386/i386-interix.h, config/i386/sco5.h, config/ia64/hpux.h, config/m32r/m32r.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/sysv4.h (READONLY_DATA_SECTION_ASM_OP): Rename from CONST_SECTION_ASM_OP/READONLY_SECTION_ASM_OP/RDATA_SECTION_ASM_OP. * config/elfos.h, config/netware.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/arm/coff.h, config/h8300/h8300.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/litecoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/h8300/h8300.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (READONLY_DATA_SECTION): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (CONST_SECTION_FUNCTION): Remove. * config/lynx.h, config/svr3.h, config/alpha/elf.h, config/alpha/vms.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/i860/sysv4.h, config/ia64/sysv4.h, config/m32r/m32r.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mips/elf.h, config/mips/elf64.h, config/mips/iris6.h, config/mips/linux.h, config/mips/mips.h, config/mips/rtems64.h, config/mips/vxworks.h, config/rs6000/sysv4.h, config/v850/v850.h (EXTRA_SECTIONS): Remove in_const/in_rdata. (EXTRA_SECTION_FUNCTIONS): Remove accompanying function. * config/svr3.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/sco5.h, config/i386/svr3gas.h, config/ia64/aix.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mmix/mmix.h, config/sparc/sysv4.h (SELECT_RTX_SECTION): Use readonly_data_section. * config/alpha/alpha.c (alpha_start_function): Likewise. (alpha_write_linkage): Likewise. * config/m32r/m32r.c (m32r_select_section): Likewise. * config/m88k/m88k.c (m88k_select_section): Likewise. * config/mips/mips.c (mips_select_rtx_section): Likewise. * config/rs6000/rs6000.c (rs6000_select_rtx_section): Likewise. (rs6000_elf_select_section): Likewise. * config/v850/v850.c (v850_select_section): Likewise. * config/1750a/1750a.h, config/i860/sysv3.h (READONLY_DATA_SECTION_ASM_OP): New. READONLY_DATA_SECTION_ASM_OP. * config/i386/interix.c, config/i386/winnt.c (i386_pe_unique_section): Always use .rdata prefix. * config/pa/som.h (readonly_data): Always switch to read-only section. (READONLY_DATA_SECTION): Predicate on flag_pic. * config/we32k/we32k.h (READONLY_DATA_SECTION): Remove parenthesis. * doc/tm.texi (READONLY_DATA_SECTION_ASM_OP): New. (READONLY_DATA_SECTION): Update. From-SVN: r53593
2002-05-18 21:27:52 +02:00
A C expression whose value is a string, including spacing, containing the
assembler operation to identify the following data as read-only initialized
data.
@end defmac
final.c (HAVE_READONLY_DATA_SECTION): New. * final.c (HAVE_READONLY_DATA_SECTION): New. (shorten_branches): Use it instead of ifdefs. * varasm.c (enum in_section): Add in_readonly_data. (text_section, data_section): Tidy. (readonly_data_section): Use READONLY_DATA_SECTION_ASM_OP if present. * config/darwin.h, config/nextstep.h, config/h8300/elf.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h (READONLY_DATA_SECTION): Don't undef. * config/alpha/unicosmk.h, config/h8300/elf.h, config/i386/aix386ng.h, config/i860/paragon.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/rs6000/lynx.h (READONLY_DATA_SECTION_ASM_OP): Undef. * config/elfos.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/m88k/m88k.h, config/pa/pa64-hpux.h (USE_CONST_SECTION): Remove. * config/elfos.h, config/netware.h, config/alpha/alpha-interix.h, config/alpha/elf.h, config/alpha/vms.h, config/arc/arc.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/dgux.h, config/i386/i386-interix.h, config/i386/sco5.h, config/ia64/hpux.h, config/m32r/m32r.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/sysv4.h (READONLY_DATA_SECTION_ASM_OP): Rename from CONST_SECTION_ASM_OP/READONLY_SECTION_ASM_OP/RDATA_SECTION_ASM_OP. * config/elfos.h, config/netware.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/arm/coff.h, config/h8300/h8300.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/mmix/mmix.h, config/pa/pa64-hpux.h, config/sparc/litecoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/arm/coff.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/h8300/h8300.h, config/i386/i386-interix.h, config/i386/osfrose.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (READONLY_DATA_SECTION): Remove. * config/elfos.h, config/netware.h, config/svr3.h, config/alpha/alpha-interix.h, config/alpha/alpha.h, config/alpha/elf.h, config/c4x/c4x.h, config/i386/aix386ng.h, config/i386/i386-interix.h, config/i386/sco5.h, config/i386/svr3gas.h, config/mmix/mmix.h, config/pa/pa64-hpux.h (CONST_SECTION_FUNCTION): Remove. * config/lynx.h, config/svr3.h, config/alpha/elf.h, config/alpha/vms.h, config/c4x/c4x.h, config/dsp16xx/dsp16xx.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/sysv3.h, config/i860/sysv4.h, config/ia64/sysv4.h, config/m32r/m32r.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mips/elf.h, config/mips/elf64.h, config/mips/iris6.h, config/mips/linux.h, config/mips/mips.h, config/mips/rtems64.h, config/mips/vxworks.h, config/rs6000/sysv4.h, config/v850/v850.h (EXTRA_SECTIONS): Remove in_const/in_rdata. (EXTRA_SECTION_FUNCTIONS): Remove accompanying function. * config/svr3.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/sco5.h, config/i386/svr3gas.h, config/ia64/aix.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mmix/mmix.h, config/sparc/sysv4.h (SELECT_RTX_SECTION): Use readonly_data_section. * config/alpha/alpha.c (alpha_start_function): Likewise. (alpha_write_linkage): Likewise. * config/m32r/m32r.c (m32r_select_section): Likewise. * config/m88k/m88k.c (m88k_select_section): Likewise. * config/mips/mips.c (mips_select_rtx_section): Likewise. * config/rs6000/rs6000.c (rs6000_select_rtx_section): Likewise. (rs6000_elf_select_section): Likewise. * config/v850/v850.c (v850_select_section): Likewise. * config/1750a/1750a.h, config/i860/sysv3.h (READONLY_DATA_SECTION_ASM_OP): New. READONLY_DATA_SECTION_ASM_OP. * config/i386/interix.c, config/i386/winnt.c (i386_pe_unique_section): Always use .rdata prefix. * config/pa/som.h (readonly_data): Always switch to read-only section. (READONLY_DATA_SECTION): Predicate on flag_pic. * config/we32k/we32k.h (READONLY_DATA_SECTION): Remove parenthesis. * doc/tm.texi (READONLY_DATA_SECTION_ASM_OP): New. (READONLY_DATA_SECTION): Update. From-SVN: r53593
2002-05-18 21:27:52 +02:00
@defmac BSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
uninitialized global data. If not defined, and
@code{ASM_OUTPUT_ALIGNED_BSS} not defined,
uninitialized global data will be output in the data section if
@option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
used.
@end defmac
1996-09-25 01:21:45 +02:00
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@defmac SBSS_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
uninitialized, writable small data.
@end defmac
@defmac TLS_COMMON_ASM_OP
If defined, a C expression whose value is a string containing the
assembler operation to identify the following data as thread-local
common data. The default is @code{".tls_common"}.
@end defmac
@defmac TLS_SECTION_ASM_FLAG
If defined, a C expression whose value is a character constant
containing the flag used to mark a section as a TLS section. The
default is @code{'T'}.
@end defmac
@defmac INIT_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
initialization code. If not defined, GCC will assume such a section does
not exist. This section has no corresponding @code{init_section}
variable; it is used entirely in runtime code.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FINI_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
finalization code. If not defined, GCC will assume such a section does
not exist. This section has no corresponding @code{fini_section}
variable; it is used entirely in runtime code.
@end defmac
basic-block.h (struct edge_def): Add new field, crossing_edge. 2004-04-09 Caroline Tice <ctice@apple.com> * basic-block.h (struct edge_def): Add new field, crossing_edge. (struct basic_block_def): Add new field, partition. (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro definitions. (partition_hot_cold_basic_blocks): Add extern function declaration. * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new include statements. (N_ROUNDS): Increase the maximum number of rounds by 1. (branch_threshold): Add array value for new round. (exec_threshold): Add array value for new round. (push_to_next_round_p): New function. (add_unlikely_executed_notes): New function. (find_rarely_executed_basic_blocks_and_crossing_edges): New function. (mark_bb_for_unlikely_executed_section): New function. (add_labels_and_missing_jumps): New function. (add_reg_crossing_jump_notes): New function. (fix_up_fall_thru_edges): New function. (find_jump_block): New function. (fix_crossing_conditional_branches): New function. (fix_crossing_unconditional_branches): New function. (fix_edges_for_rarely_executed_code): New function. (partition_hot_cold_basic_blocks): New function. (find_traces): Add an extra round for partitioning hot/cold basic blocks. (find_traces_1_round): Add a parameter. Modify to push all cold blocks, and only cold blocks, into the last (extra) round of collecting traces. (better_edge_p): Add a parameter. Modify to favor non-crossing edges over crossing edges. (bb_to_key): Add code to correctly identify cold blocks when doing partitioning. (connect_traces): Modify to connect all the non-cold traces first, then go back and connect up all the cold traces. (reorder_basic_blocks): Add call to add_unlikely_executed_notes. * cfg.c (entry_exit_blocks): Add initialization for partition field in entry and exit blocks. * cfgbuild.c (make_edges): Update current_function_has_computed_jump if we are doing hot/cold partitioning. * cfgcleanup.c (cfglayout.h): Add new include statement. (try_simplify_condjump): Modify to not attempt on blocks with jumps that cross section boundaries. (try_forward_edges): Likewise. (merge_blocks_move_predecessor_nojumps): Likewise. (merge_blocks_move_successor_nojumps): Likewise. (merge_blocks_move): Likewise. (try_crossjump_to_edge): Modify to not attempt after we have done the block partitioning. (try_crossjump_bb): Modify to not attempt on blocks with jumps that cross section boundaries. (try_optimize_cfg): Likewise. * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect jumps that cross section boundaries. * cfglayout.c (flags.h): Add new include statement. (update_unlikely_executed_notes): New function. (fixup_reorder_chain): Add code so when a new jumping basic block is added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are updated appropriately. (duplicate_insn_chain): Add code to duplicate the new NOTE insn introduced by this optimization. * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new extern function declaration. * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to list of notes that can be deleted. (create_basic_block_structure): Add initialization for partition field. (rtl_can_merge_blocks): Modify to test blocks for jumps that cross section boundaries. (try_redirect_by_replacing_jump): Modify to not attempt on jumps that cross section boundaries. (commit_one_edge_insertion): Add code so newly created basic block ends up in correct (hot or cold) section. Modify to disallow insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes. (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge crosses section boundaries. (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that cross section boundaries. (force_nonfallthru_and_redirect): Modify to make sure new basic block ends up in correct section, with correct notes attached. * common.opt (freorder-blocks-and-partition): Add new flag for this optimization. * dbxout.c (dbx_function_end): Add code to make sure scope labels at the end of functions are written into the correct (hot or cold) section. (dbx_source_file): Add code so writing debug file information doesn't incorrectly change sections. * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use in partitioning hot/cold basic blocks into separate sections. (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold section partitioning. (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not conditional branches can span all of memory. (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not unconditional branches can span all of memory. * final.c (scan_ahead_for_unlikely_executed_note): New function. (final_scan_insn): Add code to check for NOTE instruction indicating whether basic block belongs in hot or cold section, and to make sure the current basic block is being written to the appropriate section. Also added code to ensure that jump table basic blocks end up in the correct section. * flags.h (flag_reorder_blocks_and_partition): New flag. * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if one of the branches has a jump that crosses between sections. (find_if_case_2): Likewise. (ifcvt): Modify to not attempt to mark loop exit edges after hot/cold partitioning has occurred. * opts.c (decode_options): Code to handle new flag, flag_reorder_blocks_and_partition; also to turn it off if flag_exceptions is on. (common_handle_option): Code to handle new flag, flag_reorder_blocks_and_partition. * output.h (unlikely_text_section): New extern function declaration. (in_unlikely_text_section): New extern function declaration. * passes.c (rest_of_handle_stack_regs): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition as an 'or' condition for calling reorder_basic_blocks. (rest_of_compilation): Add call to partition_hot_cold_basic_blocks. * print-rtl.c (print_rtx): Add code for handling new note, NOTE_INSN_UNLIKELY_EXECUTED_CODE * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below). (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that cross between section boundaries. * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction, indicating the basic block containing it belongs in the cold section. (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross between hot and cold sections. * toplev.c (flag_reorder_blocks_and_partition): Add code to initialize this flag, and to tie it to the command-line option freorder-blocks-and-partition. * varasm.c (cfglayout.h): Add new include statement. (unlikely_section_label_printed): New global variable, used for determining when to output section name labels for cold sections. (in_section): Add in_unlikely_executed_text to enum data structure. (text_section): Modify code to use SECTION_FORMAT_STRING and NORMAL_TEXT_SECTION_NAME macros. (unlikely_text_section): New function. (in_unlikely_text_section): New function. (function_section): Add code to make sure beginning of function is written into correct section (hot or cold). (assemble_start_function): Add code to make sure stuff is written to the correct section. (assemble_zeros): Add in_unlikely_text_section as an 'or' condition to an if statement that was checking 'in_text_section'. (assemble_variable): Add 'in_unlikely_text_section' as an 'or' condition to an if statement that was checking 'in_text_section'. (default_section_type_flags_1): Add check: if in cold section flags = SECTION_CODE. * config/darwin.c (darwin_asm_named_section): Modify to use SECTION_FORMAT_STRING if we are partitioning hot/cold blocks. * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro specifically for the i386. (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386. * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change text string to something more informative. (NORMAL_TEXT_SECTION_NAME): Add new definition. (SECTION_FORMAT_STRING): Add new definition. * config/rs6000/rs6000.c (rs6000_assemble_integer): Add '!in_unlikely_text_section' as an 'and' condition to an if statement that was already checking '!in_text_section'. * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make sure these are properly defined for linux on ppc. * doc/invoke.texi (freorder-blocks-and-partition): Add documentation for this new flag. * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new reg_note. * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING, HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for these new macros. From-SVN: r80564
2004-04-09 21:57:47 +02:00
@defmac INIT_ARRAY_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
part of the @code{.init_array} (or equivalent) section. If not
defined, GCC will assume such a section does not exist. Do not define
both this macro and @code{INIT_SECTION_ASM_OP}.
@end defmac
@defmac FINI_ARRAY_SECTION_ASM_OP
If defined, a C expression whose value is a string, including spacing,
containing the assembler operation to identify the following data as
part of the @code{.fini_array} (or equivalent) section. If not
defined, GCC will assume such a section does not exist. Do not define
both this macro and @code{FINI_SECTION_ASM_OP}.
@end defmac
@defmac CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function})
2002-01-27 05:18:12 +01:00
If defined, an ASM statement that switches to a different section
via @var{section_op}, calls @var{function}, and switches back to
the text section. This is used in @file{crtstuff.c} if
@code{INIT_SECTION_ASM_OP} or @code{FINI_SECTION_ASM_OP} to calls
to initialization and finalization functions from the init and fini
sections. By default, this macro uses a simple function call. Some
ports need hand-crafted assembly code to avoid dependencies on
registers initialized in the function prologue or to ensure that
constant pools don't end up too far way in the text section.
@end defmac
@defmac TARGET_LIBGCC_SDATA_SECTION
If defined, a string which names the section into which small
variables defined in crtstuff and libgcc should go. This is useful
when the target has options for optimizing access to small data, and
you want the crtstuff and libgcc routines to be conservative in what
they expect of your application yet liberal in what your application
expects. For example, for targets with a @code{.sdata} section (like
MIPS), you could compile crtstuff with @code{-G 0} so that it doesn't
require small data support from your application, but use this macro
to put small data into @code{.sdata} so that your application can
access these variables whether it uses small data or not.
@end defmac
@defmac FORCE_CODE_SECTION_ALIGN
2002-01-27 05:18:12 +01:00
If defined, an ASM statement that aligns a code section to some
arbitrary boundary. This is used to force all fragments of the
@code{.init} and @code{.fini} sections to have to same alignment
and thus prevent the linker from having to add any padding.
@end defmac
2002-01-27 05:18:12 +01:00
@defmac JUMP_TABLES_IN_TEXT_SECTION
Define this macro to be an expression with a nonzero value if jump
tables (for @code{tablejump} insns) should be output in the text
section, along with the assembler instructions. Otherwise, the
readonly data section is used.
1996-09-25 01:21:45 +02:00
This macro is irrelevant if there is no separate readonly data section.
@end defmac
1996-09-25 01:21:45 +02:00
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@deftypefn {Target Hook} void TARGET_ASM_INIT_SECTIONS (void)
Define this hook if you need to do something special to set up the
@file{varasm.c} sections, or if your target has some special sections
of its own that you need to create.
GCC calls this hook after processing the command line, but before writing
any assembly code, and before calling any of the section-returning hooks
described below.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} int TARGET_ASM_RELOC_RW_MASK (void)
re PR target/26090 (IA-64 creates DT_TEXTREL binaries) PR target/26090 * target.h (targetm.asm.out.reloc_rw_mask): New. * target-def.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_OUT): Use it. * targhooks.c, targhooks.h (default_reloc_rw_mask): New. * varasm.c (categorize_decl_for_section): Remove shlib argument; use the new reloc_rw_mask target hook instead. (default_section_type_flags_1): Merge into... (default_section_type_flags): ... here. (decl_readonly_section_1): Merge into... (decl_readonly_section): ... here. (default_elf_select_section_1): Merge into... (default_elf_select_section): ... here. (default_unique_section_1): Merge into... (default_unique_section): ... here. (compute_reloc_for_rtx_1, compute_reloc_for_rtx): New. (default_select_rtx_section): Use it. (default_elf_select_rtx_section): Likewise. * output.h: Update to match. * doc/tm.texi (TARGET_ASM_RELOC_RW_MASK): New. * config/alpha/alpha.c (alpha_elf_reloc_rw_mask): New. (TARGET_ASM_RELOC_RW_MASK): New. * config/i386/i386.c (x86_64_elf_select_section): Adjust call to categorize_decl_for_section. (x86_64_elf_unique_section): Likewise. * config/ia64/hpux.h (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION, TARGET_ASM_SELECT_RTX_SECTION): Remove. (TARGET_ASM_RELOC_RW_MASK): New. * config/ia64/ia64.c (ia64_rwreloc_select_section, ia64_rwreloc_unique_section, ia64_rwreloc_select_rtx_section): Remove. (ia64_hpux_reloc_rw_mask, ia64_reloc_rw_mask): New. (TARGET_RWRELOC): Remove. (ia64_section_type_flags): Adjust call to default_section_type_flags. * config/ia64/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Remove. (rs6000_elf_select_section, rs6000_elf_unique_section): Remove. (rs6000_elf_reloc_rw_mask, rs6000_xcoff_reloc_rw_mask): New. (rs6000_xcoff_select_section): Use decl_readonly_section. (rs6000_xcoff_section_type_flags): Use default_section_type_flags. * config/rs6000/sysv4.h (TARGET_ASM_RELOC_RW_MASK): New. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): Remove. (TARGET_SECTION_TYPE_FLAGS): Remove. * config/rs6000/xcoff.h (TARGET_ASM_RELOC_RW_MASK): New. From-SVN: r122781
2007-03-10 01:53:09 +01:00
Return a mask describing how relocations should be treated when
selecting sections. Bit 1 should be set if global relocations
should be placed in a read-write section; bit 0 should be set if
local relocations should be placed in a read-write section.
The default version of this function returns 3 when @option{-fpic}
is in effect, and 0 otherwise. The hook is typically redefined
when the target cannot support (some kinds of) dynamic relocations
in read-only sections even in executables.
@end deftypefn
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_SECTION (tree @var{exp}, int @var{reloc}, unsigned HOST_WIDE_INT @var{align})
Return the section into which @var{exp} should be placed. You can
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
assume that @var{exp} is either a @code{VAR_DECL} node or a constant of
some sort. @var{reloc} indicates whether the initial value of @var{exp}
requires link-time relocations. Bit 0 is set when variable contains
local relocations only, while bit 1 is set for global relocations.
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@var{align} is the constant alignment in bits.
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
The default version of this function takes care of putting read-only
variables in @code{readonly_data_section}.
See also @var{USE_SELECT_SECTION_FOR_FUNCTIONS}.
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
@end deftypefn
@defmac USE_SELECT_SECTION_FOR_FUNCTIONS
Define this macro if you wish TARGET_ASM_SELECT_SECTION to be called
for @code{FUNCTION_DECL}s as well as for variables and constants.
In the case of a @code{FUNCTION_DECL}, @var{reloc} will be zero if the
function has been determined to be likely to be called, and nonzero if
it is unlikely to be called.
@end defmac
hooks.c (hook_tree_bool_false): New. * hooks.c (hook_tree_bool_false): New. * hooks.h: Declare it. * target-def.h (TARGET_ASM_SELECT_SECTION): New. (TARGET_ASM_UNIQUE_SECTION, TARGET_IN_SMALL_DATA_P): New. * target.h (select_section, unique_section): New. (in_small_data_p): New. * varasm.c (resolve_unique_section): Use hooks instead of macros. (variable_section, output_constant_def_contents): Likewise. (default_select_section, default_unique_section): New. (categorize_decl_for_section, default_elf_select_section): New. * output.h: Declare them. * config/darwin.h (ALIAS_SECTION, try_section_alias): Remove. (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/darwin.c (machopic_select_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/nextstep.c (nextstep_select_section): ... here. * config/nextstep-protos.h: Update. * config/elfos.h (UNIQUE_SECTION, SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/svr3.h (SELECT_SECTION): Remove. * config/alpha/alpha.c (unicosmk_unique_section): Make static. (TARGET_ASM_UNIQUE_SECTION) [UNICOS]: New. (TARGET_IN_SMALL_DATA_P, alpha_in_small_data_p): New. (alpha_encode_section_info): Use it. * config/alpha/alpha-protos.h: Update. * config/alpha/elf.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/alpha/unicosmk.h (UNIQUE_SECTION): Remove. * config/arm/pe.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/avr/avr.c (TARGET_ASM_UNIQUE_SECTION): New. (avr_unique_section): Rename from unique_section; make static. * config/avr/avr-protos.h: Update. * config/avr/avr.h (UNIQUE_SECTION): Remove. * config/c4x/c4x.h (SELECT_SECTION): Remove. * config/i386/cygwin.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/i386/i386-interix.h: Likewise. * config/i386/win32.h: Likewise. * config/i386/djgpp.h (UNIQUE_SECTION): Remove. * config/i386/i386.c (ix86_asm_file_end): Use target hook not macro. * config/i386/sco5.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/i386/svr3gas.h (SELECT_SECTION): Remove. * config/i860/paragon.h: Undef TARGET_ASM_SELECT_SECTION instead of SELECT_SECTION. * config/m68k/dpx2.h: Likewise. * config/rs6000/lynx.h: Likewise. * config/ia64/aix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/ia64/ia64.c (TARGET_IN_SMALL_DATA_P): New. (ia64_in_small_data_p): New. (ia64_encode_section_info): Use it. Reorganize overlarge conditional. (ia64_aix_select_section, ia64_aix_unique_section): New. * config/ia64/sysv4.h (DO_SELECT_SECTION): Remove. (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/m32r/m32r.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/m32r/m32r.c (m32r_select_section): Take align argument. * config/m32r/m32r-protos.h: Update. * config/m88k/m88k.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/m88k/m88k.c (m88k_select_section): ... here. * config/mcore/mcore-pe.h (SELECT_SECTION): Remove. * config/mcore/mcore.h (UNIQUE_SECTION): Remove. * config/mcore/mcore.c (TARGET_ASM_UNIQUE_SECTION): New. (mcore_unique_section): Make static. * config/mcore/mcore-protos.h: Update. * config/mips/elf.h (UNIQUE_SECTION): Remove. (TARGET_ASM_UNIQUE_SECTION): New. * config/mips/elf64.h: Likewise. * config/mips/iris6gld.h: Likewise. * config/mips/linux.h: Likewise. * config/mips/mips-protos.h: Update. * config/mips/mips.c (mips_select_section): Add align argument. * config/mips/mips.h (SELECT_SECTION): Remove. (TARGET_ASM_SELECT_SECTION): New. * config/mmix/mmix.h (SELECT_SECTION, UNIQUE_SECTION): Remove. * config/mmix/mmix.c (mmix_select_section): Remove. (mmix_unique_section): Remove. * config/mmix/mmix-protos.h: Update. * config/pa/pa.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/pa/pa.c (pa_select_section): ... here. * config/pa/pa64-hpux.h (UNIQUE_SECTION): Remove. * config/rs6000/rs6000.c (rs6000_elf_select_section): Rename from rs6000_select_section and make static. (rs6000_elf_unique_section): Similarly. (rs6000_xcoff_select_section): From xcoff.h. (rs6000_xcoff_unique_section): Likewise. * config/rs6000/rs6000-protos.h: Update. * config/rs6000/sysv4.h (SELECT_SECTION, UNIQUE_SECTION): Remove. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_UNIQUE_SECTION): New. * config/rs6000/xcoff.h: Likewise. * config/sparc/aout.h (TARGET_ASM_SELECT_SECTION): New. (SELECT_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_section): ... here. * config/v850/v850.h (SELECT_SECTION): Move ... * config/v850/v850.c (v850_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * config/vax/vms.h (SELECT_SECTION): Move ... * config/vax/vax.c (vms_select_section): ... here. (TARGET_ASM_SELECT_SECTION): New. * doc/tm.texi: Update SELECT_SECTION and UNIQUE_SECTION docs for the target hooks. From-SVN: r53550
2002-05-17 09:43:41 +02:00
@deftypefn {Target Hook} void TARGET_ASM_UNIQUE_SECTION (tree @var{decl}, int @var{reloc})
Build up a unique section name, expressed as a @code{STRING_CST} node,
and assign it to @samp{DECL_SECTION_NAME (@var{decl})}.
As with @code{TARGET_ASM_SELECT_SECTION}, @var{reloc} indicates whether
the initial value of @var{exp} requires link-time relocations.
The default version of this function appends the symbol name to the
ELF section name that would normally be used for the symbol. For
example, the function @code{foo} would be placed in @code{.text.foo}.
Whatever the actual target object format, this is often good enough.
@end deftypefn
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
@deftypefn {Target Hook} {section *} TARGET_ASM_FUNCTION_RODATA_SECTION (tree @var{decl})
Return the readonly data section associated with
@samp{DECL_SECTION_NAME (@var{decl})}.
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
The default version of this function selects @code{.gnu.linkonce.r.name} if
the function's section is @code{.gnu.linkonce.t.name}, @code{.rodata.name}
if function is in @code{.text.name}, and the normal readonly-data section
otherwise.
@end deftypefn
@deftypevr {Target Hook} {const char *} TARGET_ASM_MERGEABLE_RODATA_PREFIX
Usually, the compiler uses the prefix @code{".rodata"} to construct
section names for mergeable constant data. Define this macro to override
the string if a different section name should be used.
@end deftypevr
@deftypefn {Target Hook} {section *} TARGET_ASM_TM_CLONE_TABLE_SECTION (void)
Return the section that should be used for transactional memory clone tables.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {section *} TARGET_ASM_SELECT_RTX_SECTION (machine_mode @var{mode}, rtx @var{x}, unsigned HOST_WIDE_INT @var{align})
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
Return the section into which a constant @var{x}, of mode @var{mode},
should be placed. You can assume that @var{x} is some kind of
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
constant in RTL@. The argument @var{mode} is redundant except in the
alpha.c (alpha_start_function): Use switch_to_section. * config/alpha/alpha.c (alpha_start_function): Use switch_to_section. (alpha_elf_select_rtx_section): Return the selected section rather than emitting assembly code. (alpha_write_linkage): Emit a ".link" directive directly and then set in_section to NULL. (vms_asm_out_constructor): Use switch_to_section. (vms_asm_out_destructor): Likewise. (unicosmk_output_common): Set in_section to NULL instead of calling the dummy common_section function. (unicosmk_text_section): Delete in favor of... (unicosmk_output_text_section_asm_op): ...this new function. (unicosmk_data_section): Delete in favor of... (unicosmk_output_data_section_asm_op): ...this new function. (unicosmk_init_sections): New function. (unicosmk_output_deferred_case_vectors): Use switch_to_section. (unicosmk_output_ssib): Set in_section to NULL instead of calling the dummy ssib_section function. (unicosmk_section_buf): Delete. * config/alpha/alpha-protos.h (unicosmk_text_section): Delete. (unicosmk_data_section): Delete. * config/alpha/elf.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, sbss_section, sdata_section) (SECTION_FUNCTION_TEMPLATE): Delete. * config/alpha/unicosmk.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP) (READONLY_DATA_SECTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (common_section, COMMON_SECTION, ssib_section, SSIB_SECTION): Delete. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. (TARGET_ASM_INIT_SECTIONS): Define. * config/alpha/vms.h (LINK_SECTION_ASM_OP, LITERALS_SECTION_ASM_OP) (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (link_section, literals_section): Delete. (ASM_OUTPUT_DEF): Emit the ".literal" directive directly and then set in_section to NULL. * config/arm/aof.h (TEXT_SECTION_ASM_OP, DATA_SECTION_ASM_OP): Delete. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, ZERO_INIT_SECTION): Delete. (COMMON_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_COMMON): Set in_section to NULL rather than calling the dummy common_section function. * config/arm/aout.h (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/arm/arm.c (get_jump_table_size): Use pointer comparison between readonly_data_section and text_section to check whether read-only data is being put in the text section. (arm_output_function_epilogue): Use switch_to_section. (arm_elf_asm_constructor): Likewise. (thumb_call_via_reg): Replace call to in_text_section with a comparison between in_section and text_section. (arm_file_end): Use switch_to_section. (aof_text_section): Delete in favor of... (aof_output_text_section_asm_op): ...this new function. (aof_data_section): Delete in favor of... (aof_output_data_section_asm_op): ...this new function. (aof_asm_init_sections): New function. (zero_init_section): Moved from config/arm/aof.h. (aof_dump_imports, aof_file_start): Use switch_to_section. * config/arm/arm.h (thumb_call_via_label): Update comment. * config/arm/arm-protos.h (aof_text_section, aof_data_section): Delete. (common_section): Delete. * config/arm/pe.h (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION) (SWITCH_TO_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro. * config/arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use get_named_section and switch_to_section. * config/avr/avr.c (progmem_section): New variable. (avr_output_progmem_section_asm_op): New function. (avr_asm_init_sections): New function. (avr_output_addr_vec_elt): Use switch_to_section. * config/avr/avr.h (progmem_section): Declare. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/avr/avr-protos.h (progmem_section): Delete. * config/bfin/bfin.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/c4x/c4x.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (INIT_SECTION_FUNCTION, FINI_SECTION_FUNCTION): Delete. * config/darwin-sections.def: New file. * config/darwin.c: Define all sections in darwin-sections.def. (output_objc_section_asm_op, darwin_init_sections): New functions. (machopic_output_indirection): Use switch_to_section. (machopic_select_section): Return the selected section rather than emitting assembly code. Replace the static function table with inline conditional expressions. Update the tests of last_text_section and move them into the FUNCTION_DECL block. (machopic_select_rtx_section): Return the selected section rather than emitting assembly code. (machopic_asm_out_constructor, machopic_asm_out_destructor) (darwin_file_end): Use switch_to_section. * config/darwin.h: Use darwin-sections.def to declare sections. (INIT_SECTION_ASM_OP): Remove empty definition. (HAS_INIT_SECTION): Define this instead. (SECTION_FUNCTION, EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. (TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/darwin-protos.h (darwin_init_sections): Declare. (machopic_picsymbol_stub_section, machopic_picsymbol_stub1_section) (machopic_symbol_stub_section, machopic_symbol_stub1_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (constructor_section, destructor_section, mod_init_section): Delete. (mod_term_section): Delete. (darwin_exception_section, darwin_eh_frame_section): Delete. (machopic_select_section): Return a section. (machopic_select_rtx_section): Likewise. (text_coal_section, text_unlikely_section, text_unlikely_coal_section) (const_section, const_coal_section, const_data_section): Delete. (const_data_coal_section, data_coal_section, cstring_section): Delete. (literal4_section, literal8_section, constructor_section): Delete. (mod_init_section, mod_term_section, destructor_section): Delete. (objc_class_section, objc_meta_class_section, objc_category_section) (objc_class_vars_section, objc_instance_vars_section): Delete. (objc_cls_meth_section, objc_inst_meth_section): Delete. (objc_cat_cls_meth_section, objc_cat_inst_meth_section): Delete. (objc_selector_refs_section, objc_selector_fixup_section): Delete. (objc_symbols_section, objc_module_info_section): Delete. (objc_image_info_section, objc_protocol_section): Delete. (objc_string_object_section, objc_constant_string_object_section) (objc_class_names_section, objc_meth_var_names_section): Delete. (objc_meth_var_types_section, objc_cls_refs_section): Delete. (machopic_lazy_symbol_ptr_section, machopic_nl_symbol_ptr_section) (machopic_symbol_stub_section, machopic_picsymbol_stub_section) (darwin_exception_section, darwin_eh_frame_section): Delete. * config/t-darwin (darwin.o): Depend on config/darwin-sections.def. * config/frv/frv.c (frv_asm_out_constructor): Use switch_to_section. (frv_asm_out_destructor): Likewise. * config/frv/frv.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, FIXUP_SECTION_FUNCTION): Delete. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section and get_named_section. (ASM_OUTPUT_CASE_LABEL): Use switch_to_section. * config/frv/frv-protos.h (fixup_section, sdata_section, sbss_section) (data_section): Delete. * config/i386/cygming.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (DRECTVE_SECTION_FUNCTION): Delete. (drectve_section): Redefine as a macro that sets in_section after emitting the directive. (SWITCH_TO_SECTION_FUNCTION): Delete. * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Replace call to in_text_section with comparison between in_section and text_section. * config/i386/i386.c (x86_64_elf_select_section): Return the section rather than emitting assembly code. Use get_named_section. (x86_output_aligned_bss, ix86_file_end): Use switch_to_section and get_named_section. (machopic_output_stub): Use switch_to_section. * config/i386/nwld.c (nwld_named_section_asm_out_constructor) (nwld_named_section_asm_out_destructor): Use get_section and switch_to_section. * config/ia64/ia64.c (ia64_select_rtx_section): Return the section rather than emitting assembly code. (ia64_rwreloc_select_section): Likewise. (ia64_rwreloc_select_rtx_section): Likewise. * config/ia64/ia64-protos.h (sdata_section, sbss_section): Delete. * config/ia64/sysv4.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SDATA_SECTION_FUNCTION, SBSS_SECTION_FUNCTION): Delete. * config/iq2000/iq2000.c (iq2000_select_rtx_section): Return the section rather than emitting assembly code. (iq2000_select_section): Likewise. * config/iq2000/iq2000.h (rdata_section, sdata_section): Delete. (sbss_section): Delete. * config/m32r/m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use switch_to_section and get_named_section. * config/m32r/m32r-protos.h (sbss_section, sdata_section): Delete. * config/mcore/mcore-elf.h (EXPORTS_SECTION_ASM_OP): Delete. (SUBTARGET_EXTRA_SECTIONS, SUBTARGET_EXTRA_SECTION_FUNCTIONS): Delete. (EXPORT_SECTION_FUNCTION, SUBTARGET_SWITCH_SECTIONS): Delete. (MCORE_EXPORT_NAME): Emit the exports directive directly, then set in_section to NULL. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. * config/mcore/mcore.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (SWITCH_SECTION_FUNCTION): Delete. * config/mcore/mcore-pe.h (SUBTARGET_SWITCH_SECTIONS): Delete. (DRECTVE_SECTION_ASM_OP, SUBTARGET_EXTRA_SECTIONS): Delete. (SUBTARGET_EXTRA_SECTION_FUNCTIONS, DRECTVE_SECTION_FUNCTION): Delete. (MCORE_EXPORT_NAME): Emit ".section .drectve" directly, then set in_section to NULL. (ASM_DECLARE_OBJECT_NAME): Update the type of save_section. Use the global switch_to_section function instead of the old port-local one. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. * config/mips/mips.c (mips_file_start): Update comment. (mips_output_aligned_bss): Use switch_to_section and get_named_section. (mips_output_aligned_decl_common): Use switch_to_section. (mips_select_rtx_section): Return the section rather than emitting assembly code. Use get_named_section. (mips_function_rodata_section: Likewise get_section. (build_mips16_function_stub): Use switch_to_section. * config/mips/mips.h (ASM_OUTPUT_IDENT): Use switch_to_section. (SDATA_SECTION_ASM_OP): Delete. * config/mips/vxworks.h (EXTRA_SECTIONS): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. * config/mmix/mmix.c (mmix_file_start, mmix_file_end) (mmix_asm_output_aligned_local): Use switch_to_section. * config/pa/pa.c (som_readonly_data_section, som_one_only_data_section) (som_one_only_readonly_data_section): New variables. (pa_output_function_epilogue): Set in_section to NULL instead of calling forget_section. (output_deferred_plabels): Use select_section. (pa_asm_output_mi_thunk): Likewise. Set in_section to NULL instead of calling forget_section. (pa_asm_output_aligned_bss, pa_asm_output_aligned_common) (pa_asm_output_aligned_local): Use select_section. (som_text_section_asm_op): Delete in favor of... (som_output_text_section_asm_op): ...this new function. (pa_som_asm_init_sections): New function. (pa_select_section): Return the section rather than emitting assembly code. * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (SOM_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION): Delete. (SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION): Delete. * config/pa/pa-protos.h (som_text_section_asm_op): Delete. (som_readonly_data_section, som_one_only_readonly_data_section) (som_one_only_data_section, forget_section): Delete. * config/pa/som.h (TEXT_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Delete. * config/rs6000/rs6000.c (read_only_data_section): New variable. (private_data_section, read_only_private_data_section): New variables. (sdata2_section, toc_section): New variables. (rs6000_file_start): Use switch_to_section. (rs6000_assemble_integer): Use comparisons against in_section instead of calling in_toc_section and in_text_section. Use unlikely_text_section_p. (rs6000_elf_output_toc_section_asm_op): New function, derived from the old rs6000/sysv4.h toc_section function. (rs6000_elf_asm_init_sections): New function. (rs6000_elf_select_rtx_section, rs6000_elf_select_section): Return the section rather than emitting assembly code. (machopic_output_stub): Use switch_to_section. (toc_section): Delete dummy function. (rs6000_elf_asm_out_constructor, rs6000_elf_asm_out_destructor): Use switch_to_section and get_section. (rs6000_xcoff_output_readonly_section_asm_op): New function. (rs6000_xcoff_output_readwrite_section_asm_op): New function. (rs6000_xcoff_output_toc_section_asm_op): New function, derived from the old rs6000/xcoff.h toc_section function. (rs6000_xcoff_asm_init_sections): New function. (rs6000_xcoff_select_section, rs6000_xcoff_select_rtx_section): Return the section rather than emitting assembly code. (rs6000_xcoff_file_start): Use switch_to_section. (rs6000_xcoff_file_end): Likewise. * config/rs6000/rs6000-protos.h (toc_section, sdata_section): Delete. (sdata2_section, sbss_section, private_data_section): Delete. (read_only_data_section, read_only_private_data_section): Delete. * config/rs6000/sysv4.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (TOC_SECTION_FUNCTION, SDATA_SECTION_FUNCTION, SDATA2_SECTION_FUNCTION) (SBSS_SECTION_FUNCTION, INIT_SECTION_FUNCTION): Delete. (FINI_SECTION_FUNCTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_OUTPUT_ALIGNED_LOCAL): Use switch_to_section. * config/rs6000/xcoff.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (READ_ONLY_DATA_SECTION_FUNCTION, PRIVATE_DATA_SECTION_FUNCTION) (READ_ONLY_PRIVATE_DATA_SECTION_FUNCTION, TOC_SECTION_FUNCTION) (READONLY_DATA_SECTION): Delete. (TARGET_ASM_INIT_SECTIONS): Define. (ASM_DECLARE_FUNCTION_NAME): Use switch_to_section. Set in_section to NULL rather than no_section. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/sh/sh.c (sh_file_start): Use switch_to_section. * config/sparc/sparc.c (emit_pic_helper): Use switch_to_section. (sparc_output_deferred_case_vectors): Likewise. Remove argument from call to current_function_section. * config/stormy16/stormy16.c: Include ggc.h and gt-storm16.h. (bss100_section): New variable. (xstormy16_asm_output_aligned_common): Use switch_to_section. (xstormy16_asm_init_sections): New function. (xstormy16_asm_out_destructor, xstormy16_asm_out_constructor): Use switch_to_section and get_section. (xstormy16_output_addr_vec): Use switch_to_section. Remove argument from calls to current_function_section. * config/stormy16/stormy16.h (EXTRA_SECTIONS): Delete. (XSTORMY16_SECTION_FUNCTION, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/stormy16/stormy16-protos.h (bss100_section): Delete. * config/svr3.h (ASM_OUTPUT_LOCAL): Use switch_to_section. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS, INIT_SECTION_FUNCTION) (FINI_SECTION_FUNCTION): Delete. * config/v850/v850.c: Include gt-v850.h. (rosdata_section, rozdata_section, tdata_section, zdata_section) (zbss_section): New variables. (v850_output_aligned_bss): Use switch_to_section. (v850_asm_init_sections): New function. (v850_select_section): Return the section rather than emitting assembly code. * config/v850/v850.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS) (ZDATA_SECTION_ASM_OP, ZBSS_SECTION_ASM_OP, TDATA_SECTION_ASM_OP) (ROSDATA_SECTION_ASM_OP, ROZDATA_SECTION_ASM_OP): Delete. (TARGET_ASM_INIT_SECTIONS): Define. * config/v850/v850-protos.h (sdata_section, rosdata_section): Delete. (sbss_section, tdata_section, zdata_section, rozdata_section): Delete. (zbss_section): Delete. * config/vax/vaxv.h (ASM_OUTPUT_LOCAL): Use switch_to_section. * config/vx-common.h (vxworks_exception_section): Delete. (TARGET_ASM_EXCEPTION_SECTION): Delete. * config/xtensa/xtensa.c (xtensa_select_rtx_section): Return the section rather than emitting assembly code. * config/xtensa/xtensa.h (ASM_OUTPUT_POOL_PROLOGUE): Use switch_to_section. * Makefile.in (GTFILES): Add $(srcdir)/output.h. * coretypes.h (section): New union and typedef. * dbxout.c (FORCE_TEXT): Use switch_to_section. Remove argument from call to current_function_section. (dbxout_function_end, dbxout_init, dbxout_source_file, dbxout_finish) (dbxout_symbol_location): Use switch_to_section. * dwarf2out.c (named_section_eh_frame_section): Delete, moving most of the code into... (default_eh_frame_section): ...here. Return a section. (collect2_eh_frame_section): Delete, moving most of the code into.. (switch_to_eh_frame_section): ...this new function. (debug_info_section, debug_abbrev_section, debug_aranges_section) (debug_macinfo_section, debug_line_section, debug_loc_section) (debug_pubnames_section, debug_str_section, debug_ranges_section): New variables. (output_call_frame_info): Call switch_to_eh_frame_section instead of eh_frame_section. Use switch_to_section and get_section. (dwarf2out_begin_prologue): Use switch_to_section. (AT_string_form): Check the flags in debug_str_section instead of DEBUG_STR_SECTION_FLAGS. (output_comp_unit): Use switch_to_section, get_section, and debug_info_section. (output_line_info, secname_for_decl): Use unlikely_text_section_p. (dwarf2out_begin_block): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_var_location): Use unlikely_text_section_p. (dwarf2out_source_line): Use switch_to_section. Remove argument from call to current_function_section. (dwarf2out_start_source_file, dwarf2out_end_source_file) (dwarf2out_define, dwarf2out_undef: Use switch_to_section and debug_macinfo_section. (dwarf2out_init): Initialize the new section variables. Use them instead of calls to named_section_flags. Use switch_to_section. (output_indirect_string): Use switch_to_section and debug_str_section. (dwarf2out_finish): Use switch_to_section and the new section variables. * except.c (default_exception_section): Return the section instead of emitting assembly code. (output_function_exception_table): Use the global exception_section variable instead of the target hook. Use switch_to_section. Remove argument from call to current_function_section. * final.c (HAVE_READONLY_DATA_SECTION): Delete. (shorten_branches): Use pointer comparisons to detect whether the text section is the same as readonly_data_section. (profile_function): Use switch_to_section. Remove argument from call to current_function_section. (final_scan_insn): Likewise. Update use of last_text_section. * gengtype.c (open_base_files): Add an include of output.h. * output.h (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section, sdata_section): Turn into section pointers. (in_text_section, in_unlikely_text_section, exports_section) (drectve_section, named_section, mergeable_string_section) (last_text_section_name): Delete. (default_exception_section, default_eh_frame_section): Return sections. (SECTION_DECLARED, SECTION_NAMED): New macros. (SECTION_MACH_DEP): Bump value. (section_common, named_section, unnamed_section): New structures. (unnamed_section_callback): New typedef. (section): New union. (sbss_section, exception_section, eh_frame_section): New variables. (in_section, last_text_section): Turn into section pointers. (get_unnamed_section, get_section, get_named_section): New functions. (mergeable_constant_section, function_section): Return a section. (unlikely_text_section): Likewise. (current_function_section): Likewise. Remove the decl argument. (unlikely_text_section_p, switch_to_section): New functions. (output_section_asm_op): New function. (set_named_section_flags, named_section_flags, named_section_real) (named_section_first_declaration): Delete. (default_select_section, default_elf_select_section): Return a section. (default_elf_select_section_1, default_function_rodata_section) (default_no_function_rodata_section, default_select_rtx_section) (default_elf_select_rtx_section): Likewise. * rtl.h (in_data_section): Delete. * sdbout.c (sdbout_one_type): Use switch_to_section. * system.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Poison. (READONLY_DATA_SECTION, TARGET_ASM_EXCEPTION_SECTION): Poison. (TARGET_ASM_EH_FRAME_SECTION): Poison. * target-def.h (TARGET_ASM_INIT_SECTIONS): New macro. (TARGET_ASM_EXCEPTION_SECTION, TARGET_ASM_EH_FRAME_SECTION): Delete. (TARGET_ASM_OUT): Update after above changes. * target.h (init_sections): New hook. (exception_section, eh_frame_section): Delete. (select_section, select_rtx_section, function_rodata_section): Return a section rather than emitting assembly code. * varasm.c (text_section, data_section, readonly_data_section) (ctors_section, dtors_section, bss_section, init_section) (fini_section): Turn into section pointers. (sdata_section, sbss_section, exception_section): New variables. (eh_frame_section): New variable. (in_section): Make global and turn into a section pointer. (last_text_section): Turn into a section pointer. (unnamed_sections): New variable. (in_named_name, last_text_section_name): Delete. (EXTRA_SECTION_FUNCTIONS): Delete. (in_named_entry): Delete. (section_htab): New variable, replacing... (in_named_htab): ...this deleted variable. (section_entry_eq, section_entry_hash): New functions, based on... (in_named_entry_eq, in_named_entry_hash): ...these deleted functions. (get_unnamed_section, get_section): New functions. (unlikely_text_section): Return a section instead of emitting assembly code. (in_text_section, in_unlikely_text_section, in_data_section): Delete. (get_named_section_flags, named_section_first_declaration): Delete. (unlikely_text_section_p): New function. (named_section_real, named_section): Delete. (get_named_section): New function. (asm_output_bss, asm_output_aligned_bss): Use switch_to_section. (function_section): Return a section rather than emitting assembly code. (current_function_section): Likewise. Remove argument. Use last_text_section if nonnull, otherwise use function_section. (default_function_rodata_section): Return a section rather than emitting assembly code. Use get_section. (default_no_function_rodata_section): Return a section rather than emitting assembly code. (variable_section): Use switch_to_section and get_named_section. (mergeable_string_section): Return a section rather than emitting assembly code. Use get_section. Make static. Don't take special countermeasures for empty strings. (mergeable_constant_section): Return a section rather than emitting assembly code. Use get_section. (default_named_section_asm_out_destructor): Use switch_to_section and get_section. (default_dtor_section_asm_out_destructor): Use switch_to_section. (default_named_section_asm_out_constructor): Use switch_to_section and get_section. (default_ctor_section_asm_out_constructor): Use switch_to_section. (assemble_start_function): Likewise. Set last_text_section to NULL rather than no_section. Change the type of save_section. (assemble_zeros, assemble_variable): Use the section flags to detect whether or not a section is text. (assemble_static_space): Use switch_to_section. (assemble_trampoline_template): Likewise. (output_constant_def_contents): Use switch_to_section and get_named_section. (output_constant_pool_1): Use switch_to_section. Use the section flags to see whether sections contain mergeable data. (init_varasm_once): Initialize section_htab instead of in_named_htab. Initialize new section variables. Call TARGET_ASM_INIT_SECTIONS. (default_elf_asm_named_section): Use SECTION_DECLARED to detect whether a section has already been declared. (default_select_section, default_elf_select_section): Return a section rather than emitting assembly code. (default_elf_select_section_1): Likewise. Use bss_section for SECCAT_BSS if nonnull. Use get_named_section. (default_select_rtx_section): Return a section rather than emitting assembly code. (default_elf_select_rtx_section): Likewise. Use get_named_section. (file_end_indicate_exec_stack): Use switch_to_section and get_section. (output_section_asm_op, switch_to_section): New functions. * vmsdbgout.c (vmsdbgout_finish): Use switch_to_section and get_named_section. * doc/tm.texi: Expand the introduction to the sections documentation. (TRAMPOLINE_SECTION): Document new interface. (SDATA_SECTION_ASM_OP): Document new macro. (READONLY_DATA_SECTION): Delete. (SDATA_SECTION_ASM_OP): Document new macro. (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Delete. (TARGET_ASM_INIT_SECTIONS): Document new hook. (TARGET_ASM_SELECT_SECTION, TARGET_ASM_FUNCTION_RODATA_SECTION) (TARGET_ASM_SELECT_RTX_SECTION): Adjust for new interface. (TARGET_EXCEPTION_SECTION, TARGET_EH_FRAME_SECTION): Delete. gcc/java/ * class.c (build_utf8_ref, emit_register_classes): Use switch_to_section and get_section. From-SVN: r108152
2005-12-07 08:53:14 +01:00
case of a @code{const_int} rtx. @var{align} is the constant alignment
in bits.
system.h (SELECT_RTX_SECTION): Poison. * system.h (SELECT_RTX_SECTION): Poison. * target-def.h (TARGET_ASM_SELECT_RTX_SECTION): New. * target.h (select_rtx_section): New. * varasm.c (output_constant_pool): Use it. (default_select_rtx_section, default_elf_select_rtx_section): New. * output.h: Declare them. * config/darwin.h (SELECT_RTX_SECTION): Move ... * config/darwin.c (machopic_select_rtx_section): ... here. * config/darwin-protos.h: Update. * config/nextstep.h (SELECT_RTX_SECTION): Move ... * config/nextstep.c (machopic_select_rtx_section): ... here. (nextstep_select_section): Rename variable to avoid macro clash. * config/nextstep-protos.h: Update. * config/elfos.h, config/svr3.h, config/arm/aof.h, config/c4x/c4x.h, config/i386/dgux.h, config/i386/osfrose.h, config/i386/sco5.h, config/i386/svr3gas.h, config/i860/paragon.h, config/ia64/aix.h, config/m32r/m32r.h, config/m68k/dpx2.h, config/m68k/lynx.h, config/m68k/m68k.h, config/m68k/tower-as.h, config/m88k/dgux.h, config/mcore/mcore-pe.h, config/mips/mips.h, config/mmix/mmix.h, config/pa/pa-linux.h, config/pa/pa.h, config/romp/romp.h, config/rs6000/lynx.h, config/rs6000/sysv4.h, config/s390/linux.h, config/sparc/sysv4.h, config/xtensa/elf.h, config/xtensa/linux.h (SELECT_RTX_SECTION): Remove. * config/darwin.h, config/elfos.h, config/nextstep.h, config/ia64/aix.h, config/ia64/sysv4.h, config/alpha/alpha.c, config/mips/mips.c, config/romp/romp.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/s390.c, config/sparc/aout.h, config/sparc/lynx.h, config/xtensa/xtensa.c (TARGET_ASM_SELECT_RTX_SECTION): New. * config/alpha/elf.h (SELECT_RTX_SECTION): Move ... * config/alpha/alpha.c (alpha_elf_select_rtx_section): ... here. * config/ia64/sysv4.h (SELECT_RTX_SECTION): Move ... * config/ia64/ia64.c (ia64_select_rtx_section): ... here. (ia64_aix_select_rtx_section): New. * config/mips/iris6.h (READONLY_DATA_SECTION_ASM_OP): Undef before redefining. * config/mips/mips.c (mips_select_rtx_section): Make static. Support ELF SHF_MERGE features. * config/mips/mips-protos.h: Update. * config/rs6000/xcoff.h (SELECT_RTX_SECTION): Move ... * config/rs6000/rs6000.c (rs6000_xcoff_select_rtx_section): ... here. (rs6000_elf_select_rtx_section): Rename from rs6000_select_rtx_section; make static, fall back to default_elf_select_rtx_section. * config/rs6000/rs6000-protos.h: Update. * config/sparc/sparc.h (SELECT_RTX_SECTION): Move ... * config/sparc/sparc.c (sparc_aout_select_rtx_section): ... here. * config/sparc/sunos4.h (on_exit): Declare only if IN_LIBGCC2. * config/romp/romp.c (romp_select_rtx_section): New. * config/s390/s390.c (s390_select_rtx_section): New. * config/xtensa/xtensa.c: Include output.h. Shuffle local function declarations before target macro definition. (xtensa_emit_call): Use static buffer. (xtensa_select_rtx_section): New. * config/xtensa/xtensa.h (MAX_INT_TYPE_SIZE): Remove. (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR): Remove. (ASM_OUTPUT_POOL_PROLOGUE): Update call to resolve_unique_section. * doc/tm.texi (TARGET_ASM_SELECT_RTX_SECTION): Update from SELECT_RTX_SECTION docs. From-SVN: r53600
2002-05-19 01:47:22 +02:00
The default version of this function takes care of putting symbolic
constants in @code{flag_pic} mode in @code{data_section} and everything
else in @code{readonly_data_section}.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} tree TARGET_MANGLE_DECL_ASSEMBLER_NAME (tree @var{decl}, tree @var{id})
Define this hook if you need to postprocess the assembler name generated
by target-independent code. The @var{id} provided to this hook will be
the computed name (e.g., the macro @code{DECL_NAME} of the @var{decl} in C,
or the mangled name of the @var{decl} in C++). The return value of the
hook is an @code{IDENTIFIER_NODE} for the appropriate mangled name on
your target system. The default implementation of this hook just
returns the @var{id} provided.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ENCODE_SECTION_INFO (tree @var{decl}, rtx @var{rtl}, int @var{new_decl_p})
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
Define this hook if references to a symbol or a constant must be
treated differently depending on something about the variable or
function named by the symbol (such as what section it is in).
The hook is executed immediately after rtl has been created for
@var{decl}, which may be a variable or function declaration or
an entry in the constant pool. In either case, @var{rtl} is the
rtl in question. Do @emph{not} use @code{DECL_RTL (@var{decl})}
in this hook; that field may not have been initialized yet.
In the case of a constant, it is safe to assume that the rtl is
a @code{mem} whose address is a @code{symbol_ref}. Most decls
will also have this form, but that is not guaranteed. Global
register variables, for instance, will have a @code{reg} for their
rtl. (Normally the right thing to do with such unusual rtl is
leave it alone.)
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
The @var{new_decl_p} argument will be true if this is the first time
that @code{TARGET_ENCODE_SECTION_INFO} has been invoked on this decl. It will
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
be false for subsequent invocations, which will happen for duplicate
declarations. Whether or not anything must be done for the duplicate
declaration depends on whether the hook examines @code{DECL_ATTRIBUTES}.
@var{new_decl_p} is always true when the hook is called for a constant.
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
@cindex @code{SYMBOL_REF_FLAG}, in @code{TARGET_ENCODE_SECTION_INFO}
The usual thing for this hook to do is to record flags in the
@code{symbol_ref}, using @code{SYMBOL_REF_FLAG} or @code{SYMBOL_REF_FLAGS}.
Historically, the name string was modified if it was necessary to
encode more than one bit of information, but this practice is now
discouraged; use @code{SYMBOL_REF_FLAGS}.
The default definition of this hook, @code{default_encode_section_info}
in @file{varasm.c}, sets a number of commonly-useful bits in
@code{SYMBOL_REF_FLAGS}. Check whether the default does what you need
before overriding it.
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} {const char *} TARGET_STRIP_NAME_ENCODING (const char *@var{name})
system.h (STRIP_NAME_ENCODING): Poison it. * system.h (STRIP_NAME_ENCODING): Poison it. * output.h (STRIP_NAME_ENCODING): Remove. (default_strip_name_encoding): Declare. * target-def.h (TARGET_STRIP_NAME_ENCODING): New. * target.h (strip_name_encoding): New. * varasm.c (default_strip_name_encoding): New. * dwarf2asm.c, varasm.c, config/darwin.c, config/darwin.h, config/alpha/alpha.c, config/arm/pe.c, config/avr/avr.c, config/cris/cris.c, config/i386/cygwin.h, config/i386/interix.c, config/i386/winnt.c, config/m32r/m32r.h, config/mcore/mcore-elf.h, config/mcore/mcore-pe.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mips/mips.c, config/mn10200/mn10200.h, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.h, config/pa/som.h, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/v850/v850.h: Use the hook, not the macro. * config/darwin-protos.h, config/darwin.c, config/darwin.h, config/alpha/alpha.c, config/alpha/alpha.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i386/cygwin.h, config/i386/i386-interix.h, config/i386/i386-protos.h, config/i386/win32.h, config/i386/winnt.c, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r.c, config/m32r/m32r.h, config/mcore/mcore.c, config/mcore/mcore.h, config/pa/pa.c, config/rs6000/rs6000.c, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/sh/sh.c, config/sh/sh.h, config/v850/v850.c, config/v850/v850.h: Move STRIP_NAME_ENCODING to out-of-line function and add TARGET_STRIP_NAME_ENCODING. * config/arm/arm.c, config/arm/arm.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h: Replace STRIP_NAME_ENCODING with TARGET_STRIP_NAME_ENCODING referencing existing function; make function static. * xcoffout.c: Include target.h * Makefile.in (xcoffout.o): Update. * config/avr/avr.c (avr_encode_section_info): Correct prototype. * config/avr/avr.h (STRIP_NAME_ENCODING): Remove. * config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Mark reloc argument unused. * config/sh/sh.c (TARGET_ENCODE_SECTION_INFO): New. * doc/tm.texi (TARGET_STRIP_NAME_ENCODING): Update from previous STRIP_NAME_ENCODING docs. From-SVN: r53615
2002-05-19 09:55:48 +02:00
Decode @var{name} and return the real name part, sans
the characters that @code{TARGET_ENCODE_SECTION_INFO}
may have added.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} bool TARGET_IN_SMALL_DATA_P (const_tree @var{exp})
Returns true if @var{exp} should be placed into a ``small data'' section.
The default version of this hook always returns false.
@end deftypefn
@deftypevr {Target Hook} bool TARGET_HAVE_SRODATA_SECTION
Contains the value true if the target places read-only
``small data'' into a separate section. The default value is false.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_PROFILE_BEFORE_PROLOGUE (void)
It returns true if target wants profile code emitted before prologue.
The default version of this hook use the target macro
@code{PROFILE_BEFORE_PROLOGUE}.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} bool TARGET_BINDS_LOCAL_P (const_tree @var{exp})
Returns true if @var{exp} names an object for which name resolution
rules must resolve to the current ``module'' (dynamic shared library
or executable image).
The default version of this hook implements the name resolution rules
for ELF, which has a looser model of global name binding than other
currently supported object file formats.
@end deftypefn
@deftypevr {Target Hook} bool TARGET_HAVE_TLS
Contains the value true if the target supports thread-local storage.
The default value is false.
@end deftypevr
1996-09-25 01:21:45 +02:00
@node PIC
@section Position Independent Code
@cindex position independent code
@cindex PIC
This section describes macros that help implement generation of position
independent code. Simply defining these macros is not enough to
tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... 2009-05-14 Paolo Bonzini <bonzini@gnu.org> * doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this in the former documentation of... (GO_IF_LEGITIMATE_ADDRESS): ... this. * ira-conflicts.c (get_dup_num): Use address_operand. * targhooks.c (default_legitimate_address_p): New. * targhooks.h (default_legitimate_address_p): New. * reload.c (strict_memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * recog.c (memory_address_p) [!GO_IF_LEGITIMATE_ADDRESS]: Call hook. * target.h (struct target): Add legitimate_address_p. * target-def.h (TARGET_LEGITIMATE_ADDRESS_P): New. (TARGET_INITIALIZER): Include it. * config/alpha/alpha.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/alpha/alpha-protos.h (alpha_legitimate_address_p): Remove. * config/alpha/alpha.c (alpha_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/frv/frv.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_P): Delete. * config/frv/frv-protos.h (frv_legitimate_address_p): Rename to... (frv_legitimate_address_p_1): ... this. * config/frv/frv.c (frv_legitimate_address_p): Forward to... (frv_legitimate_address_p_1): ... the renamed old frv_legitimate_address_p. * config/frv/predicates.md: Adjust calls to frv_legitimate_address_p. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/s390.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/s390/s390-protos.h (legitimate_address_p): Remove. * config/s390/s390.c (legitimate_address_p): Rename to... (s390_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/s390/constraints.md ("e"): Call strict_memory_address_p. * config/m32c/m32c.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m32c/m32c-protos.h (m32c_legitimate_address_p): Remove. * config/m32c/m32c.c (m32c_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/spu/spu.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/spu/spu-protos.h (spu_legitimate_address): Remove. * config/spu/spu.c (spu_legitimate_address): Rename to... (spu_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/sparc/sparc.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/sparc/sparc-protos.h (legitimate_address_p): Remove. * config/sparc/sparc.c (legitimate_address_p): Rename to... (sparc_legitimate_address_p): ... this, make static and return bool. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/i386/i386.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/i386/i386-protos.h (legitimate_address_p): Remove. * config/i386/i386.c (legitimate_address_p): Rename to... (ix86_legitimate_address_p): ... this, make static. (constant_address_p): Move after it, adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/avr/avr.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/avr/avr-protos.h (legitimate_address_p): Remove. * config/avr/avr.c (legitimate_address_p): Rename to... (avr_legitimate_address_p): ... this, make static. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/crx/crx.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/crx/crx-protos.h (crx_legitimate_address_p): Remove. * config/crx/crx.c (crx_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/xtensa/xtensa.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/xtensa/xtensa-protos.h (xtensa_legitimate_address_p): Remove. * config/xtensa/xtensa.c (xtensa_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/stormy16/stormy16.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/stormy16/stormy16-protos.h (xstormy16_legitimate_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68hc11/m68hc11.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68hc11/m68hc11-protos.h (m68hc11_go_if_legitimate_address): Remove. * config/m68hc11/m68hc11.c (m68hc11_go_if_legitimate_address): Rename to... (m68hc11_legitimate_address_p): ... this, make static. (go_if_legitimate_address_internal): Rename to... (m68hc11_legitimate_address_p_1): ... this. (legitimize_address): Adjust call. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/iq2000/iq2000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/iq2000/iq2000-protos.h (iq2000_legitimate_address_p): Remove. * config/iq2000/iq2000.c (iq2000_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mn10300/mn10300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mn10300/mn10300-protos.h (legitimate_address_p): Remove. * config/mn10300/mn10300.c (legitimate_address_p): Rename to... (mn10300_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/m68k/m68k.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/m68k/m68k-protos.h (m68k_legitimate_address_p): Remove. * config/m68k/m68k.c (m68k_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. (REG_OK_STRICT_FLAG, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P): Delete. (INT_REG_OK_FOR_BASE_P, INT_REG_OK_FOR_INDEX_P): Move above. * config/rs6000/rs6000.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/rs6000/rs6000-protos.h (rs6000_legitimate_address): Remove. * config/rs6000/rs6000.c (rs6000_legitimate_address): Rename to... (rs6000_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. (REG_MODE_OK_FOR_BASE_P): Delete. (rs6000_legitimize_reload_address): Use INT_REG_OK_FOR_BASE_P. * config/picochip/picochip.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/picochip/picochip-protos.h (picochip_legitimate_address_p): Delete. * config/picochip/picochip.c (picochip_legitimate_address_p): Make static, adjust types. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/score/score.c (score_address_p): Rename to... (score_legitimate_address_p): ... this. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/score/score3.c (score3_address_p): Rename to... (score3_legitimate_address_p): ... this. * config/score/score7.c (score7_address_p): Rename to... (score7_legitimate_address_p): ... this. * config/arm/arm.h (ARM_GO_IF_LEGITIMATE_ADDRESS, THUMB2_GO_IF_LEGITIMATE_ADDRESS, THUMB1_GO_IF_LEGITIMATE_ADDRESS, GO_IF_LEGITIMATE_ADDRESS): Delete. * config/arm/arm-protos.h (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Delete. (arm_legitimate_address_p): Rename to... (arm_legitimate_address_outer_p): ... this. * config/arm/constraints.md ("Uq"): Adjust call. * config/arm/predicates.md (arm_extendqisi_mem_op): Likewise. * config/arm/arm.c (arm_legitimate_address_p): New, rename old one to... (arm_legitimate_address_outer_p): ... this. (thumb1_legitimate_address_p, thumb2_legitimate_address_p): Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mips/mips.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mips/mips-protos.h (mips_legitimate_address_p): Remove. * config/mips/mips.c (mips_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/vax/vax.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/vax/vax-protos.h (legitimate_address_p): Remove. * config/vax/vax.c (legitimate_address_p): Rename to... (vax_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/h8300/h8300.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/h8300/h8300-protos.h (h8300_legitimate_address_p): Remove. * config/h8300/h8300.c (h8300_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/mmix/mmix.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/mmix/mmix-protos.h (mmix_legitimize_address): Remove. * config/mmix/mmix.c (mmix_legitimate_address): Rename to... (mmix_legitimate_address_p): ... this, make static. (TARGET_LEGITIMATE_ADDRESS_P): New. * config/bfin/bfin.h (GO_IF_LEGITIMATE_ADDRESS): Delete. * config/bfin/bfin-protos.h (bfin_legitimate_address_p): Remove. * config/bfin/bfin.c (bfin_legitimate_address_p): ... Make static. (TARGET_LEGITIMATE_ADDRESS_P): New. From-SVN: r147534
2009-05-14 15:42:45 +02:00
generate valid PIC; you must also add support to the hook
@code{TARGET_LEGITIMATE_ADDRESS_P} and to the macro
@code{PRINT_OPERAND_ADDRESS}, as well as @code{LEGITIMIZE_ADDRESS}. You
must modify the definition of @samp{movsi} to do something appropriate
when the source operand contains a symbolic address. You may also
need to alter the handling of switch statements so that they use
relative addresses.
@c i rearranged the order of the macros above to try to force one of
1996-09-25 01:21:45 +02:00
@c them to the next line, to eliminate an overfull hbox. --mew 10feb93
@defmac PIC_OFFSET_TABLE_REGNUM
1996-09-25 01:21:45 +02:00
The register number of the register used to address a table of static
data addresses in memory. In some cases this register is defined by a
processor's ``application binary interface'' (ABI)@. When this macro
1996-09-25 01:21:45 +02:00
is defined, RTL is generated for this register once, as with the stack
pointer and frame pointer registers. If this macro is not defined, it
is up to the machine-dependent files to allocate such a register (if
necessary). Note that this register must be fixed when in use (e.g.@:
when @code{flag_pic} is true).
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
A C expression that is nonzero if the register defined by
@code{PIC_OFFSET_TABLE_REGNUM} is clobbered by calls. If not defined,
the default is zero. Do not define
this macro if @code{PIC_OFFSET_TABLE_REGNUM} is not defined.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LEGITIMATE_PIC_OPERAND_P (@var{x})
1996-09-25 01:21:45 +02:00
A C expression that is nonzero if @var{x} is a legitimate immediate
operand on the target machine when generating position independent code.
You can assume that @var{x} satisfies @code{CONSTANT_P}, so you need not
check this. You can also assume @var{flag_pic} is true, so you need not
check it either. You need not define this macro if all constants
(including @code{SYMBOL_REF}) can be immediate operands when generating
position independent code.
@end defmac
1996-09-25 01:21:45 +02:00
@node Assembler Format
@section Defining the Output Assembler Language
This section describes macros whose principal purpose is to describe how
to write instructions in assembler language---rather than what the
1996-09-25 01:21:45 +02:00
instructions do.
@menu
* File Framework:: Structural information for the assembler file.
* Data Output:: Output of constants (numbers, strings, addresses).
* Uninitialized Data:: Output of uninitialized variables.
* Label Output:: Output and generation of labels.
* Initialization:: General principles of initialization
and termination routines.
1996-09-25 01:21:45 +02:00
* Macros for Initialization::
Specific macros that control the handling of
initialization and termination routines.
1996-09-25 01:21:45 +02:00
* Instruction Output:: Output of actual instructions.
* Dispatch Tables:: Output of jump tables.
* Exception Region Output:: Output of exception region code.
* Alignment Output:: Pseudo ops for alignment and skipping data.
@end menu
@node File Framework
@subsection The Overall Framework of an Assembler File
@cindex assembler format
@cindex output of assembler code
@c prevent bad page break with this line
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
This describes the overall framework of an assembly file.
@findex default_file_start
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_FILE_START (void)
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
Output to @code{asm_out_file} any text which the assembler expects to
find at the beginning of a file. The default behavior is controlled
by two flags, documented below. Unless your target's assembler is
quite unusual, if you override the default, you should call
@code{default_file_start} at some point in your target hook. This
lets other target files rely on these variables.
@end deftypefn
1996-09-25 01:21:45 +02:00
target.h (asm_out.file_start, [...]): New hooks. * target.h (asm_out.file_start, file_start_app_off, file_start_file_directive): New hooks. * target-def.h (TARGET_ASM_FILE_START_FILE_DIRECTIVE, TARGET_ASM_FILE_START_APP_OFF, TARGET_ASM_FILE_START): New hook-definition macros. * doc/tm.texi: Document new hooks; remove docs of ASM_FILE_START. * varasm.c (default_file_start): New. * output.h: Prototype it. * toplev.c (init_asm_output): Use targetm.asm_out.file_start. * system.h: Poison ASM_FILE_START. * config/alpha/alpha.c (alpha_write_verstamp): Delete. (alpha_file_start): New, define if !TARGET_ABI_UNICOSMK. (unicosmk_asm_file_start): Rename unicosmk_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_END, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set as appropriate. * config/alpha/unicosmk.h: Don't define ASM_FILE_START nor TARGET_ASM_FILE_END. Remove reference to ASM_FILE_START in comment. * config/arc/arc.c (arc_asm_file_start): Rename arc_file_start, take no arguments, make static. (TARGET_ASM_FILE_START): Set it. * config/arm/arm.c (aof_file_start): New static function. (TARGET_ASM_FILE_START): Set it, when appropriate. * config/arm/coff.h, config/arm/elf.h: Set TARGET_ASM_FILE_START_APP_OFF to true. * config/avr/avr.c (asm_file_start): Rename avr_file_start, take no arguments, make static. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/c4x/c4x.c (c4x_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set them. * config/cris/cris.c (cris_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/dsp16xx/dsp16xx.c (coff_dsp16xx_file_start): Rename dsp16xx_file_start, make static. (luxworks_dsp16xx_file_start): Delete. (TARGET_ASM_FILE_START): Set it. * config/h8300/h8300.c (asm_file_start): Rename h8300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/i370/i370.c (i370_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.c (x86_file_start): New static function. (TARGET_ASM_FILE_START): Set it. * config/i386/i386.h (X86_FILE_START_VERSION_DIRECTIVE, X86_FILE_START_FLTUSED): New macros, default to false. * config/i386/i386-interix.h: Override X86_FILE_START_FLTUSED to 1. * config/i386/sysv4.h, config/i386/sco5.h: Override X86_FILE_START_VERSION_DIRECTIVE to true. * config/ia64/ia64.c (ia64_file_start): New static function. (TARGET_ASM_FILE_START): Set it. (emit_safe_across_calls): Take no arguments. * config/ia64/ia64.md: Update to match. * config/m32r/m32r.c (m32r_asm_file_start): Rename m32r_file_start, make static, take no arguments. (TARGET_ASM_FILE_START): Set it. * config/m68hc11/m68hc11.c (m68hc11_asm_file_start): Rename m68hc11_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. (print_options): Delete. * config/m68k/m68k.c (m68k_hp320_file_start): New static function. (TARGET_ASM_FILE_START_APP_OFF): Set. * config/m68k/hp320.h: Set TARGET_ASM_FILE_START to m68k_hp320_file_start. * config/mips/mips.c (iris6_asm_file_start, mips_asm_file_start): Make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mmix/mmix.c (mmix_asm_file_start): Rename mmix_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/mn10300/mn10300.c (asm_file_start): Rename mn10300_file_start, make static, take no arguments. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/ns32k/ns32k.c (TARGET_ASM_FILE_START_APP_OFF): Set. * config/pa/pa.c (pa_file_start_level, pa_file_start_space, pa_file_start_file, pa_file_start_mcount, pa_elf_file_start, pa_som_file_start, pa_linux_file_start, pa_hpux64_gas_file_start, pa_hpux64_hpas_file_start): New static functions. * config/pa/elf.h: Set TARGET_ASM_FILE_START to pa_elf_file_start. * config/pa/pa-linux.h: Set TARGET_ASM_FILE_START to pa_linux_file_start. * config/pa/pa64-hpux.h: Set TARGET_ASM_FILE_START to pa_hpux64_gas_file_start or pa_hpux64_hpas_file_start, as appropriate. * config/pa/som.h: Set TARGET_ASM_FILE_START to pa_som_file_start. * config/rs6000/rs6000.c: Include xcoffout.h when TARGET_XCOFF. (rs6000_file_start): Make static, take no arguments. Reset default_cpu under certain conditions. (rs6000_xcoff_file_start): New function. * config/rs6000/rs6000.h (TARGET_ASM_FILE_START): Set. * config/rs6000/xcoff.h (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Override. * config/sh/sh.c (output_file_start): Rename sh_file_start, make static, take no arguments. Merge in old code from sh/elf.h's ASM_FILE_START, conditioned on TARGET_ELF. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/sh/sh.c (TARGET_ELF): Define to 0. * config/sh/elf.h (TARGET_ELF): Redefine to 1. * config/v850/v850.c (asm_file_start): Delete. (TARGET_ASM_FILE_START_FILE_DIRECTIVE): Set. * config/vax/vax.c (vax_file_start): New static function. (TARGET_ASM_FILE_START, TARGET_ASM_FILE_START_APP_OFF): Set. * config/darwin.h: Override ASM_FILE_START_FILE_DIRECTIVE to false. * config/elfos.h, config/svr3.h, config/arm/elf.h, config/arm/pe.h * config/i386/att.h, config/i386/gas.h, config/i386/linux.h * config/i386/sysv4.h, config/i386/sco5.h, config/i960/i960-coff.h * config/m68k/coff.h, config/m68k/hp320.h, config/mcore/mcore-pe.h * config/vax/vaxv.h: Set ASM_FILE_START_FILE_DIRECTIVE to true. * config/darwin.h, config/elfos.h, config/alpha/elf.h * config/alpha/openbsd.h, config/alpha/osf.h, config/alpha/vms.h * config/arc/arc.h, config/arm/aof.h, config/arm/aout.h * config/arm/coff.h, config/arm/elf.h, config/arm/pe.h * config/avr/avr.h, config/c4x/c4x.h, config/cris/cris.h * config/dsp16xx/dsp16xx.h, config/h8300/elf.h, config/h8300/h8300.h * config/i370/i370.h, config/i386/att.h, config/i386/gas.h * config/i386/i386-interix.h, config/i386/linux.h, config/i386/sysv4.h * config/i386/sco5.h, config/i960/i960-coff.h, config/i960/i960.h * config/ia64/ia64.h, config/ia64/sysv4.h, config/m32r/m32r.h * config/m68hc11/m68hc11.h, config/m68k/coff.h, config/m68k/m68k.h * config/mcore/mcore-pe.h, config/mips/iris6.h, config/mips/mips.h * config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h * config/pa/elf.h, config/pa/pa-linux.h, config/pa/pa64-hpux.h * config/pa/som.h, config/pdp11/pdp11.h, config/rs6000/linux64.h * config/rs6000/lynx.h, config/rs6000/xcoff.h, config/sh/elf.h * config/sh/sh.h, config/sparc/sparc.h, config/v850/v850.h * config/vax/vax.h, config/vax/vaxv.h: Don't (re)define ASM_FILE_START. * config/alpha/alpha-protos.h, config/arc/arc-protos.h * config/avr/avr-protos.h, config/dsp16xx/dsp16xx-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/m32r/m32r-protos.h, config/m68hc11/m68hc11-protos.h * config/mips/mips-protos.h, config/mmix/mmix-protos.h * config/mn10300/mn10300-protos.h, config/rs6000/rs6000-protos.h * config/sh/sh-protos.h, config/v850/v850-protos.h: Update. * xcoffout.h, config/rs6000/aix.h, config/rs6000/xcoff.h: Remove reference to ASM_FILE_START in comment. * config/arm/aof.h, config/arm/aout.h, config/arm/freebsd.h * config/arm/linux-gas.h, config/arm/netbsd-elf.h * config/arm/netbsd.h: Delete definition of ARM_OS_NAME. From-SVN: r68229
2003-06-19 23:47:26 +02:00
@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_APP_OFF
If this flag is true, the text of the macro @code{ASM_APP_OFF} will be
printed as the very first line in the assembly file, unless
@option{-fverbose-asm} is in effect. (If that macro has been defined
to the empty string, this variable has no effect.) With the normal
definition of @code{ASM_APP_OFF}, the effect is to notify the GNU
assembler that it need not bother stripping comments or extra
whitespace from its input. This allows it to work a bit faster.
The default is false. You should not set it to true unless you have
verified that your port does not generate any extra whitespace or
comments that will cause GAS to issue errors in NO_APP mode.
@end deftypevr
@deftypevr {Target Hook} bool TARGET_ASM_FILE_START_FILE_DIRECTIVE
If this flag is true, @code{output_file_directive} will be called
for the primary source file, immediately after printing
@code{ASM_APP_OFF} (if that is enabled). Most ELF assemblers expect
this to be done. The default is false.
@end deftypevr
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} void TARGET_ASM_FILE_END (void)
config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config/alpha/alpha.c (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition. (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK. * target.h: New hook asm_out.file_end. * target.h: Update to match. New hook macro TARGET_ASM_FILE_END. * toplev.c (compile_file: Use targetm.asm_out.file_end. * system.h: Poison ASM_FILE_END. * varasm.c (file_end_indicate_exec_stack): New. * output.h: Prototype it. * doc/tm.texi: Document TARGET_ASM_FILE_END and file_end_indicate_exec_stack. Delete references to attasm.h. * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end. (ASM_FILE_END): Delete; move code... * config/darwin.c (darwin_file_end): Here; new function. * config/darwin-protos.h: Prototype it. * config/alpha/alpha.c (unicosmk_asm_file_end): Make static, rename unicosmk_file_end. * config/arm/aof.h (ASM_FILE_END): Delete; move code... * config/arm/arm.c (aof_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER. Make aof_dump_imports and aof_dump_pic_table static. * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static. Set TARGET_ASM_FILE_END to avr_file_end. * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments. Set TARGET_ASM_FILE_END to c4x_file_end. * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end, make static. Take no arguments. Set TARGET_ASM_FILE_END to h8300_file_end. * config/i370/i370.h (ASM_FILE_END): Delete; move code... * config/i370/i370.c (i370_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to i370_file_end. * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end. Take no arguments. Call file_end_indicate_exec_stack if NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END. * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. Define NEED_INDICATE_EXEC_STACK to 0. * config/i386/linux.h, config/i386/linux64.h: Redefine NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END. * config/i386/winnt.c (i386_pe_asm_file_end): Rename to i386_pe_file_end. Take no arguments. Use ix86_file_end. * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to ia64_hpux_file_end, make static. Take no arguments. * config/ip2k/ip2k.c (asm_file_start, asm_file_end, commands_in_prologues, commands_in_epilogues): Delete. (function_epilogue): Update to match. * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end, make static. Take no arguments. (iris6_asm_file_end): Rename iris6_file_end, make static, use mips_file_end, take no arguments. Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as appropriate. * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end, make static, take no arguments. Set TARGET_ASM_FILE_END to mmix_file_end. * config/pa/pa.c (output_deferred_plabels): Make static, take no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels. * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it. (ASM_FILE_END): Delete; move code... * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here; new static function. * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h: Don't set ASM_FILE_END. * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to file_end_indicate_exec_stack; don't set ASM_FILE_END. * config/alpha/unicosmk.h, config/i386/cygming.h * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. * config/arm/arm-protos.h, config/alpha/alpha-protos.h * config/avr/avr-protos.h, config/c4x/c4x-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update. From-SVN: r67591
2003-06-07 19:11:48 +02:00
Output to @code{asm_out_file} any text which the assembler expects
to find at the end of a file. The default is to output nothing.
@end deftypefn
1996-09-25 01:21:45 +02:00
config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config.gcc (with_cpu handling): Translate sparc64 in $machine to --with-cpu=v9. * config/alpha/alpha.c (TARGET_ASM_GLOBALIZE_LABEL [TARGET_ABI_UNICOSMK]): Correct definition. (alpha_setup_incoming_varargs): #ifdef out when TARGET_ABI_UNICOSMK. * target.h: New hook asm_out.file_end. * target.h: Update to match. New hook macro TARGET_ASM_FILE_END. * toplev.c (compile_file: Use targetm.asm_out.file_end. * system.h: Poison ASM_FILE_END. * varasm.c (file_end_indicate_exec_stack): New. * output.h: Prototype it. * doc/tm.texi: Document TARGET_ASM_FILE_END and file_end_indicate_exec_stack. Delete references to attasm.h. * config/darwin.h (TARGET_ASM_FILE_END): Reset to darwin_file_end. (ASM_FILE_END): Delete; move code... * config/darwin.c (darwin_file_end): Here; new function. * config/darwin-protos.h: Prototype it. * config/alpha/alpha.c (unicosmk_asm_file_end): Make static, rename unicosmk_file_end. * config/arm/aof.h (ASM_FILE_END): Delete; move code... * config/arm/arm.c (aof_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to aof_file_end if AOF_ASSEMBLER. Make aof_dump_imports and aof_dump_pic_table static. * config/avr/avr.c (asm_file_end): Rename avr_file_end, make static. Set TARGET_ASM_FILE_END to avr_file_end. * config/c4x/c4x.c (c4x_file_end): Make static. Take no arguments. Set TARGET_ASM_FILE_END to c4x_file_end. * config/h8300/h8300.c (asm_file_end): Rename h8300_file_end, make static. Take no arguments. Set TARGET_ASM_FILE_END to h8300_file_end. * config/i370/i370.h (ASM_FILE_END): Delete; move code... * config/i370/i370.c (i370_file_end): ... here; new static function. Set TARGET_ASM_FILE_END to i370_file_end. * config/i386/i386.c (ix86_asm_file_end): Rename ix86_file_end. Take no arguments. Call file_end_indicate_exec_stack if NEED_INDICATE_EXEC_STACK; don't use SUBTARGET_FILE_END. * config/i386/i386.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. Define NEED_INDICATE_EXEC_STACK to 0. * config/i386/linux.h, config/i386/linux64.h: Redefine NEED_INDICATE_EXEC_STACK to 1 instead of setting SUBTARGET_FILE_END. * config/i386/winnt.c (i386_pe_asm_file_end): Rename to i386_pe_file_end. Take no arguments. Use ix86_file_end. * config/ia64/ia64.c (ia64_hpux_asm_file_end): Rename to ia64_hpux_file_end, make static. Take no arguments. * config/ip2k/ip2k.c (asm_file_start, asm_file_end, commands_in_prologues, commands_in_epilogues): Delete. (function_epilogue): Update to match. * config/mips/mips.c (mips_asm_file_end): Rename mips_file_end, make static. Take no arguments. (iris6_asm_file_end): Rename iris6_file_end, make static, use mips_file_end, take no arguments. Set TARGET_ASM_FILE_END to iris6_file_end or mips_file_end as appropriate. * config/mmix/mmix.c (mmix_asm_file_end): Rename mmix_file_end, make static, take no arguments. Set TARGET_ASM_FILE_END to mmix_file_end. * config/pa/pa.c (output_deferred_plabels): Make static, take no arguments. Set TARGET_ASM_FILE_END to output_deferred_plabels. * config/rs6000/xcoff.h (TARGET_ASM_FILE_END): Set it. (ASM_FILE_END): Delete; move code... * config/rs6000/rs6000.c (rs6000_xcoff_file_end): ... here; new static function. * config/avr/avr.h, config/cris/cris.h, config/h8300/h8300.h * config/mmix/mmix.h, config/mips/iris6.h, config/mips/mips.h: Don't set ASM_FILE_END. * config/alpha/linux-elf.h, config/m68k/linux.h, config/rs6000/linux.h * config/rs6000/linux64.h, config/s390/linux.h, config/sparc/linux.h * config/sparc/linux64.h: Set TARGET_ASM_FILE_END to file_end_indicate_exec_stack; don't set ASM_FILE_END. * config/alpha/unicosmk.h, config/i386/cygming.h * config/ia64/hpux.h: Set TARGET_ASM_FILE_END, not ASM_FILE_END. * config/arm/arm-protos.h, config/alpha/alpha-protos.h * config/avr/avr-protos.h, config/c4x/c4x-protos.h * config/h8300/h8300-protos.h, config/ia64/ia64-protos.h * config/ip2k/ip2k-protos.h, config/mips/mips-protos.h * config/mmix/mmix-protos.h, config/pa/pa-protos.h: Update. From-SVN: r67591
2003-06-07 19:11:48 +02:00
@deftypefun void file_end_indicate_exec_stack ()
Some systems use a common convention, the @samp{.note.GNU-stack}
special section, to indicate whether or not an object file relies on
the stack being executable. If your system uses this convention, you
should define @code{TARGET_ASM_FILE_END} to this function. If you
need to do other things in that hook, have your hook function call
this function.
@end deftypefun
1996-09-25 01:21:45 +02:00
configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. ChangeLog: * configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. * configure: Regenerate. gcc/ChangeLog: * config.gcc (i[34567]86-*-darwin*, x86_64-*-darwin*): Add lto-macho as lto_binary_reader. * target.h (struct gcc_target): New hooks lto_start and lto_end. * target-def.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Define. * cgraphunit.c (ipa_passes): Wrap LTO assembler output generation in lto_start and lto_end calls. (is_elf_or_coff): Rename to maybe_lto_object_file. Add Mach-O magic numbers. (scan_prog_file): Update is_elf_or_coff call. * doc/tm.text (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Document. * collect2.c (main): Fix enum comparison. * config/darwin-protos.h (darwin_asm_lto_start, darwin_asm_lto_end): Add prototypes. * darwin9.h (LINK_COMMAND_SPEC): Pass -flto and -fwhopr to the linker. * darwin.h (LINK_COMMAND_SPEC): Likewise. Define TARGET_ASM_LTO_START and TARGET_ASM_LTO_END. * darwin.c: Include obstack.h and lto-streamer.h. (lto_section_names_offset, lto_section_names_obstack, lto_asm_out_file, lto_asm_out_name, saved_asm_out_file): New static global variables. (LTO_SEGMENT_NAME, LTO_NAMES_SECTION): New defines. (darwin_asm_lto_start): New function. Redirect output to asm_out_file to a temporary file. (darwin_asm_lto_end): New function. Restore asm_out_file. (darwin_asm_named_section): For LTO sections, replace the name with the offset of the section name in a string table, and build this table. (darwin_file_start): Initialize global vars for LTO support. (darwin_file_end): If output to asm_out_file was redirected, append it to the proper asm_out_file here. Add the section names section. lto/ChangeLog: * lto.h (struct lto_file_struct): Document offset member. * lto-endian.h: New file. * lto-macho.h: New file. * lto-macho.c: New file. * Make-lang.in: Add rule for lto-macho.o. From-SVN: r159173
2010-05-07 23:37:43 +02:00
@deftypefn {Target Hook} void TARGET_ASM_LTO_START (void)
Output to @code{asm_out_file} any text which the assembler expects
to find at the start of an LTO section. The default is to output
nothing.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_LTO_END (void)
Output to @code{asm_out_file} any text which the assembler expects
to find at the end of an LTO section. The default is to output
nothing.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_CODE_END (void)
Output to @code{asm_out_file} any text which is needed before emitting
unwind info and debug info at the end of a file. Some targets emit
here PIC setup thunks that cannot be emitted at the end of file,
because they couldn't have unwind info then. The default is to output
nothing.
@end deftypefn
@defmac ASM_COMMENT_START
1996-09-25 01:21:45 +02:00
A C string constant describing how to begin a comment in the target
assembler language. The compiler assumes that the comment will end at
the end of the line.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_APP_ON
1996-09-25 01:21:45 +02:00
A C string constant for text to be output before each @code{asm}
statement or group of consecutive ones. Normally this is
@code{"#APP"}, which is a comment that has no effect on most
assemblers but tells the GNU assembler that it must check the lines
that follow for all valid assembler constructs.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_APP_OFF
1996-09-25 01:21:45 +02:00
A C string constant for text to be output after each @code{asm}
statement or group of consecutive ones. Normally this is
@code{"#NO_APP"}, which tells the GNU assembler to resume making the
time-saving assumptions that are valid for ordinary compiler output.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_SOURCE_FILENAME (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement to output COFF information or DWARF debugging information
which indicates that filename @var{name} is the current source file to
the stdio stream @var{stream}.
This macro need not be defined if the standard form of output
for the file format in use is appropriate.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_SOURCE_FILENAME (FILE *@var{file}, const char *@var{name})
Output COFF information or DWARF debugging information which indicates that filename @var{name} is the current source file to the stdio stream @var{file}.
2011-05-05 01:42:26 +02:00
This target hook need not be defined if the standard form of output for the file format in use is appropriate.
@end deftypefn
target.def (output_ident): New hook. gcc/ * target.def (output_ident): New hook. * targhooks.h (default_asm_output_ident_directive): Add prototype. * varasm.c (assemble_asm): Only prefix a tab if the string does not already start with one. (default_asm_output_ident_directive): New function to emit .ident as a top-level asm node while parsing, or directly to asm_out_file after parsing. * toplev.c (compile_file): Print a GCC .ident with targetm.asm_out.output_ident. * doc/tm.texi.in (ASM_OUTPUT_IDENT): Remove documentation for macro. (TARGET_ASM_OUTPUT_IDENT): Add @hook for this. * doc/tm.texi: Update. * config/elfos.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/i386/djgpp.h (IDENT_ASM_OP): Remove. * config/i386/gas.h (ASM_OUTPUT_IDENT): Remove. * config/arm/aout.h (ASM_OUTPUT_IDENT): Remove. * config/sparc/sparc.h (IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/picochip/picochip.h (IDENT_ASM_OP): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/cris/cris-protos.h (cris_asm_output_ident): Add prototype. * config/cris/cris.c (cris_asm_output_ident): New function. * config/cris/cris.h (ASM_OUTPUT_IDENT, IDENT_ASM_OP): Remove. * config/microblaze/microblaze-protos.h (microblaze_asm_output_ident): Add prototype. * config/microblaze/microblaze.c: Include cgraph.h for add_asm_node. (microblaze_asm_output_ident): Rewrite to work similar to default_asm_output_ident_directive for front-end .idents. * config/microblaze/microblaze.h (ASM_OUTPUT_IDENT): Remove. (TARGET_ASM_OUTPUT_IDENT): Define. * config/mips/mips.h (ASM_OUTPUT_IDENT): Remove. * config/mips/sde.h (IDENT_ASM_OP, ASM_OUTPUT_IDENT): Remove. * config/rx/rx.c: Include cgraph.h for add_asm_node. (rx_asm_output_ident): New function, similar to default_asm_output_ident_directive, but handle AS100 syntax also, so that #ident also works for rx in AS100 syntax. (TARGET_ASM_OUTPUT_IDENT): Define. * config/rx/rx.h (IDENT_ASM_OP): Remove. * Makefile.in: Fix dependencies for c-family/c-lex.o. c-family/ * c-lex.c: Do not include output.h. (cb_ident): Try to put out .ident with targetm.asm_out.output_ident. Remove uses of ASM_OUTPUT_IDENT. ada/ * gcc-interface/trans.c: Include target.h. (gigi): Try to put out .ident with targetm.asm_out.output_ident. Remove uses of ASM_OUTPUT_IDENT. * gcc-interface/Make-lang.in: Fix dependencies. From-SVN: r188791
2012-06-19 21:55:33 +02:00
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_IDENT (const char *@var{name})
Output a string based on @var{name}, suitable for the @samp{#ident} directive, or the equivalent directive or pragma in non-C-family languages. If this hook is not defined, nothing is output for the @samp{#ident} directive.
@end deftypefn
@defmac OUTPUT_QUOTED_STRING (@var{stream}, @var{string})
A C statement to output the string @var{string} to the stdio stream
@var{stream}. If you do not call the function @code{output_quoted_string}
in your config files, GCC will only call it to output filenames to
the assembler source. So you can use it to canonicalize the format
of the filename using this macro.
@end defmac
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_NAMED_SECTION (const char *@var{name}, unsigned int @var{flags}, tree @var{decl})
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
Output assembly directives to switch to section @var{name}. The section
should have attributes as specified by @var{flags}, which is a bit mask
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
of the @code{SECTION_*} flags defined in @file{output.h}. If @var{decl}
is non-NULL, it is the @code{VAR_DECL} or @code{FUNCTION_DECL} with which
this section is associated.
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
@end deftypefn
tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro. * tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro. (tree_decl_with_vis): Add implicit_section_name_p. * targhooks.h (default_function_section): Declare. * target.def (function_section): New hook. * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * predict.c (choose_function_section): Remove. (estimate_bb_frequencies): Do not use choose_function_section. * coretypes.h (enum node_frequency): Move here from cgraph.h * cgraph.h (enum node_frequency): Remove. * varasm.c (initialize_cold_section_name, unlikely_text_section, unlikely_text_section_p): Remove. (named_subsection_entry): New structure. (get_text_section): New function. (default_function_section): New function. (function_section_1): Break out from ...; handle profile info. (function_section): ... here. (unlikely_text_section): Remove. (unlikely_text_section_p): Use function_section_1. (assemble_start_function): Do not initialize cold section. (default_section_type_flags): Do not special case cold subsection. (switch_to_section): Likewise. * output.h (get_text_section): Define. * config/i386/winnt.c: Do not special case cold section. * config/darwin-protos.h (darwin_function_section): Declare. * config/microblaze/microblaze.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * config/ia64/hpux.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define to ia64_hpux_function_section. * config/ia64/ia64.c (ia64_hpux_function_section): New function. * config/darwin.c (machopic_select_section): Use darwin_function_section. (darwin_function_section): New function. * config/darwin.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define. * system.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Poison. From-SVN: r167085
2010-11-23 17:06:37 +01:00
@deftypefn {Target Hook} {section *} TARGET_ASM_FUNCTION_SECTION (tree @var{decl}, enum node_frequency @var{freq}, bool @var{startup}, bool @var{exit})
Return preferred text (sub)section for function @var{decl}.
Main purpose of this function is to separate cold, normal and hot
functions. @var{startup} is true when function is known to be used only
tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro. * tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): New macro. (tree_decl_with_vis): Add implicit_section_name_p. * targhooks.h (default_function_section): Declare. * target.def (function_section): New hook. * defaults.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * predict.c (choose_function_section): Remove. (estimate_bb_frequencies): Do not use choose_function_section. * coretypes.h (enum node_frequency): Move here from cgraph.h * cgraph.h (enum node_frequency): Remove. * varasm.c (initialize_cold_section_name, unlikely_text_section, unlikely_text_section_p): Remove. (named_subsection_entry): New structure. (get_text_section): New function. (default_function_section): New function. (function_section_1): Break out from ...; handle profile info. (function_section): ... here. (unlikely_text_section): Remove. (unlikely_text_section_p): Use function_section_1. (assemble_start_function): Do not initialize cold section. (default_section_type_flags): Do not special case cold subsection. (switch_to_section): Likewise. * output.h (get_text_section): Define. * config/i386/winnt.c: Do not special case cold section. * config/darwin-protos.h (darwin_function_section): Declare. * config/microblaze/microblaze.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. * config/ia64/hpux.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define to ia64_hpux_function_section. * config/ia64/ia64.c (ia64_hpux_function_section): New function. * config/darwin.c (machopic_select_section): Use darwin_function_section. (darwin_function_section): New function. * config/darwin.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Remove. (TARGET_ASM_FUNCTION_SECTION): Define. * system.h (HOT_TEXT_SECTION_NAME, UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Poison. From-SVN: r167085
2010-11-23 17:06:37 +01:00
at startup (from static constructors or it is @code{main()}).
@var{exit} is true when function is known to be used only at exit
(from static destructors).
Return NULL if function should go to default text section.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS (FILE *@var{file}, tree @var{decl}, bool @var{new_is_cold})
Used by the target to emit any assembler directives or additional labels needed when a function is partitioned between different sections. Output should be written to @var{file}. The function decl is available as @var{decl} and the new section is `cold' if @var{new_is_cold} is @code{true}.
@end deftypefn
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypevr {Common Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
target.def (supports_split_stack, [...]): Take gcc_options parameters. * target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-25 14:16:03 +01:00
It must not be modified by command-line option processing.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. * doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, and say that only one is needed. * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. * target.h (have_switchable_bss_sections): New hook. * explow.c (use_anchored_address): Check that the symbol is in a block. * varasm.c (tls_comm_section, comm_section, lcomm_section) (bss_noswitch_section): New variables. (get_unnamed_section): Add SECTION_UNNAMED to the flags. (get_noswitch_section): New function. (get_block_for_section): Allow SECT to be null. (unlikely_text_section_p): Use SECTION_STYLE. (bss_initializer_p): New function. (get_variable_section): Move earlier in file. Take a new argument, prefer_noswitch_p. Move bss checks from assemble_variable to here. Return one of the new *_sections in such cases. (get_block_for_decl): New function, extracting some logic from use_blocks_for_decl_p. (change_symbol_section): Remove in favor of... (change_symbol_block): ...this new function. (use_blocks_for_decl_p): Remove checks now performed by get_block_for_decl. (make_decl_rtl): Use change_symbol_block and get_block_for_decl. (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... (emit_local, emit_bss, emit_common): ...these new functions. Return true if the alignment was honored. (emit_tls_common): New function. (asm_emit_uninitialised): Delete. (assemble_variable_noswitch): New function, split out from... (assemble_variable): ...here. Don't make decisions about common variables here. Globalize all public decls that go into non-common sections. Check whether SYMBOL_REF_BLOCK is null. (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. (output_constant_pool): Likewise. (init_varasm_once): Initialize the new section variables. (have_global_bss_p): New function. (categorize_decl_for_section): Use bss_initializer_p. (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. (place_block_symbol): Assert that the symbol must be in a block. * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. (TARGET_INITIALIZER): Include it. * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. (SECTION_MACH_DEP): Bump by two. (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. (unnamed_section): Mention SECTION_UNNAMED in comment. (named_section): Likewise SECTION_NAMED. (noswitch_section_callback): New type. (noswitch_section): New structure. (section): Add a noswitch_section alternative. (SECTION_STYLE): New macro. (tls_comm_section, comm_section, lcomm_section): Declare. (bss_noswitch_section, have_global_bss_p): Declare. * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. cp/ * decl.c (start_decl): Use have_global_bss_p when deciding whether to make the decl common. ada/ * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. From-SVN: r111644
2006-03-02 20:32:52 +01:00
@anchor{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypevr {Target Hook} bool TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. * doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, and say that only one is needed. * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. * target.h (have_switchable_bss_sections): New hook. * explow.c (use_anchored_address): Check that the symbol is in a block. * varasm.c (tls_comm_section, comm_section, lcomm_section) (bss_noswitch_section): New variables. (get_unnamed_section): Add SECTION_UNNAMED to the flags. (get_noswitch_section): New function. (get_block_for_section): Allow SECT to be null. (unlikely_text_section_p): Use SECTION_STYLE. (bss_initializer_p): New function. (get_variable_section): Move earlier in file. Take a new argument, prefer_noswitch_p. Move bss checks from assemble_variable to here. Return one of the new *_sections in such cases. (get_block_for_decl): New function, extracting some logic from use_blocks_for_decl_p. (change_symbol_section): Remove in favor of... (change_symbol_block): ...this new function. (use_blocks_for_decl_p): Remove checks now performed by get_block_for_decl. (make_decl_rtl): Use change_symbol_block and get_block_for_decl. (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... (emit_local, emit_bss, emit_common): ...these new functions. Return true if the alignment was honored. (emit_tls_common): New function. (asm_emit_uninitialised): Delete. (assemble_variable_noswitch): New function, split out from... (assemble_variable): ...here. Don't make decisions about common variables here. Globalize all public decls that go into non-common sections. Check whether SYMBOL_REF_BLOCK is null. (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. (output_constant_pool): Likewise. (init_varasm_once): Initialize the new section variables. (have_global_bss_p): New function. (categorize_decl_for_section): Use bss_initializer_p. (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. (place_block_symbol): Assert that the symbol must be in a block. * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. (TARGET_INITIALIZER): Include it. * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. (SECTION_MACH_DEP): Bump by two. (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. (unnamed_section): Mention SECTION_UNNAMED in comment. (named_section): Likewise SECTION_NAMED. (noswitch_section_callback): New type. (noswitch_section): New structure. (section): Add a noswitch_section alternative. (SECTION_STYLE): New macro. (tls_comm_section, comm_section, lcomm_section): Declare. (bss_noswitch_section, have_global_bss_p): Declare. * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. cp/ * decl.c (start_decl): Use have_global_bss_p when deciding whether to make the decl common. ada/ * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. From-SVN: r111644
2006-03-02 20:32:52 +01:00
This flag is true if we can create zeroed data by switching to a BSS
section and then using @code{ASM_OUTPUT_SKIP} to allocate the space.
This is true on most ELF targets.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. * doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, and say that only one is needed. * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. * target.h (have_switchable_bss_sections): New hook. * explow.c (use_anchored_address): Check that the symbol is in a block. * varasm.c (tls_comm_section, comm_section, lcomm_section) (bss_noswitch_section): New variables. (get_unnamed_section): Add SECTION_UNNAMED to the flags. (get_noswitch_section): New function. (get_block_for_section): Allow SECT to be null. (unlikely_text_section_p): Use SECTION_STYLE. (bss_initializer_p): New function. (get_variable_section): Move earlier in file. Take a new argument, prefer_noswitch_p. Move bss checks from assemble_variable to here. Return one of the new *_sections in such cases. (get_block_for_decl): New function, extracting some logic from use_blocks_for_decl_p. (change_symbol_section): Remove in favor of... (change_symbol_block): ...this new function. (use_blocks_for_decl_p): Remove checks now performed by get_block_for_decl. (make_decl_rtl): Use change_symbol_block and get_block_for_decl. (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... (emit_local, emit_bss, emit_common): ...these new functions. Return true if the alignment was honored. (emit_tls_common): New function. (asm_emit_uninitialised): Delete. (assemble_variable_noswitch): New function, split out from... (assemble_variable): ...here. Don't make decisions about common variables here. Globalize all public decls that go into non-common sections. Check whether SYMBOL_REF_BLOCK is null. (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. (output_constant_pool): Likewise. (init_varasm_once): Initialize the new section variables. (have_global_bss_p): New function. (categorize_decl_for_section): Use bss_initializer_p. (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. (place_block_symbol): Assert that the symbol must be in a block. * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. (TARGET_INITIALIZER): Include it. * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. (SECTION_MACH_DEP): Bump by two. (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. (unnamed_section): Mention SECTION_UNNAMED in comment. (named_section): Likewise SECTION_NAMED. (noswitch_section_callback): New type. (noswitch_section): New structure. (section): Add a noswitch_section alternative. (SECTION_STYLE): New macro. (tls_comm_section, comm_section, lcomm_section): Declare. (bss_noswitch_section, have_global_bss_p): Declare. * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. cp/ * decl.c (start_decl): Use have_global_bss_p when deciding whether to make the decl common. ada/ * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. From-SVN: r111644
2006-03-02 20:32:52 +01:00
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
@deftypefn {Target Hook} {unsigned int} TARGET_SECTION_TYPE_FLAGS (tree @var{decl}, const char *@var{name}, int @var{reloc})
Choose a set of section attributes for use by @code{TARGET_ASM_NAMED_SECTION}
based on a variable or function decl, a section name, and whether or not the
declaration's initializer may contain runtime relocations. @var{decl} may be
null, in which case read-write data should be assumed.
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
The default version of this function handles choosing code vs data,
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
read-only vs read-write data, and @code{flag_pic}. You should only
need to override this if your target has special flags that might be
set via @code{__attribute__}.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} int TARGET_ASM_RECORD_GCC_SWITCHES (print_switch_type @var{type}, const char *@var{text})
Provides the target with the ability to record the gcc command line
switches that have been passed to the compiler, and options that are
enabled. The @var{type} argument specifies what is being recorded.
It can take the following values:
@table @gcctabopt
@item SWITCH_TYPE_PASSED
@var{text} is a command line switch that has been set by the user.
@item SWITCH_TYPE_ENABLED
@var{text} is an option which has been enabled. This might be as a
direct result of a command line switch, or because it is enabled by
default or because it has been enabled as a side effect of a different
command line switch. For example, the @option{-O2} switch enables
various different individual optimization passes.
@item SWITCH_TYPE_DESCRIPTIVE
@var{text} is either NULL or some descriptive text which should be
ignored. If @var{text} is NULL then it is being used to warn the
target hook that either recording is starting or ending. The first
time @var{type} is SWITCH_TYPE_DESCRIPTIVE and @var{text} is NULL, the
warning is for start up and the second time the warning is for
wind down. This feature is to allow the target hook to make any
necessary preparations before it starts to record switches and to
perform any necessary tidying up after it has finished recording
switches.
@item SWITCH_TYPE_LINE_START
This option can be ignored by this target hook.
@item SWITCH_TYPE_LINE_END
This option can be ignored by this target hook.
@end table
The hook's return value must be zero. Other return values may be
supported in the future.
By default this hook is set to NULL, but an example implementation is
provided for ELF based targets. Called @var{elf_record_gcc_switches},
it records the switches as ASCII text inside a new, string mergeable
section in the assembler output file. The name of the new section is
provided by the @code{TARGET_ASM_RECORD_GCC_SWITCHES_SECTION} target
hook.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypevr {Target Hook} {const char *} TARGET_ASM_RECORD_GCC_SWITCHES_SECTION
This is the name of the section that will be created by the example
ELF implementation of the @code{TARGET_ASM_RECORD_GCC_SWITCHES} target
hook.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
1996-09-25 01:21:45 +02:00
@need 2000
@node Data Output
@subsection Output of Data
target.h (asm_out.byte_op, [...]): New fields. * target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op, asm_out.integer): New fields. * target-def.h (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_[HSDT]I_OP, TARGET_ASM_UNALIGNED_[HSDT]I_OP, TARGET_ASM_INTEGER): New initialisers. (TARGET_ASM_ALIGNED_INT_OP, TARGET_ASM_UNALIGNED_INT_OP): Collect the individual initialisers together. (TARGET_ASM_OUT): Add the new initialisers. * output.h (assemble_integer): Return bool. (integer_asm_op): Declare. (default_assemble_integer): Declare. (assemble_aligned_integer): New interface to assemble_integer. * varasm.c (integer_asm_op): New function to select pseudo-op. (default_assemble_integer): Default implementation of asm_out.integer. (assemble_integer): Use the new target hook. Split objects into words or bytes if the target hook fails. Return bool. * doc/tm.texi (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, ASM_OUTPUT_QUADRUPLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undocument. Document new target hooks. * defaults.h (ASM_OUTPUT_ADDR_VEC_ELT): Use integer_asm_op. * dwarf2asm.c (unaligned_integer_asm_op): Remove. (dw2_assemble_integer): New. (dw2_asm_output_data, dw2_asm_output_delta, dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr, dw2_asm_output_addr_rtx, dw2_asm_output_encoded_addr_rtx): Use it. (dw2_asm_output_nstring): Use assemble_integer for the null terminator. (dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128): Use integer_asm_op to get the byte pseudo-op. Use assemble_integer if it returns NULL. * dwarf2asm.h (dw2_assemble_integer): Declare. * dwarfout.c: Include dwarf2asm.h. Use dwarf2 functions for the default implementation of most macros. (output_unsigned_leb128): Use dw2_asm_output_data. (output_signed_leb128, dwarfout_source_line): Likewise. (output_reg_number): Use dw2_assemble_integer. (generate_macinfo_entry): Separate the type and offset arguments. Use assemble_integer to write the value. (dwarfout_start_source_file): Update generate_macinfo_entry usage. (dwarfout_end_source_file, dwarfout_define, dwarfout_undef): Likewise. * final.c (output_addr_const): Don't put brackets round a subtracted symbol value or ".". * halfpic.c (half_pic_finish): Use assemble_aligned_integer. * config/1750a/1750a.c (assemble_integer_1750a): New, * config/alpha/alpha.h (literal_section): Avoid ASM_OUTPUT_INT. * config/arc/arc.c (arc_assemble_integer): New. * config/arc/arc.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/arm/arm.c (arm_poke_function_name): Likewise. (arm_assemble_integer): New, extracted from... * config/arm/arm.h (OUTPUT_INT_ADDR_CONST): ...here, now removed. (ARM_TRAMPOLINE_TEMPLATE, ARM_FUNCTION_PROFILER): Avoid ASM_OUTPUT_INT. (ARM_FUNCTION_PROFILER): Likewise. * config/avr/avr-protos.h (asm_output_byte): Remove. (asm_output_char, asm_output_short): Remove. * config/avr/avr.c (avr_assemble_integer): New. (asm_output_byte, asm_output_char, asm_output_short): Remove. * config/clipper/clipper.h (ASM_LONG): Remove. * config/dsp16xx/dsp16xx-protos.h (asm_output_long): Remove. * config/dsp16xx/dsp16xx.c (asm_output_long): Remove. * config/elxsi/elxsi.c (elxsi_assemble_integer): New. * config/i370/i370.c (i370_hlasm_assemble_integer): New. * config/i370/i370.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. (ASM_BYTE, ASM_SHORT, ASM_LONG): Delete. * config/i386/att.h, (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/linux.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i386/sco5.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i386/sysv4.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Use ASM_LONG instead of UNALIGNED_INT_ASM_OP. * config/i860/fx2800.h (ASM_FILE_END): Avoid ASM_LONG. * config/i860/i860.c (i860_output_function_epilogue): Likewise. * config/i860/i860.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_SHORT, ASM_LONG): Undefine. * config/i860/paragon.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise. * config/i960/i960.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/ia64/ia64.c (ia64_assemble_integer): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Use integer_asm_op. (ASM_OUTPUT_DWARF_PCREL): Likewise. * config/m68hc11/m68hc11.h (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_VEC_ELT): Avoid ASM_LONG. (ASM_SHORT, ASM_LONG): Remove. * config/m68k/m68k.h (INT_OP_GROUP): New macro. (INT_OP_STANDARD, INT_OP_DOT_WORD, INT_OP_NO_DOT, INT_OP_DC): New macros, the allowed values for INT_OP_GROUP. * config/m68k/amix.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP * config/m68k/atari.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Likewise * config/m68k/auxas.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/dpx2.h (ASM_LONG): Undefine. (INT_OP_GROUP): Define to INT_OP_DC. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/hp320.h (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m68k/lynx.h (ASM_LONG): Undefine. * config/m68k/dpx2g.h (ASM_LONG): Undefine. * config/m68k/m68kelf.h (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/m68kv4.h (ASM_OUTPUT_ASCII): Likewise. (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_*. * config/m68k/mot3300.h (INT_OP_GROUP): Define to INT_OP_STANDARD for GAS and INT_OP_NO_DOT otherwise. (ASM_CHAR, ASM_BYTE, ASM_SHORT, ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid ASM_LONG. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/m68k/sgs.h (BYTE_ASM_OP, WORD_ASM_OP, LONG_ASM_OP): Remove. (INT_OP_GROUP): Define to INT_OP_STANDARD. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT, ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Avoid LONG_ASM_OP. (ASM_OUTPUT_ASCII): Avoid BYTE_ASM_OP. * config/m68k/tower-as.h (ASM_LONG): Remove. (INT_OP_GROUP): Define to INT_OP_NO_DOT. * config/m88k/m88k.c (output_tdesc): Avoid ASM_LONG. * config/m88k/m88k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. (ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/mips/iris5.h (TARGET_IRIX5): Define. * config/mips/mips.c (mips_assemble_integer): New. * config/mips/sni-svr4.h (ASM_LONG): Undefine. * config/mmix/mmix-protos.h (mmix_asm_output_double_int): Remove. * config/mmix/mmix.c (mmix_assemble_integer): New. (mmix_asm_output_double_int): Remove. (mmix_print_operand): Call mmix_output_octa directly. * config/mmix/mmix.h (ASM_LONG): Remove. * config/ns32k/ns32k.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_INT. * config/pa/pa.c (pa_assemble_integer): New. (pa_override_options): Only use aligned DI ops on 64-bit targets. Only use the unaligned ops if TARGET_GAS. * config/pdp11/pdp11.c (pdp11_assemble_integer): New. * config/pdp11/pdp11.h (TRAMPOLINE_TEMPLATE): Avoid ASM_OUTPUT_SHORT. * config/pj/pj.h (ASM_LONG): Undefine. * config/rs6000/linux64.h (RELOCATABLE_NEEDS_FIXUP): Undefine. * config/rs6000/rs6000.c (rs6000_assemble_integer): New, mostly extracted from ASM_OUTPUT_INT in sysv4.h. Use in_text_section() and in_toc_section() rather than the in_section variable. (rs6000_override_options): Only use DI ops when TARGET_POWERPC64. * config/rs6000/sysv4.h (TOC_SECTION_FUNCTION): Add in_toc_section(). (RELOCATABLE_NEEDS_FIXUP): Define. * config/rs6000/xcoff.h (DOUBLE_INT_ASM_OP): Change space to tab. * config/s390/linux.h (ASM_SHORT, ASM_LONG, ASM_QUAD): Remove. (ASM_OUTPUT_ADDR_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Use integer_asm_op to get the word directive. (ASM_OUTPUT_ASCII): Avoid ASM_BYTE_OP. * config/s390/s390.c (s390_assemble_integer): New. * config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY): Use integer_asm_op to get the word directive. * config/sparc/sol2.h (ASM_SHORT, ASM_LONG): Remove. * config/sparc/sparc-protos.h (output_double_int): Remove. * config/sparc/sparc.c (output_double_int): Move to... (sparc_assemble_integer): ...this new function. (sparc_override_options): Only use .uaxword if TARGET_ARCH64. * config/sparc/sparc.h (ASM_SHORT, ASM_LONG, ASM_LONGLONG): Remove. * config/sparc/sysv4.h (ASM_LONG): Remove. (ASM_OUTPUT_LONG_DOUBLE, ASM_OUTPUT_DOUBLE, ASM_OUTPUT_FLOAT): Avoid ASM_LONG. * config/vax/vax.h (TRAMPOLINE_TEMPLATE): Use assemble_aligned_integer. * config/we32k/we32k.h (TRAMPOLINE_TEMPLATE): Likewise. * config/1750a/1750a.c, config/a29k/a29k.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/clipper/clipper.c, config/convex/convex.c, config/cris/cris.c, config/d30v/d30v.c, config/dsp16xx/dsp16xx.c, config/elxsi/elxsi.c, config/fr30/fr30.c, config/h8300/h8300.c, config/i370/i370.c, config/i386/i386.c, config/i860/i860.c, config/i960/i960.c, config/ia64/ia64.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m88k/m88k.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10200/mn10200.c, config/mn10300/mn10300.c, config/ns32k/ns32k.c, config/pa/pa.c, config/pdp11/pdp11.c, config/sh/sh.c, config/sparc/sparc.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/we32k/we32k.c (TARGET_ASM_BYTE_OP, TARGET_ASM_ALIGNED_HI_OP, TARGET_ASM_ALIGNED_SI_OP, TARGET_ASM_ALIGNED_DI_OP, TARGET_ASM_UNALIGNED_HI_OP, TARGET_ASM_UNALIGNED_SI_OP, TARGET_ASM_UNALIGNED_DI_OP, TARGET_ASM_INTEGER): Redefine as appropriate. * config/defaults.h, config/darwin.h, config/elfos.h, config/svr3.h, config/1750a/1750a.h, config/a29k/a29k.h, config/alpha/alpha.h, config/arc/arc.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/clipper/clipper.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/elxsi/elxsi.h, config/fr30/fr30.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/bsd.h, config/i386/djgpp.h, config/i386/i386.h, config/i386/sco5.h, config/i386/sol2.h, config/i386/sun386.h, config/i860/i860.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/auxas.h, config/m68k/dpx2.h, config/m68k/hp320.h, config/m68k/m68k.h, config/m68k/mot3300.h, config/m68k/sgs.h, config/m68k/tower-as.h, config/m88k/m88k.h, config/mcore/mcore-elf.h, config/mcore/mcore.h, config/mips/iris5.h, config/mips/iris6.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h config/ns32k/encore.h, config/ns32k/ns32k.h, config/pa/pa-64.h, config/pa/pa.h, config/pdp11/pdp11.h, config/pj/pj.h, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/rs6000.h, config/rs6000/sysv4.h, config/rs6000/xcoff.h, config/s390/linux.h, config/sh/sh.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sp64-elf.h, config/sparc/sparc.h, config/sparc/sysv4.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/we32k/we32k.h (ASM_OUTPUT_CHAR, ASM_OUTPUT_BYTE, ASM_BYTE_OP, ASM_BYTE, ASM_OUTPUT_SHORT, ASM_OUTPUT_INT, ASM_OUTPUT_DOUBLE_INT, UNALIGNED_SHORT_ASM_OP, UNALIGNED_INT_ASM_OP, UNALIGNED_DOUBLE_INT_ASM_OP): Undefine, where defined. From-SVN: r48101
2001-12-17 16:05:40 +01:00
@deftypevr {Target Hook} {const char *} TARGET_ASM_BYTE_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_HI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_SI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_DI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_ALIGNED_TI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_HI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_SI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_DI_OP
@deftypevrx {Target Hook} {const char *} TARGET_ASM_UNALIGNED_TI_OP
These hooks specify assembly directives for creating certain kinds
of integer object. The @code{TARGET_ASM_BYTE_OP} directive creates a
byte-sized object, the @code{TARGET_ASM_ALIGNED_HI_OP} one creates an
aligned two-byte object, and so on. Any of the hooks may be
@code{NULL}, indicating that no suitable directive is available.
The compiler will print these strings at the start of a new line,
followed immediately by the object's initial value. In most cases,
the string should contain a tab, a pseudo-op, and then another tab.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_ASM_INTEGER (rtx @var{x}, unsigned int @var{size}, int @var{aligned_p})
The @code{assemble_integer} function uses this hook to output an
integer object. @var{x} is the object's value, @var{size} is its size
in bytes and @var{aligned_p} indicates whether it is aligned. The
function should return @code{true} if it was able to output the
object. If it returns false, @code{assemble_integer} will try to
split the object into smaller parts.
The default implementation of this hook will use the
@code{TARGET_ASM_BYTE_OP} family of strings, returning @code{false}
when the relevant string is @code{NULL}.
@end deftypefn
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} bool TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA (FILE *@var{file}, rtx @var{x})
A target hook to recognize @var{rtx} patterns that @code{output_addr_const}
can't deal with, and output assembly code to @var{file} corresponding to
the pattern @var{x}. This may be used to allow machine-dependent
@code{UNSPEC}s to appear within constants.
If target hook fails to recognize a pattern, it must return @code{false},
so that a standard error message is printed. If it prints an error message
itself, by calling, for example, @code{output_operand_lossage}, it may just
return @code{true}.
@end deftypefn
@defmac ASM_OUTPUT_ASCII (@var{stream}, @var{ptr}, @var{len})
1996-09-25 01:21:45 +02:00
A C statement to output to the stdio stream @var{stream} an assembler
instruction to assemble a string constant containing the @var{len}
bytes at @var{ptr}. @var{ptr} will be a C expression of type
@code{char *} and @var{len} a C expression of type @code{int}.
If the assembler has a @code{.ascii} pseudo-op as found in the
Berkeley Unix assembler, do not define the macro
@code{ASM_OUTPUT_ASCII}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_FDESC (@var{stream}, @var{decl}, @var{n})
A C statement to output word @var{n} of a function descriptor for
@var{decl}. This must be defined if @code{TARGET_VTABLE_USES_DESCRIPTORS}
is defined, and is otherwise unused.
@end defmac
@defmac CONSTANT_POOL_BEFORE_FUNCTION
1997-08-11 17:56:58 +02:00
You may define this macro as a C expression. You should define the
expression to have a nonzero value if GCC should output the constant
1997-08-11 17:56:58 +02:00
pool for a function before the code for the function, or a zero value if
GCC should output the constant pool after the function. If you do
not define this macro, the usual case, GCC will output the constant
1997-08-11 17:56:58 +02:00
pool before the function.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac ASM_OUTPUT_POOL_PROLOGUE (@var{file}, @var{funname}, @var{fundecl}, @var{size})
1996-09-25 01:21:45 +02:00
A C statement to output assembler commands to define the start of the
constant pool for a function. @var{funname} is a string giving
the name of the function. Should the return type of the function
be required, it can be obtained via @var{fundecl}. @var{size}
is the size, in bytes, of the constant pool that will be written
immediately after this call.
If no constant-pool prefix is required, the usual case, this macro need
not be defined.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_SPECIAL_POOL_ENTRY (@var{file}, @var{x}, @var{mode}, @var{align}, @var{labelno}, @var{jumpto})
1996-09-25 01:21:45 +02:00
A C statement (with or without semicolon) to output a constant in the
constant pool, if it needs special treatment. (This macro need not do
anything for RTL expressions that can be output normally.)
The argument @var{file} is the standard I/O stream to output the
assembler code on. @var{x} is the RTL expression for the constant to
output, and @var{mode} is the machine mode (in case @var{x} is a
@samp{const_int}). @var{align} is the required alignment for the value
@var{x}; you should output an assembler directive to force this much
alignment.
The argument @var{labelno} is a number to use in an internal label for
the address of this pool entry. The definition of this macro is
responsible for outputting the label definition at the proper place.
Here is how to do this:
@smallexample
@code{(*targetm.asm_out.internal_label)} (@var{file}, "LC", @var{labelno});
@end smallexample
1996-09-25 01:21:45 +02:00
When you output a pool entry specially, you should end with a
@code{goto} to the label @var{jumpto}. This will prevent the same pool
entry from being output a second time in the usual manner.
You need not define this macro if it would do nothing.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_POOL_EPILOGUE (@var{file} @var{funname} @var{fundecl} @var{size})
1997-08-11 17:56:58 +02:00
A C statement to output assembler commands to at the end of the constant
pool for a function. @var{funname} is a string giving the name of the
function. Should the return type of the function be required, you can
obtain it via @var{fundecl}. @var{size} is the size, in bytes, of the
constant pool that GCC wrote immediately before this call.
1997-08-11 17:56:58 +02:00
If no constant-pool epilogue is required, the usual case, you need not
define this macro.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac IS_ASM_LOGICAL_LINE_SEPARATOR (@var{C}, @var{STR})
1996-09-25 01:21:45 +02:00
Define this macro as a C expression which is nonzero if @var{C} is
used as a logical line separator by the assembler. @var{STR} points
to the position in the string where @var{C} was found; this can be used if
a line separator uses multiple characters.
1996-09-25 01:21:45 +02:00
If you do not define this macro, the default is that only
the character @samp{;} is treated as a logical line separator.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypevr {Target Hook} {const char *} TARGET_ASM_OPEN_PAREN
@deftypevrx {Target Hook} {const char *} TARGET_ASM_CLOSE_PAREN
final.c (output_addr_const): Use target opening and closing parentheses. * final.c (output_addr_const): Use target opening and closing parentheses. * target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN defaults, add to TARGET_ASM_OUT. * target.h (struct gcc_target): Add open_paren and close_paren. * doc/md.texi: Update. * doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE, TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and TARGET_ASM_CLOSE_PAREN. config: * i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * 1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. * a29k/a29k.h: Similarly. * alpha/alpha.h: Similarly. * arc/arc.h: Similarly. * arm/aof.h: Similarly. * arm/aout.h: Similarly. * avr/avr.h: Similarly. * c4x/c4x.h: Similarly. * clipper/clipper.h: Similarly. * convex/convex.h: Similarly. * d30v/d30v.h: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.h: Similarly. * h8300/h8300.h: Similarly. * i370/i370.h: Similarly. * i386/i386.h: Similarly. * i860/i860.h: Similarly. * i960/i960.h: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/m68k.h: Similarly. * m88k/m88k.h: Similarly. * mcore/mcore.h: Similarly. * mips/mips.h: Similarly. * mn10200/mn10200.h: Similarly. * mn10300/mn10300.h: Similarly. * ns32k/ns32k.h: Similarly. * pa/pa.h: Similarly. * pdp11/pdp11.h: Similarly. * pj/pj.h: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000.h: Similarly. * sh/sh.h: Similarly. * sparc/sparc.h: Similarly. * v850/v850.h: Similarly. * vax/vax.h: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43856
2001-07-09 08:10:09 +02:00
These target hooks are C string constants, describing the syntax in the
assembler for grouping arithmetic expressions. If not overridden, they
default to normal parentheses, which is correct for most assemblers.
@end deftypevr
final.c (output_addr_const): Use target opening and closing parentheses. * final.c (output_addr_const): Use target opening and closing parentheses. * target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN defaults, add to TARGET_ASM_OUT. * target.h (struct gcc_target): Add open_paren and close_paren. * doc/md.texi: Update. * doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE, TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and TARGET_ASM_CLOSE_PAREN. config: * i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * 1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. * a29k/a29k.h: Similarly. * alpha/alpha.h: Similarly. * arc/arc.h: Similarly. * arm/aof.h: Similarly. * arm/aout.h: Similarly. * avr/avr.h: Similarly. * c4x/c4x.h: Similarly. * clipper/clipper.h: Similarly. * convex/convex.h: Similarly. * d30v/d30v.h: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.h: Similarly. * h8300/h8300.h: Similarly. * i370/i370.h: Similarly. * i386/i386.h: Similarly. * i860/i860.h: Similarly. * i960/i960.h: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/m68k.h: Similarly. * m88k/m88k.h: Similarly. * mcore/mcore.h: Similarly. * mips/mips.h: Similarly. * mn10200/mn10200.h: Similarly. * mn10300/mn10300.h: Similarly. * ns32k/ns32k.h: Similarly. * pa/pa.h: Similarly. * pdp11/pdp11.h: Similarly. * pj/pj.h: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000.h: Similarly. * sh/sh.h: Similarly. * sparc/sparc.h: Similarly. * v850/v850.h: Similarly. * vax/vax.h: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43856
2001-07-09 08:10:09 +02:00
These macros are provided by @file{real.h} for writing the definitions
1996-09-25 01:21:45 +02:00
of @code{ASM_OUTPUT_DOUBLE} and the like:
@defmac REAL_VALUE_TO_TARGET_SINGLE (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_DOUBLE (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_LONG_DOUBLE (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_DECIMAL32 (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_DECIMAL64 (@var{x}, @var{l})
@defmacx REAL_VALUE_TO_TARGET_DECIMAL128 (@var{x}, @var{l})
These translate @var{x}, of type @code{REAL_VALUE_TYPE}, to the
target's floating point representation, and store its bit pattern in
the variable @var{l}. For @code{REAL_VALUE_TO_TARGET_SINGLE} and
@code{REAL_VALUE_TO_TARGET_DECIMAL32}, this variable should be a
simple @code{long int}. For the others, it should be an array of
@code{long int}. The number of elements in this array is determined
by the size of the desired target floating point data type: 32 bits of
it go in each @code{long int} array element. Each array element holds
32 bits of the result, even if @code{long int} is wider than 32 bits
on the host machine.
1996-09-25 01:21:45 +02:00
The array element values are designed so that you can print them out
using @code{fprintf} in the order they should appear in the target
machine's memory.
@end defmac
1996-09-25 01:21:45 +02:00
@node Uninitialized Data
@subsection Output of Uninitialized Variables
Each of the macros in this section is used to do the whole job of
outputting a single uninitialized variable.
@defmac ASM_OUTPUT_COMMON (@var{stream}, @var{name}, @var{size}, @var{rounded})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a common-label named
@var{name} whose size is @var{size} bytes. The variable @var{rounded}
is the size rounded up to whatever alignment the caller wants. It is
possible that @var{size} may be zero, for instance if a struct with no
other member than a zero-length array is defined. In this case, the
backend must output a symbol definition that allocates at least one
byte, both so that the address of the resulting object does not compare
equal to any other, and because some object formats cannot even express
the concept of a zero-sized common symbol, as that is how they represent
an ordinary undefined external.
1996-09-25 01:21:45 +02:00
Use the expression @code{assemble_name (@var{stream}, @var{name})} to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline.
This macro controls how the assembler definitions of uninitialized
common global variables are output.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ALIGNED_COMMON (@var{stream}, @var{name}, @var{size}, @var{alignment})
1996-09-25 01:21:45 +02:00
Like @code{ASM_OUTPUT_COMMON} except takes the required alignment as a
separate, explicit argument. If you define this macro, it is used in
place of @code{ASM_OUTPUT_COMMON}, and gives you more flexibility in
handling the required alignment of the variable. The alignment is specified
as the number of bits.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ALIGNED_DECL_COMMON (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_COMMON} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_COMMON} and
@code{ASM_OUTPUT_ALIGNED_COMMON}. Define this macro when you need to see
the variable's decl in order to chose what to output.
@end defmac
@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of uninitialized global @var{decl} named
@var{name} whose size is @var{size} bytes. The variable @var{alignment}
is the alignment specified as the number of bits.
1996-09-25 01:21:45 +02:00
Try to use function @code{asm_output_aligned_bss} defined in file
@file{varasm.c} when defining this macro. If unable, use the expression
1996-09-25 01:21:45 +02:00
@code{assemble_name (@var{stream}, @var{name})} to output the name itself;
before and after that, output the additional assembler syntax for defining
the name, and a newline.
There are two ways of handling global BSS@. One is to define this macro.
tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. * doc/tm.texi (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Document. (ASM_OUTPUT_BSS): Describe the two ways of handling global BSS, and say that only one is needed. * doc/rtl.texi (SYMBOL_REF_BLOCK): Say that the block can be null. * target.h (have_switchable_bss_sections): New hook. * explow.c (use_anchored_address): Check that the symbol is in a block. * varasm.c (tls_comm_section, comm_section, lcomm_section) (bss_noswitch_section): New variables. (get_unnamed_section): Add SECTION_UNNAMED to the flags. (get_noswitch_section): New function. (get_block_for_section): Allow SECT to be null. (unlikely_text_section_p): Use SECTION_STYLE. (bss_initializer_p): New function. (get_variable_section): Move earlier in file. Take a new argument, prefer_noswitch_p. Move bss checks from assemble_variable to here. Return one of the new *_sections in such cases. (get_block_for_decl): New function, extracting some logic from use_blocks_for_decl_p. (change_symbol_section): Remove in favor of... (change_symbol_block): ...this new function. (use_blocks_for_decl_p): Remove checks now performed by get_block_for_decl. (make_decl_rtl): Use change_symbol_block and get_block_for_decl. (ASM_EMIT_LOCAL, ASM_EMIT_BSS, ASM_EMIT_COMMON): Delete in favor of... (emit_local, emit_bss, emit_common): ...these new functions. Return true if the alignment was honored. (emit_tls_common): New function. (asm_emit_uninitialised): Delete. (assemble_variable_noswitch): New function, split out from... (assemble_variable): ...here. Don't make decisions about common variables here. Globalize all public decls that go into non-common sections. Check whether SYMBOL_REF_BLOCK is null. (output_constant_def_contents): Check whether SYMBOL_REF_BLOCK is null. (output_constant_pool): Likewise. (init_varasm_once): Initialize the new section variables. (have_global_bss_p): New function. (categorize_decl_for_section): Use bss_initializer_p. (switch_to_section): Use SECTION_STYLE. Abort for SECTION_NOSWITCH. (place_block_symbol): Assert that the symbol must be in a block. * target-def.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): New macro. (TARGET_INITIALIZER): Include it. * rtl.h (SYMBOL_REF_BLOCK): Document the null alternative. * output.h (SECTION_STYLE_MASK, SECTION_COMMON): New macros. (SECTION_MACH_DEP): Bump by two. (SECTION_UNNAMED, SECTION_NOSWITCH): New macros. (unnamed_section): Mention SECTION_UNNAMED in comment. (named_section): Likewise SECTION_NAMED. (noswitch_section_callback): New type. (noswitch_section): New structure. (section): Add a noswitch_section alternative. (SECTION_STYLE): New macro. (tls_comm_section, comm_section, lcomm_section): Declare. (bss_noswitch_section, have_global_bss_p): Declare. * config/elfos.h (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/iq2000/iq2000.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/v850/v850.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. * config/stormy16/stormy16.c (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Override. cp/ * decl.c (start_decl): Use have_global_bss_p when deciding whether to make the decl common. ada/ * utils.c (create_var_decl): Use have_global_bss_p when deciding whether to make the decl common. From-SVN: r111644
2006-03-02 20:32:52 +01:00
The other is to have @code{TARGET_ASM_SELECT_SECTION} return a
switchable BSS section (@pxref{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}).
You do not need to do both.
Some languages do not have @code{common} data, and require a
non-common form of global BSS in order to handle uninitialized globals
efficiently. C++ is one example of this. However, if the target does
not support global BSS, the front end may choose to make globals
common in order to save space in the object file.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, @var{rounded})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a local-common-label named
@var{name} whose size is @var{size} bytes. The variable @var{rounded}
is the size rounded up to whatever alignment the caller wants.
Use the expression @code{assemble_name (@var{stream}, @var{name})} to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline.
This macro controls how the assembler definitions of uninitialized
static variables are output.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ALIGNED_LOCAL (@var{stream}, @var{name}, @var{size}, @var{alignment})
1996-09-25 01:21:45 +02:00
Like @code{ASM_OUTPUT_LOCAL} except takes the required alignment as a
separate, explicit argument. If you define this macro, it is used in
place of @code{ASM_OUTPUT_LOCAL}, and gives you more flexibility in
handling the required alignment of the variable. The alignment is specified
as the number of bits.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ALIGNED_DECL_LOCAL (@var{stream}, @var{decl}, @var{name}, @var{size}, @var{alignment})
Like @code{ASM_OUTPUT_ALIGNED_DECL} except that @var{decl} of the
variable to be output, if there is one, or @code{NULL_TREE} if there
is no corresponding variable. If you define this macro, GCC will use it
in place of both @code{ASM_OUTPUT_DECL} and
@code{ASM_OUTPUT_ALIGNED_DECL}. Define this macro when you need to see
the variable's decl in order to chose what to output.
@end defmac
1996-09-25 01:21:45 +02:00
@node Label Output
@subsection Output and Generation of Labels
@c prevent bad page break with this line
This is about outputting labels.
@findex assemble_name
@defmac ASM_OUTPUT_LABEL (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a label named @var{name}.
Use the expression @code{assemble_name (@var{stream}, @var{name})} to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_FUNCTION_LABEL (@var{stream}, @var{name}, @var{decl})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} the assembler definition of a label named @var{name} of
a function.
Use the expression @code{assemble_name (@var{stream}, @var{name})} to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
If this macro is not defined, then the function name is defined in the
usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
@end defmac
@findex assemble_name_raw
@defmac ASM_OUTPUT_INTERNAL_LABEL (@var{stream}, @var{name})
Identical to @code{ASM_OUTPUT_LABEL}, except that @var{name} is known
to refer to a compiler-generated label. The default definition uses
@code{assemble_name_raw}, which is like @code{assemble_name} except
that it is more efficient.
@end defmac
@defmac SIZE_ASM_OP
A C string containing the appropriate assembler directive to specify the
size of a symbol, without any arguments. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"\t.size\t"}; on other
systems, the default is not to define this macro.
Define this macro only if it is correct to use the default definitions
of @code{ASM_OUTPUT_SIZE_DIRECTIVE} and @code{ASM_OUTPUT_MEASURED_SIZE}
for your system. If you need your own custom definitions of those
macros, or if you do not need explicit symbol sizes at all, do not
define this macro.
@end defmac
@defmac ASM_OUTPUT_SIZE_DIRECTIVE (@var{stream}, @var{name}, @var{size})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler that the size of the
symbol @var{name} is @var{size}. @var{size} is a @code{HOST_WIDE_INT}.
If you define @code{SIZE_ASM_OP}, a default definition of this macro is
provided.
@end defmac
@defmac ASM_OUTPUT_MEASURED_SIZE (@var{stream}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler to calculate the size of
the symbol @var{name} by subtracting its address from the current
address.
If you define @code{SIZE_ASM_OP}, a default definition of this macro is
provided. The default assumes that the assembler recognizes a special
@samp{.} symbol as referring to the current address, and can calculate
the difference between this and another symbol. If your assembler does
not recognize @samp{.} or cannot do calculations with it, you will need
to redefine @code{ASM_OUTPUT_MEASURED_SIZE} to use some other technique.
@end defmac
@defmac NO_DOLLAR_IN_LABEL
Define this macro if the assembler does not accept the character
@samp{$} in label names. By default constructors and destructors in
G++ have @samp{$} in the identifiers. If this macro is defined,
@samp{.} is used instead.
@end defmac
@defmac NO_DOT_IN_LABEL
Define this macro if the assembler does not accept the character
@samp{.} in label names. By default constructors and destructors in G++
have names that use @samp{.}. If this macro is defined, these names
are rewritten to avoid @samp{.}.
@end defmac
@defmac TYPE_ASM_OP
A C string containing the appropriate assembler directive to specify the
type of a symbol, without any arguments. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"\t.type\t"}; on other
systems, the default is not to define this macro.
Define this macro only if it is correct to use the default definition of
@code{ASM_OUTPUT_TYPE_DIRECTIVE} for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
@end defmac
@defmac TYPE_OPERAND_FMT
A C string which specifies (using @code{printf} syntax) the format of
the second operand to @code{TYPE_ASM_OP}. On systems that use ELF, the
default (in @file{config/elfos.h}) is @samp{"@@%s"}; on other systems,
the default is not to define this macro.
Define this macro only if it is correct to use the default definition of
@code{ASM_OUTPUT_TYPE_DIRECTIVE} for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
@end defmac
@defmac ASM_OUTPUT_TYPE_DIRECTIVE (@var{stream}, @var{type})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a directive telling the assembler that the type of the
symbol @var{name} is @var{type}. @var{type} is a C string; currently,
that string is always either @samp{"function"} or @samp{"object"}, but
you should not count on this.
If you define @code{TYPE_ASM_OP} and @code{TYPE_OPERAND_FMT}, a default
definition of this macro is provided.
@end defmac
@defmac ASM_DECLARE_FUNCTION_NAME (@var{stream}, @var{name}, @var{decl})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of a
function which is being defined. This macro is responsible for
outputting the label definition (perhaps using
@code{ASM_OUTPUT_FUNCTION_LABEL}). The argument @var{decl} is the
1996-09-25 01:21:45 +02:00
@code{FUNCTION_DECL} tree node representing the function.
If this macro is not defined, then the function name is defined in the
usual manner as a label (by means of @code{ASM_OUTPUT_FUNCTION_LABEL}).
1996-09-25 01:21:45 +02:00
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in the definition
of this macro.
@end defmac
@defmac ASM_DECLARE_FUNCTION_SIZE (@var{stream}, @var{name}, @var{decl})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the size of a function
which is being defined. The argument @var{name} is the name of the
function. The argument @var{decl} is the @code{FUNCTION_DECL} tree node
representing the function.
If this macro is not defined, then the function size is not defined.
You may wish to use @code{ASM_OUTPUT_MEASURED_SIZE} in the definition
of this macro.
@end defmac
@defmac ASM_DECLARE_OBJECT_NAME (@var{stream}, @var{name}, @var{decl})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name @var{name} of an
initialized variable which is being defined. This macro must output the
label definition (perhaps using @code{ASM_OUTPUT_LABEL}). The argument
@var{decl} is the @code{VAR_DECL} tree node representing the variable.
If this macro is not defined, then the variable name is defined in the
usual manner as a label (by means of @code{ASM_OUTPUT_LABEL}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} and/or
@code{ASM_OUTPUT_SIZE_DIRECTIVE} in the definition of this macro.
@end defmac
@deftypefn {Target Hook} void TARGET_ASM_DECLARE_CONSTANT_NAME (FILE *@var{file}, const char *@var{name}, const_tree @var{expr}, HOST_WIDE_INT @var{size})
A target hook to output to the stdio stream @var{file} any text necessary
for declaring the name @var{name} of a constant which is being defined. This
target hook is responsible for outputting the label definition (perhaps using
@code{assemble_label}). The argument @var{exp} is the value of the constant,
and @var{size} is the size of the constant in bytes. The @var{name}
will be an internal label.
The default version of this target hook, define the @var{name} in the
usual manner as a label (by means of @code{assemble_label}).
You may wish to use @code{ASM_OUTPUT_TYPE_DIRECTIVE} in this target hook.
@end deftypefn
@defmac ASM_DECLARE_REGISTER_GLOBAL (@var{stream}, @var{decl}, @var{regno}, @var{name})
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for claiming a register @var{regno}
for a global variable @var{decl} with name @var{name}.
If you don't define this macro, that is equivalent to defining it to do
nothing.
@end defmac
@defmac ASM_FINISH_DECLARE_OBJECT (@var{stream}, @var{decl}, @var{toplevel}, @var{atend})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to finish up declaring a variable name
once the compiler has processed its initializer fully and thus has had a
chance to determine the size of an array when controlled by an
initializer. This is used on systems where it's necessary to declare
something about the size of the object.
If you don't define this macro, that is equivalent to defining it to do
nothing.
You may wish to use @code{ASM_OUTPUT_SIZE_DIRECTIVE} and/or
@code{ASM_OUTPUT_MEASURED_SIZE} in the definition of this macro.
@end defmac
alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS): Use target hook. * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * arm.c (aof_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * c4x.c (c4x_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. * c4x.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * darwin-protos.h (darwin_globalize_label): Declare. * darwin.c (darwin_globalize_label): New function. * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. * dsp16xx.c (asm_output_common): Use target hook. * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. * frv.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * i370.c (i370_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. * i370.h (ASM_GLOBALIZE_LABEL): Delete. * i386.c (ix86_asm_file_end): Use target hook. * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * ia64.c (ia64_asm_output_external): Likewise. * ia64/sysv4.h: Update comment. * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. * mmix-protos.h (mmix_asm_globalize_label): Delete. * mmix.c (mmix_asm_globalize_label): Likewise. * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * ns32k.c (ns32k_globalize_label): New function. * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. (ASM_GLOBALIZE_LABEL): Delete. * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. (TARGET_ASM_GLOBALIZE_LABEL): Undefine. * pa.c (pa_globalize_label): New function. * pa.h (ASM_GLOBALIZE_LABEL): Delete. (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. (TARGET_ASM_GLOBALIZE_LABEL): Undef. * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * v850.c (v850_output_aligned_bss): Use target hook. * vax.c (vms_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * defaults.h (ASM_GLOBALIZE_LABEL): Delete. * doc/tm.texi: Update docs. * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use target hook. * final.c (output_alternate_entry_point): Likewise. * hooks.c (hook_FILEptr_constcharptr_void): New function. * hooks.h (hook_FILEptr_constcharptr_void): Declare. * output.h (assemble_global): Delete. (default_globalize_label): Declare. * system.h (ASM_GLOBALIZE_LABEL): Poison. * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. * target.h (gcc_target): Add globalize_label member. * varasm.c (asm_output_bss, asm_output_aligned_bss, globalize_decl): Use target hook. (assemble_global): Delete. (default_globalize_label): New function. From-SVN: r56478
2002-08-21 04:41:51 +02:00
@deftypefn {Target Hook} void TARGET_ASM_GLOBALIZE_LABEL (FILE *@var{stream}, const char *@var{name})
This target hook is a function to output to the stdio stream
1996-09-25 01:21:45 +02:00
@var{stream} some commands that will make the label @var{name} global;
alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS): Use target hook. * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * arm.c (aof_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * c4x.c (c4x_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. * c4x.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * darwin-protos.h (darwin_globalize_label): Declare. * darwin.c (darwin_globalize_label): New function. * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. * dsp16xx.c (asm_output_common): Use target hook. * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. * frv.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * i370.c (i370_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. * i370.h (ASM_GLOBALIZE_LABEL): Delete. * i386.c (ix86_asm_file_end): Use target hook. * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * ia64.c (ia64_asm_output_external): Likewise. * ia64/sysv4.h: Update comment. * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. * mmix-protos.h (mmix_asm_globalize_label): Delete. * mmix.c (mmix_asm_globalize_label): Likewise. * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * ns32k.c (ns32k_globalize_label): New function. * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. (ASM_GLOBALIZE_LABEL): Delete. * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. (TARGET_ASM_GLOBALIZE_LABEL): Undefine. * pa.c (pa_globalize_label): New function. * pa.h (ASM_GLOBALIZE_LABEL): Delete. (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. (TARGET_ASM_GLOBALIZE_LABEL): Undef. * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * v850.c (v850_output_aligned_bss): Use target hook. * vax.c (vms_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * defaults.h (ASM_GLOBALIZE_LABEL): Delete. * doc/tm.texi: Update docs. * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use target hook. * final.c (output_alternate_entry_point): Likewise. * hooks.c (hook_FILEptr_constcharptr_void): New function. * hooks.h (hook_FILEptr_constcharptr_void): Declare. * output.h (assemble_global): Delete. (default_globalize_label): Declare. * system.h (ASM_GLOBALIZE_LABEL): Poison. * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. * target.h (gcc_target): Add globalize_label member. * varasm.c (asm_output_bss, asm_output_aligned_bss, globalize_decl): Use target hook. (assemble_global): Delete. (default_globalize_label): New function. From-SVN: r56478
2002-08-21 04:41:51 +02:00
that is, available for reference from other files.
1996-09-25 01:21:45 +02:00
alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha.c (TARGET_ASM_GLOBALIZE_LABEL): Define for unicosmk. * alpha/elf.h (ASM_OUTPUT_EXTERNAL_LIBCALL, ASM_OUTPUT_ALIGNED_BSS): Use target hook. * alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS): Likewise. * alpha/unicosmk.h (ASM_GLOBALIZE_LABEL): Delete. * arm/aof.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * arm.c (aof_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for AOF. * arm/unknown-elf.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * c4x.c (c4x_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for c4x. * c4x.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * cris/aout.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * darwin-protos.h (darwin_globalize_label): Declare. * darwin.c (darwin_globalize_label): New function. * darwin.h (ASM_DECLARE_CLASS_REFERENCE): Use target hook. (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP, TARGET_ASM_GLOBALIZE_LABEL): Define. * dsp16xx.c (asm_output_common): Use target hook. * elfos.h (ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise. * frv.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * i370.c (i370_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for i370. * i370.h (ASM_GLOBALIZE_LABEL): Delete. * i386.c (ix86_asm_file_end): Use target hook. * i386/sco5.h (ASM_GLOBALIZE_LABEL): Don't undef. (ASM_OUTPUT_EXTERNAL_LIBCALL): Use target hook. * ia64.c (ia64_asm_output_external): Likewise. * ia64/sysv4.h: Update comment. * m32r.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * mips/elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips/iris5.h (ASM_OUTPUT_WEAK_ALIAS): Use target hook. * mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise. * mips.h (ASM_OUTPUT_ALIGNED_DECL_COMMON): Use target hook. * mmix-protos.h (mmix_asm_globalize_label): Delete. * mmix.c (mmix_asm_globalize_label): Likewise. * mmix.h (ASM_GLOBALIZE_LABEL): Likewise. (GLOBAL_ASM_OP): Define. * ns32k.c (ns32k_globalize_label): New function. * ns32k.h (TARGET_ASM_GLOBALIZE_LABEL): Define for ns32k. (ASM_GLOBALIZE_LABEL): Delete. * pa/pa-linux.h (ASM_GLOBALIZE_LABEL): Don't undef. (TARGET_ASM_GLOBALIZE_LABEL): Undefine. * pa.c (pa_globalize_label): New function. * pa.h (ASM_GLOBALIZE_LABEL): Delete. (TARGET_ASM_GLOBALIZE_LABEL): Define for pa. * rs6000/darwin.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. (TARGET_ASM_GLOBALIZE_LABEL): Undef. * rs6000/sysv4.h (ASM_OUTPUT_ALIGNED_BSS): Use target hook. * rs6000/xcoff.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * v850.c (v850_output_aligned_bss): Use target hook. * vax.c (vms_globalize_label): New function. (TARGET_ASM_GLOBALIZE_LABEL): Define for vms. * vax/vms.h (ASM_GLOBALIZE_LABEL): Delete. (GLOBAL_ASM_OP): Define. * defaults.h (ASM_GLOBALIZE_LABEL): Delete. * doc/tm.texi: Update docs. * dwarf2out.c (default_eh_frame_section, output_die_symbol): Use target hook. * final.c (output_alternate_entry_point): Likewise. * hooks.c (hook_FILEptr_constcharptr_void): New function. * hooks.h (hook_FILEptr_constcharptr_void): Declare. * output.h (assemble_global): Delete. (default_globalize_label): Declare. * system.h (ASM_GLOBALIZE_LABEL): Poison. * target-def.h (TARGET_ASM_GLOBALIZE_LABEL): Define. (TARGET_ASM_OUT): Add TARGET_ASM_GLOBALIZE_LABEL. * target.h (gcc_target): Add globalize_label member. * varasm.c (asm_output_bss, asm_output_aligned_bss, globalize_decl): Use target hook. (assemble_global): Delete. (default_globalize_label): New function. From-SVN: r56478
2002-08-21 04:41:51 +02:00
The default implementation relies on a proper definition of
@code{GLOBAL_ASM_OP}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_GLOBALIZE_DECL_NAME (FILE *@var{stream}, tree @var{decl})
This target hook is a function to output to the stdio stream
@var{stream} some commands that will make the name associated with @var{decl}
global; that is, available for reference from other files.
The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
@end deftypefn
@defmac ASM_WEAKEN_LABEL (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} some commands that will make the label @var{name} weak;
that is, available for reference from other files but only used if
no other definition is available. Use the expression
@code{assemble_name (@var{stream}, @var{name})} to output the name
itself; before and after that, output the additional assembler syntax
for making that name weak, and a newline.
If you don't define this macro or @code{ASM_WEAKEN_DECL}, GCC will not
support weak symbols and you should not define the @code{SUPPORTS_WEAK}
macro.
@end defmac
@defmac ASM_WEAKEN_DECL (@var{stream}, @var{decl}, @var{name}, @var{value})
Combines (and replaces) the function of @code{ASM_WEAKEN_LABEL} and
@code{ASM_OUTPUT_WEAK_ALIAS}, allowing access to the associated function
or variable decl. If @var{value} is not @code{NULL}, this C statement
should output to the stdio stream @var{stream} assembler code which
defines (equates) the weak symbol @var{name} to have the value
@var{value}. If @var{value} is @code{NULL}, it should output commands
to make @var{name} weak.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_WEAKREF (@var{stream}, @var{decl}, @var{name}, @var{value})
Outputs a directive that enables @var{name} to be used to refer to
symbol @var{value} with weak-symbol semantics. @code{decl} is the
declaration of @code{name}.
@end defmac
@defmac SUPPORTS_WEAK
A preprocessor constant expression which evaluates to true if the target
supports weak symbols.
1996-09-25 01:21:45 +02:00
If you don't define this macro, @file{defaults.h} provides a default
definition. If either @code{ASM_WEAKEN_LABEL} or @code{ASM_WEAKEN_DECL}
is defined, the default definition is @samp{1}; otherwise, it is @samp{0}.
@end defmac
@defmac TARGET_SUPPORTS_WEAK
A C expression which evaluates to true if the target supports weak symbols.
If you don't define this macro, @file{defaults.h} provides a default
definition. The default definition is @samp{(SUPPORTS_WEAK)}. Define
this macro if you want to control weak symbol support with a compiler
flag such as @option{-melf}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MAKE_DECL_ONE_ONLY (@var{decl})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to mark @var{decl} to be emitted as a
public symbol such that extra copies in multiple translation units will
be discarded by the linker. Define this macro if your object file
format provides support for this concept, such as the @samp{COMDAT}
section flags in the Microsoft Windows PE/COFF format, and this support
requires changes to @var{decl}, such as putting it in a separate section.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SUPPORTS_ONE_ONLY
1996-09-25 01:21:45 +02:00
A C expression which evaluates to true if the target supports one-only
semantics.
If you don't define this macro, @file{varasm.c} provides a default
definition. If @code{MAKE_DECL_ONE_ONLY} is defined, the default
definition is @samp{1}; otherwise, it is @samp{0}. Define this macro if
you want to control one-only symbol support with a compiler flag, or if
1996-09-25 01:21:45 +02:00
setting the @code{DECL_ONE_ONLY} flag is enough to mark a declaration to
be emitted as one-only.
@end defmac
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_ASSEMBLE_VISIBILITY (tree @var{decl}, int @var{visibility})
This target hook is a function to output to @var{asm_out_file} some
commands that will make the symbol(s) associated with @var{decl} have
hidden, protected or internal visibility as specified by @var{visibility}.
@end deftypefn
@defmac TARGET_WEAK_NOT_IN_ARCHIVE_TOC
Enabled linkonce support for Darwin. * target.h (struct gcc_target): New target hook, unwind_label. * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. * output.h (default_emit_unwind_label): New function. * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. (TARGET_USES_WEAK_UNWIND_INFO): New target macro. (TARGET_SUPPORTS_HIDDEN): New target macro. * dwarf2out.c (struct dw_fde_struct): Add field for function decl that corresponds to this FDE. (FRAME_BEGIN_LABEL): Allow target to override default label. (output_call_frame_info): If FDEs are linknonce, then use extra indirection for FDE encoding, output a label for each FDE, and output an empty label for each function without an FDE. (dwarf2out_begin_prologue): Set up decl field when creating an FDE. * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for decls with DECL_ONE_ONLY set, if that macro is defined. (make_decl_one_only): Don't use DECL_COMMON if we're compiling for a SUPPORTS_ONE_ONLY target. * config/darwin-protos.h (darwin_unique_section): Declare. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_make_decl_one_only): Likewise. * config/darwin.c (machopic_finish): Get rid of tweak that eliminate stubs for symbols that are defined. (darwin_encode_section_info): Don't treat weak functions as defined. (darwin_make_decl_one_only): Define. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_unique_section): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_asm_output_dwarf_delta): Difference between two labels is local only if both labels are local. * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. (ASM_MAKE_LABEL_LINKONCE): Likewise. (TARGET_SUPPORTS_HIDDEN): Likewise. (TARGET_USES_WEAK_UNWIND_INFO): Likewise. (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. (FRAME_BEGIN_LABEL): Likewise. (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. (ASM_DECLARE_FUNCTION_NAME): Likewise. (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. (TARGET_ASM_UNIQUE_SECTION): Define. (EH_FRAME_SECTION_NAME): Define. (EH_FRAME_SECTION_ATTR): Likewise. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (TARGET_ASM_NAMED_SECTION): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, TARGET_ASM_EMIT_UNWIND_LABEL. * cp/decl2.c (maybe_make_one_only): Look at TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether to make an explicit instantiation weak. * cp/method.c (use_thunk): Make sure we call comdat_linkage when appropriate. * cp/pt.c (do_type_instantiation): On systems where weak symbols don't go in a static archive's TOC, explicit instantiation of a class must imply *explicit* instantiation of its memeber. From-SVN: r79394
2004-03-12 18:09:03 +01:00
A C expression that evaluates to true if the target's linker expects
that weak symbols do not appear in a static archive's table of contents.
The default is @code{0}.
Leaving weak symbols out of an archive's table of contents means that,
if a symbol will only have a definition in one translation unit and
will have undefined references from other translation units, that
symbol should not be weak. Defining this macro to be nonzero will
thus have the effect that certain symbols that would normally be weak
(explicit template instantiations, and vtables for polymorphic classes
with noninline key methods) will instead be nonweak.
The C++ ABI requires this macro to be zero. Define this macro for
targets where full C++ ABI compliance is impossible and where linker
restrictions require weak symbols to be left out of a static archive's
table of contents.
Enabled linkonce support for Darwin. * target.h (struct gcc_target): New target hook, unwind_label. * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. * output.h (default_emit_unwind_label): New function. * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. (TARGET_USES_WEAK_UNWIND_INFO): New target macro. (TARGET_SUPPORTS_HIDDEN): New target macro. * dwarf2out.c (struct dw_fde_struct): Add field for function decl that corresponds to this FDE. (FRAME_BEGIN_LABEL): Allow target to override default label. (output_call_frame_info): If FDEs are linknonce, then use extra indirection for FDE encoding, output a label for each FDE, and output an empty label for each function without an FDE. (dwarf2out_begin_prologue): Set up decl field when creating an FDE. * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for decls with DECL_ONE_ONLY set, if that macro is defined. (make_decl_one_only): Don't use DECL_COMMON if we're compiling for a SUPPORTS_ONE_ONLY target. * config/darwin-protos.h (darwin_unique_section): Declare. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_make_decl_one_only): Likewise. * config/darwin.c (machopic_finish): Get rid of tweak that eliminate stubs for symbols that are defined. (darwin_encode_section_info): Don't treat weak functions as defined. (darwin_make_decl_one_only): Define. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_unique_section): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_asm_output_dwarf_delta): Difference between two labels is local only if both labels are local. * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. (ASM_MAKE_LABEL_LINKONCE): Likewise. (TARGET_SUPPORTS_HIDDEN): Likewise. (TARGET_USES_WEAK_UNWIND_INFO): Likewise. (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. (FRAME_BEGIN_LABEL): Likewise. (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. (ASM_DECLARE_FUNCTION_NAME): Likewise. (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. (TARGET_ASM_UNIQUE_SECTION): Define. (EH_FRAME_SECTION_NAME): Define. (EH_FRAME_SECTION_ATTR): Likewise. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (TARGET_ASM_NAMED_SECTION): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, TARGET_ASM_EMIT_UNWIND_LABEL. * cp/decl2.c (maybe_make_one_only): Look at TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether to make an explicit instantiation weak. * cp/method.c (use_thunk): Make sure we call comdat_linkage when appropriate. * cp/pt.c (do_type_instantiation): On systems where weak symbols don't go in a static archive's TOC, explicit instantiation of a class must imply *explicit* instantiation of its memeber. From-SVN: r79394
2004-03-12 18:09:03 +01:00
@end defmac
@defmac ASM_OUTPUT_EXTERNAL (@var{stream}, @var{decl}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} any text necessary for declaring the name of an external
symbol named @var{name} which is referenced in this compilation but
not defined. The value of @var{decl} is the tree node for the
declaration.
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} void TARGET_ASM_EXTERNAL_LIBCALL (rtx @var{symref})
This target hook is a function to output to @var{asm_out_file} an assembler
1996-09-25 01:21:45 +02:00
pseudo-op to declare a library function name external. The name of the
library function is given by @var{symref}, which is a @code{symbol_ref}.
@end deftypefn
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_MARK_DECL_PRESERVED (const char *@var{symbol})
This target hook is a function to output to @var{asm_out_file} an assembler
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
directive to annotate @var{symbol} as used. The Darwin target uses the
.no_dead_code_strip directive.
@end deftypefn
@defmac ASM_OUTPUT_LABELREF (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement (sans semicolon) to output to the stdio stream
@var{stream} a reference in assembler syntax to a label named
@var{name}. This should add @samp{_} to the front of the name, if that
is customary on your operating system, as it is in most Berkeley Unix
systems. This macro is used in @code{assemble_name}.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypefn {Target Hook} tree TARGET_MANGLE_ASSEMBLER_NAME (const char *@var{name})
Given a symbol @var{name}, perform same mangling as @code{varasm.c}'s @code{assemble_name}, but in memory rather than to a file stream, returning result as an @code{IDENTIFIER_NODE}. Required for correct LTO symtabs. The default implementation calls the @code{TARGET_STRIP_NAME_ENCODING} hook and then prepends the @code{USER_LABEL_PREFIX}, if any.
@end deftypefn
@defmac ASM_OUTPUT_SYMBOL_REF (@var{stream}, @var{sym})
A C statement (sans semicolon) to output a reference to
@code{SYMBOL_REF} @var{sym}. If not defined, @code{assemble_name}
will be used to output the name of the symbol. This macro may be used
to modify the way a symbol is referenced depending on information
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
encoded by @code{TARGET_ENCODE_SECTION_INFO}.
@end defmac
@defmac ASM_OUTPUT_LABEL_REF (@var{stream}, @var{buf})
A C statement (sans semicolon) to output a reference to @var{buf}, the
result of @code{ASM_GENERATE_INTERNAL_LABEL}. If not defined,
@code{assemble_name} will be used to output the name of the symbol.
This macro is not used by @code{output_asm_label}, or the @code{%l}
specifier that calls it; the intention is that this macro should be set
when it is necessary to output a label differently when its address is
being taken.
@end defmac
@deftypefn {Target Hook} void TARGET_ASM_INTERNAL_LABEL (FILE *@var{stream}, const char *@var{prefix}, unsigned long @var{labelno})
A function to output to the stdio stream @var{stream} a label whose
name is made from the string @var{prefix} and the number @var{labelno}.
1996-09-25 01:21:45 +02:00
It is absolutely essential that these labels be distinct from the labels
used for user-level functions and variables. Otherwise, certain programs
will have name conflicts with internal labels.
It is desirable to exclude internal labels from the symbol table of the
object file. Most assemblers have a naming convention for labels that
should be excluded; on many systems, the letter @samp{L} at the
beginning of a label has this effect. You should find out what
convention your system uses, and follow it.
The default version of this function utilizes @code{ASM_GENERATE_INTERNAL_LABEL}.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_DEBUG_LABEL (@var{stream}, @var{prefix}, @var{num})
A C statement to output to the stdio stream @var{stream} a debug info
label whose name is made from the string @var{prefix} and the number
@var{num}. This is useful for VLIW targets, where debug info labels
may need to be treated differently than branch target labels. On some
systems, branch target labels must be at the beginning of instruction
bundles, but debug info labels can occur in the middle of instruction
bundles.
If this macro is not defined, then @code{(*targetm.asm_out.internal_label)} will be
used.
@end defmac
@defmac ASM_GENERATE_INTERNAL_LABEL (@var{string}, @var{prefix}, @var{num})
1996-09-25 01:21:45 +02:00
A C statement to store into the string @var{string} a label whose name
is made from the string @var{prefix} and the number @var{num}.
This string, when output subsequently by @code{assemble_name}, should
produce the output that @code{(*targetm.asm_out.internal_label)} would produce
1996-09-25 01:21:45 +02:00
with the same @var{prefix} and @var{num}.
If the string begins with @samp{*}, then @code{assemble_name} will
output the rest of the string unchanged. It is often convenient for
@code{ASM_GENERATE_INTERNAL_LABEL} to use @samp{*} in this way. If the
string doesn't start with @samp{*}, then @code{ASM_OUTPUT_LABELREF} gets
to output the string, and may change it. (Of course,
@code{ASM_OUTPUT_LABELREF} is also part of your machine description, so
you should know what it does on your machine.)
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_FORMAT_PRIVATE_NAME (@var{outvar}, @var{name}, @var{number})
1996-09-25 01:21:45 +02:00
A C expression to assign to @var{outvar} (which is a variable of type
@code{char *}) a newly allocated string made from the string
@var{name} and the number @var{number}, with some suitable punctuation
added. Use @code{alloca} to get space for the string.
The string will be used as an argument to @code{ASM_OUTPUT_LABELREF} to
produce an assembler label for an internal static variable whose name is
@var{name}. Therefore, the string must be such as to result in valid
assembler code. The argument @var{number} is different each time this
macro is executed; it prevents conflicts between similarly-named
internal static variables in different scopes.
Ideally this string should not be a valid C identifier, to prevent any
conflict with the user's own symbols. Most assemblers allow periods
or percent signs in assembler symbols; putting at least one of these
between the name and the number will suffice.
If this macro is not defined, a default definition will be provided
which is correct for most systems.
@end defmac
@defmac ASM_OUTPUT_DEF (@var{stream}, @var{name}, @var{value})
1996-09-25 01:21:45 +02:00
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the symbol @var{name} to have the value @var{value}.
@findex SET_ASM_OP
If @code{SET_ASM_OP} is defined, a default definition is provided which is
1996-09-25 01:21:45 +02:00
correct for most systems.
@end defmac
@defmac ASM_OUTPUT_DEF_FROM_DECLS (@var{stream}, @var{decl_of_name}, @var{decl_of_value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the symbol whose tree node is @var{decl_of_name}
to have the value of the tree node @var{decl_of_value}. This macro will
be used in preference to @samp{ASM_OUTPUT_DEF} if it is defined and if
the tree nodes are available.
@findex SET_ASM_OP
If @code{SET_ASM_OP} is defined, a default definition is provided which is
1997-12-07 01:31:01 +01:00
correct for most systems.
@end defmac
1997-12-07 01:31:01 +01:00
@defmac TARGET_DEFERRED_OUTPUT_DEFS (@var{decl_of_name}, @var{decl_of_value})
A C statement that evaluates to true if the assembler code which defines
(equates) the symbol whose tree node is @var{decl_of_name} to have the value
of the tree node @var{decl_of_value} should be emitted near the end of the
current compilation unit. The default is to not defer output of defines.
This macro affects defines output by @samp{ASM_OUTPUT_DEF} and
@samp{ASM_OUTPUT_DEF_FROM_DECLS}.
@end defmac
@defmac ASM_OUTPUT_WEAK_ALIAS (@var{stream}, @var{name}, @var{value})
A C statement to output to the stdio stream @var{stream} assembler code
which defines (equates) the weak symbol @var{name} to have the value
@var{value}. If @var{value} is @code{NULL}, it defines @var{name} as
an undefined weak symbol.
Define this macro if the target only supports weak aliases; define
@code{ASM_OUTPUT_DEF} instead if possible.
@end defmac
@defmac OBJC_GEN_METHOD_LABEL (@var{buf}, @var{is_inst}, @var{class_name}, @var{cat_name}, @var{sel_name})
1996-09-25 01:21:45 +02:00
Define this macro to override the default assembler names used for
Objective-C methods.
1996-09-25 01:21:45 +02:00
The default name is a unique method number followed by the name of the
class (e.g.@: @samp{_1_Foo}). For methods in categories, the name of
the category is also included in the assembler name (e.g.@:
@samp{_1_Foo_Bar}).
These names are safe on most systems, but make debugging difficult since
the method's selector is not present in the name. Therefore, particular
systems define other ways of computing names.
@var{buf} is an expression of type @code{char *} which gives you a
buffer in which to store the name; its length is as long as
@var{class_name}, @var{cat_name} and @var{sel_name} put together, plus
50 characters extra.
The argument @var{is_inst} specifies whether the method is an instance
method or a class method; @var{class_name} is the name of the class;
@var{cat_name} is the name of the category (or @code{NULL} if the method is not
1996-09-25 01:21:45 +02:00
in a category); and @var{sel_name} is the name of the selector.
On systems where the assembler can handle quoted names, you can use this
macro to provide more human-readable names.
@end defmac
1996-09-25 01:21:45 +02:00
@node Initialization
@subsection How Initialization Functions Are Handled
@cindex initialization routines
@cindex termination routines
@cindex constructors, output of
@cindex destructors, output of
The compiled code for certain languages includes @dfn{constructors}
(also called @dfn{initialization routines})---functions to initialize
data in the program when the program is started. These functions need
to be called before the program is ``started''---that is to say, before
@code{main} is called.
Compiling some languages generates @dfn{destructors} (also called
@dfn{termination routines}) that should be called when the program
terminates.
To make the initialization and termination functions work, the compiler
must output something in the assembler code to cause those functions to
be called at the appropriate time. When you port the compiler to a new
system, you need to specify how to do this.
There are two major ways that GCC currently supports the execution of
initialization and termination functions. Each way has two variants.
Much of the structure is common to all four variations.
@findex __CTOR_LIST__
@findex __DTOR_LIST__
The linker must build two lists of these functions---a list of
initialization functions, called @code{__CTOR_LIST__}, and a list of
termination functions, called @code{__DTOR_LIST__}.
Each list always begins with an ignored function pointer (which may hold
0, @minus{}1, or a count of the function pointers after it, depending on
the environment). This is followed by a series of zero or more function
pointers to constructors (or destructors), followed by a function
pointer containing zero.
Depending on the operating system and its executable file format, either
@file{crtstuff.c} or @file{libgcc2.c} traverses these lists at startup
time and exit time. Constructors are called in reverse order of the
list; destructors in forward order.
The best way to handle static constructors works only for object file
formats which provide arbitrarily-named sections. A section is set
aside for a list of constructors, and another for a list of destructors.
Traditionally these are called @samp{.ctors} and @samp{.dtors}. Each
object file that defines an initialization function also puts a word in
the constructor section to point to that function. The linker
accumulates all these words into one contiguous @samp{.ctors} section.
Termination functions are handled similarly.
This method will be chosen as the default by @file{target-def.h} if
@code{TARGET_ASM_NAMED_SECTION} is defined. A target that does not
support arbitrary sections, but does support special designated
constructor and destructor sections may define @code{CTORS_SECTION_ASM_OP}
and @code{DTORS_SECTION_ASM_OP} to achieve the same effect.
1996-09-25 01:21:45 +02:00
When arbitrary sections are available, there are two variants, depending
upon how the code in @file{crtstuff.c} is called. On systems that
support a @dfn{.init} section which is executed at program startup,
1996-09-25 01:21:45 +02:00
parts of @file{crtstuff.c} are compiled into that section. The
program is linked by the @command{gcc} driver like this:
1996-09-25 01:21:45 +02:00
@smallexample
ld -o @var{output_file} crti.o crtbegin.o @dots{} -lgcc crtend.o crtn.o
@end smallexample
1996-09-25 01:21:45 +02:00
The prologue of a function (@code{__init}) appears in the @code{.init}
section of @file{crti.o}; the epilogue appears in @file{crtn.o}. Likewise
for the function @code{__fini} in the @dfn{.fini} section. Normally these
files are provided by the operating system or by the GNU C library, but
are provided by GCC for a few targets.
The objects @file{crtbegin.o} and @file{crtend.o} are (for most targets)
compiled from @file{crtstuff.c}. They contain, among other things, code
fragments within the @code{.init} and @code{.fini} sections that branch
to routines in the @code{.text} section. The linker will pull all parts
of a section together, which results in a complete @code{__init} function
that invokes the routines we need at startup.
1996-09-25 01:21:45 +02:00
To use this variant, you must define the @code{INIT_SECTION_ASM_OP}
macro properly.
If no init section is available, when GCC compiles any function called
@code{main} (or more accurately, any function designated as a program
entry point by the language front end calling @code{expand_main_function}),
it inserts a procedure call to @code{__main} as the first executable code
after the function prologue. The @code{__main} function is defined
in @file{libgcc2.c} and runs the global constructors.
1996-09-25 01:21:45 +02:00
In file formats that don't support arbitrary sections, there are again
two variants. In the simplest variant, the GNU linker (GNU @code{ld})
and an `a.out' format must be used. In this case,
@code{TARGET_ASM_CONSTRUCTOR} is defined to produce a @code{.stabs}
1996-09-25 01:21:45 +02:00
entry of type @samp{N_SETT}, referencing the name @code{__CTOR_LIST__},
and with the address of the void function containing the initialization
code as its value. The GNU linker recognizes this as a request to add
the value to a @dfn{set}; the values are accumulated, and are eventually
1996-09-25 01:21:45 +02:00
placed in the executable as a vector in the format described above, with
a leading (ignored) count and a trailing zero element.
@code{TARGET_ASM_DESTRUCTOR} is handled similarly. Since no init
1996-09-25 01:21:45 +02:00
section is available, the absence of @code{INIT_SECTION_ASM_OP} causes
the compilation of @code{main} to call @code{__main} as above, starting
the initialization process.
The last variant uses neither arbitrary sections nor the GNU linker.
This is preferable when you want to do dynamic linking and when using
file formats which the GNU linker does not support, such as `ECOFF'@. In
this case, @code{TARGET_HAVE_CTORS_DTORS} is false, initialization and
termination functions are recognized simply by their names. This requires
an extra program in the linkage step, called @command{collect2}. This program
pretends to be the linker, for use with GCC; it does its job by running
the ordinary linker, but also arranges to include the vectors of
initialization and termination functions. These functions are called
via @code{__main} as described above. In order to use this method,
@code{use_collect2} must be defined in the target in @file{config.gcc}.
1996-09-25 01:21:45 +02:00
@ifinfo
The following section describes the specific macros that control and
customize the handling of initialization and termination functions.
@end ifinfo
@node Macros for Initialization
@subsection Macros Controlling Initialization Routines
Here are the macros that control how the compiler handles initialization
and termination functions:
@defmac INIT_SECTION_ASM_OP
If defined, a C string constant, including spacing, for the assembler
operation to identify the following data as initialization code. If not
defined, GCC will assume such a section does not exist. When you are
using special sections for initialization and termination functions, this
macro also controls how @file{crtstuff.c} and @file{libgcc2.c} arrange to
run the initialization functions.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac HAS_INIT_SECTION
1996-09-25 01:21:45 +02:00
If defined, @code{main} will not call @code{__main} as described above.
This macro should be defined for systems that control start-up code
on a symbol-by-symbol basis, such as OSF/1, and should not
be defined explicitly for systems that support @code{INIT_SECTION_ASM_OP}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LD_INIT_SWITCH
1996-09-25 01:21:45 +02:00
If defined, a C string constant for a switch that tells the linker that
the following symbol is an initialization routine.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LD_FINI_SWITCH
1996-09-25 01:21:45 +02:00
If defined, a C string constant for a switch that tells the linker that
the following symbol is a finalization routine.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac COLLECT_SHARED_INIT_FUNC (@var{stream}, @var{func})
If defined, a C statement that will write a function that can be
automatically called when a shared library is loaded. The function
should call @var{func}, which takes no arguments. If not defined, and
the object format requires an explicit initialization function, then a
function called @code{_GLOBAL__DI} will be generated.
This function and the following one are used by collect2 when linking a
shared library that needs constructors or destructors, or has DWARF2
exception tables embedded in the code.
@end defmac
@defmac COLLECT_SHARED_FINI_FUNC (@var{stream}, @var{func})
If defined, a C statement that will write a function that can be
automatically called when a shared library is unloaded. The function
should call @var{func}, which takes no arguments. If not defined, and
the object format requires an explicit finalization function, then a
function called @code{_GLOBAL__DD} will be generated.
@end defmac
@defmac INVOKE__main
1996-09-25 01:21:45 +02:00
If defined, @code{main} will call @code{__main} despite the presence of
@code{INIT_SECTION_ASM_OP}. This macro should be defined for systems
where the init section is not actually run automatically, but is still
useful for collecting the lists of constructors and destructors.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SUPPORTS_INIT_PRIORITY
If nonzero, the C++ @code{init_priority} attribute is supported and the
compiler should emit instructions to control the order of initialization
of objects. If zero, the compiler will issue an error message upon
encountering an @code{init_priority} attribute.
@end defmac
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypevr {Target Hook} bool TARGET_HAVE_CTORS_DTORS
This value is true if the target supports some ``native'' method of
collecting constructors and destructors to be run at startup and exit.
It is false if we must use @command{collect2}.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
@deftypefn {Target Hook} void TARGET_ASM_CONSTRUCTOR (rtx @var{symbol}, int @var{priority})
If defined, a function that outputs assembler code to arrange to call
the function referenced by @var{symbol} at initialization time.
Assume that @var{symbol} is a @code{SYMBOL_REF} for a function taking
no arguments and with no return value. If the target supports initialization
priorities, @var{priority} is a value between 0 and @code{MAX_INIT_PRIORITY};
otherwise it must be @code{DEFAULT_INIT_PRIORITY}.
If this macro is not defined by the target, a suitable default will
be chosen if (1) the target supports arbitrary section names, (2) the
target defines @code{CTORS_SECTION_ASM_OP}, or (3) @code{USE_COLLECT2}
is not defined.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_DESTRUCTOR (rtx @var{symbol}, int @var{priority})
This is like @code{TARGET_ASM_CONSTRUCTOR} but used for termination
1996-09-25 01:21:45 +02:00
functions rather than initialization functions.
@end deftypefn
If @code{TARGET_HAVE_CTORS_DTORS} is true, the initialization routine
generated for the generated object file will have static linkage.
1996-09-25 01:21:45 +02:00
If your system uses @command{collect2} as the means of processing
constructors, then that program normally uses @command{nm} to scan
an object file for constructor functions to be called.
On certain kinds of systems, you can define this macro to make
@command{collect2} work faster (and, in some cases, make it work at all):
1996-09-25 01:21:45 +02:00
@defmac OBJECT_FORMAT_COFF
1996-09-25 01:21:45 +02:00
Define this macro if the system uses COFF (Common Object File Format)
object files, so that @command{collect2} can assume this format and scan
1996-09-25 01:21:45 +02:00
object files directly for dynamic constructor/destructor functions.
This macro is effective only in a native compiler; @command{collect2} as
part of a cross compiler always uses @command{nm} for the target machine.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac REAL_NM_FILE_NAME
1996-09-25 01:21:45 +02:00
Define this macro as a C string constant containing the file name to use
to execute @command{nm}. The default is to search the path normally for
@command{nm}.
@end defmac
@defmac NM_FLAGS
@command{collect2} calls @command{nm} to scan object files for static
constructors and destructors and LTO info. By default, @option{-n} is
passed. Define @code{NM_FLAGS} to a C string constant if other options
are needed to get the same output format as GNU @command{nm -n}
produces.
@end defmac
1996-09-25 01:21:45 +02:00
If your system supports shared libraries and has a program to list the
dynamic dependencies of a given library or executable, you can define
these macros to enable support for running initialization and
termination functions in shared libraries:
@defmac LDD_SUFFIX
Define this macro to a C string constant containing the name of the program
which lists dynamic dependencies, like @command{ldd} under SunOS 4.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PARSE_LDD_OUTPUT (@var{ptr})
1996-09-25 01:21:45 +02:00
Define this macro to be C code that extracts filenames from the output
of the program denoted by @code{LDD_SUFFIX}. @var{ptr} is a variable
1996-09-25 01:21:45 +02:00
of type @code{char *} that points to the beginning of a line of output
from @code{LDD_SUFFIX}. If the line lists a dynamic dependency, the
code must advance @var{ptr} to the beginning of the filename on that
line. Otherwise, it must set @var{ptr} to @code{NULL}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SHLIB_SUFFIX
Define this macro to a C string constant containing the default shared
library extension of the target (e.g., @samp{".so"}). @command{collect2}
strips version information after this suffix when generating global
constructor and destructor names. This define is only needed on targets
that use @command{collect2} to process constructors and destructors.
@end defmac
1996-09-25 01:21:45 +02:00
@node Instruction Output
@subsection Output of Assembler Instructions
@c prevent bad page break with this line
This describes assembler instruction output.
@defmac REGISTER_NAMES
1996-09-25 01:21:45 +02:00
A C initializer containing the assembler's names for the machine
registers, each one as a C string constant. This is what translates
register numbers in the compiler into assembler language.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ADDITIONAL_REGISTER_NAMES
1996-09-25 01:21:45 +02:00
If defined, a C initializer for an array of structures containing a name
and a register number. This macro defines additional names for hard
registers, thus allowing the @code{asm} option in declarations to refer
to registers using alternate names.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac OVERLAPPING_REGISTER_NAMES
If defined, a C initializer for an array of structures containing a
name, a register number and a count of the number of consecutive
machine registers the name overlaps. This macro defines additional
names for hard registers, thus allowing the @code{asm} option in
declarations to refer to registers using alternate names. Unlike
@code{ADDITIONAL_REGISTER_NAMES}, this macro should be used when the
register name implies multiple underlying registers.
This macro should be used when it is important that a clobber in an
@code{asm} statement clobbers all the underlying values implied by the
register name. For example, on ARM, clobbering the double-precision
VFP register ``d0'' implies clobbering both single-precision registers
``s0'' and ``s1''.
@end defmac
@defmac ASM_OUTPUT_OPCODE (@var{stream}, @var{ptr})
1996-09-25 01:21:45 +02:00
Define this macro if you are using an unusual assembler that
requires different names for the machine instructions.
The definition is a C statement or statements which output an
assembler instruction opcode to the stdio stream @var{stream}. The
macro-operand @var{ptr} is a variable of type @code{char *} which
points to the opcode name in its ``internal'' form---the form that is
written in the machine description. The definition should output the
opcode name to @var{stream}, performing any translation you desire, and
increment the variable @var{ptr} to point at the end of the opcode
so that it will not be output twice.
In fact, your macro definition may process less than the entire opcode
name, or more than the opcode name; but if you want to process text
that includes @samp{%}-sequences to substitute operands, you must take
care of the substitution yourself. Just be sure to increment
@var{ptr} over whatever text should not be output normally.
@findex recog_data.operand
1996-09-25 01:21:45 +02:00
If you need to look at the operand values, they can be found as the
elements of @code{recog_data.operand}.
1996-09-25 01:21:45 +02:00
If the macro definition does nothing, the instruction is output
in the usual way.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FINAL_PRESCAN_INSN (@var{insn}, @var{opvec}, @var{noperands})
1996-09-25 01:21:45 +02:00
If defined, a C statement to be executed just prior to the output of
assembler code for @var{insn}, to modify the extracted operands so
they will be output differently.
Here the argument @var{opvec} is the vector containing the operands
extracted from @var{insn}, and @var{noperands} is the number of
elements of the vector which contain meaningful data for this insn.
The contents of this vector are what will be used to convert the insn
template into assembler code, so you can change the assembler output
by changing the contents of the vector.
This macro is useful when various assembler syntaxes share a single
file of instruction patterns; by defining this macro differently, you
can cause a large class of instructions to be output differently (such
as with rearranged operands). Naturally, variations in assembler
syntax affecting individual insn patterns ought to be handled by
writing conditional output routines in those patterns.
If this macro is not defined, it is equivalent to a null statement.
@end defmac
1996-09-25 01:21:45 +02:00
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} void TARGET_ASM_FINAL_POSTSCAN_INSN (FILE *@var{file}, rtx_insn *@var{insn}, rtx *@var{opvec}, int @var{noperands})
If defined, this target hook is a function which is executed just after the
output of assembler code for @var{insn}, to change the mode of the assembler
if necessary.
Here the argument @var{opvec} is the vector containing the operands
extracted from @var{insn}, and @var{noperands} is the number of
elements of the vector which contain meaningful data for this insn.
The contents of this vector are what was used to convert the insn
template into assembler code, so you can change the assembler mode
by checking the contents of the vector.
@end deftypefn
@defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
1996-09-25 01:21:45 +02:00
A C compound statement to output to stdio stream @var{stream} the
assembler syntax for an instruction operand @var{x}. @var{x} is an
RTL expression.
@var{code} is a value that can be used to specify one of several ways
of printing the operand. It is used when identical operands must be
printed differently depending on the context. @var{code} comes from
the @samp{%} specification that was used to request printing of the
operand. If the specification was just @samp{%@var{digit}} then
@var{code} is 0; if the specification was @samp{%@var{ltr}
@var{digit}} then @var{code} is the ASCII code for @var{ltr}.
@findex reg_names
If @var{x} is a register, this macro should print the register's name.
The names can be found in an array @code{reg_names} whose type is
@code{char *[]}. @code{reg_names} is initialized from
@code{REGISTER_NAMES}.
When the machine description has a specification @samp{%@var{punct}}
(a @samp{%} followed by a punctuation character), this macro is called
with a null pointer for @var{x} and the punctuation character for
@var{code}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PRINT_OPERAND_PUNCT_VALID_P (@var{code})
1996-09-25 01:21:45 +02:00
A C expression which evaluates to true if @var{code} is a valid
punctuation character for use in the @code{PRINT_OPERAND} macro. If
@code{PRINT_OPERAND_PUNCT_VALID_P} is not defined, it means that no
punctuation characters (except for the standard one, @samp{%}) are used
in this way.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PRINT_OPERAND_ADDRESS (@var{stream}, @var{x})
1996-09-25 01:21:45 +02:00
A C compound statement to output to stdio stream @var{stream} the
assembler syntax for an instruction operand that is a memory reference
whose address is @var{x}. @var{x} is an RTL expression.
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
@cindex @code{TARGET_ENCODE_SECTION_INFO} usage
1996-09-25 01:21:45 +02:00
On some machines, the syntax for a symbolic address depends on the
system.h (ENCODE_SECTION_INFO): Poison it. * system.h (ENCODE_SECTION_INFO): Poison it. * target-def.h (TARGET_ENCODE_SECTION_INFO): New. * target.h (encode_section_info): New. * varasm.c (make_decl_rtl, output_constant_def): Use it. * hooks.c (hook_tree_int_void): New. * hooks.h: Declare it. * config/darwin.h, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/alpha/alpha.h, config/arm/pe.h, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.h, config/c4x/c4x-protos.h, config/c4x/c4x.c, config/c4x/c4x.h, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.h, config/i386/cygwin.h, config/i386/win32.h, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/ia64/ia64.h, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m32r/m32r.h, config/m68hc11/m68hc11-protos.h, config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.h, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mmix/mmix.h, config/rs6000/rs6000-protos.h, config/rs6000/sysv4.h, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/stormy16/stormy16.h: Replace ENCODE_SECTION_INFO with TARGET_ENCODE_SECTION_INFO referencing existing function. Make function static. * config/a29k/a29k.c, config/a29k/a29k.h, config/arc/arc.c, config/arc/arc.h, config/arm/arm.c, config/arm/arm.h, config/h8300/h8300.c, config/h8300/h8300.h, config/i370/i370.c, config/i370/i370.h, config/i386/i386-interix.h, config/i386/i386.c, config/i386/i386.h, config/i386/interix.c, config/m88k/m88k.c, config/m88k/m88k.h, config/mips/mips.c, config/mips/mips.h, config/ns32k/ns32k.c, config/ns32k/ns32k.h, config/pa/pa.c, config/pa/pa.h, config/romp/romp.c, config/romp/romp.h, config/rs6000/linux64.h, config/rs6000/xcoff.h, config/s390/s390.c, config/s390/s390.h, config/sh/sh.c, config/sh/sh.h, config/sparc/sparc.c, config/sparc/sparc.h, config/v850/v850.c, config/v850/v850.h, config/vax/vax.c, config/vax/vms.h, config/xtensa/xtensa.c, config/xtensa/xtensa.h: Move ENCODE_SECTION_INFO to out-of-line function and add TARGET_ENCODE_SECTION_INFO. * config/darwin.h (ASM_DECLARE_FUNCTION_NAME): Use hook, not macro. (ASM_DECLARE_OBJECT_NAME, ASM_OUTPUT_ALIGNED_DECL_LOCAL): Likewise. * config/arm/pe.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS): Rename from SUBTARGET_* (switch_to_section): Replace in_rdata case with in_readonly_data. * config/h8300/h8300.c (h8300_encode_label): Make static. * config/h8300/h8300-protos.h: Update. * config/rs6000/rs6000.c (rs6000_elf_encode_section_info): Rename from rs6000_encode_section_info; make static. (rs6000_xcoff_encode_section_info): New. * config/v850/v850.c (v850_encode_data_area): Make static. * config/v850/v850-protos.h: Update. * config/vax/vax.c: Include flags.h. (vms_select_section): Fix typo. * doc/tm.texi (TARGET_ENCODE_SECTION_INFO): Update from previous ENCODE_SECTION_INFO docs. From-SVN: r53606
2002-05-19 07:23:27 +02:00
section that the address refers to. On these machines, define the hook
@code{TARGET_ENCODE_SECTION_INFO} to store the information into the
@code{symbol_ref}, and then check for it here. @xref{Assembler
Format}.
@end defmac
1996-09-25 01:21:45 +02:00
@findex dbr_sequence_length
@defmac DBR_OUTPUT_SEQEND (@var{file})
1996-09-25 01:21:45 +02:00
A C statement, to be executed after all slot-filler instructions have
been output. If necessary, call @code{dbr_sequence_length} to
determine the number of slots filled in a sequence (zero if not
currently outputting a sequence), to decide how many no-ops to output,
or whatever.
Don't define this macro if it has nothing to do, but it is helpful in
reading assembly output if the extent of the delay sequence is made
explicit (e.g.@: with white space).
@end defmac
1996-09-25 01:21:45 +02:00
@findex final_sequence
Note that output routines for instructions with delay slots must be
prepared to deal with not being output as part of a sequence
(i.e.@: when the scheduling pass is not run, or when no slot fillers could be
1996-09-25 01:21:45 +02:00
found.) The variable @code{final_sequence} is null when not
processing a sequence, otherwise it contains the @code{sequence} rtx
being output.
@findex asm_fprintf
@defmac REGISTER_PREFIX
@defmacx LOCAL_LABEL_PREFIX
@defmacx USER_LABEL_PREFIX
@defmacx IMMEDIATE_PREFIX
1996-09-25 01:21:45 +02:00
If defined, C string expressions to be used for the @samp{%R}, @samp{%L},
@samp{%U}, and @samp{%I} options of @code{asm_fprintf} (see
@file{final.c}). These are useful when a single @file{md} file must
support multiple assembler formats. In that case, the various @file{tm.h}
files can define these macros differently.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_FPRINTF_EXTENSIONS (@var{file}, @var{argptr}, @var{format})
If defined this macro should expand to a series of @code{case}
statements which will be parsed inside the @code{switch} statement of
the @code{asm_fprintf} function. This allows targets to define extra
printf formats which may useful when generating their assembler
statements. Note that uppercase letters are reserved for future
generic extensions to asm_fprintf, and so are not available to target
specific code. The output file is given by the parameter @var{file}.
The varargs input pointer is @var{argptr} and the rest of the format
string, starting the character after the one that is being switched
upon, is pointed to by @var{format}.
@end defmac
@defmac ASSEMBLER_DIALECT
1996-09-25 01:21:45 +02:00
If your target supports multiple dialects of assembler language (such as
different opcodes), define this macro as a C expression that gives the
numeric index of the assembler language dialect to use, with zero as the
first variant.
If this macro is defined, you may use constructs of the form
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@smallexample
@samp{@{option0|option1|option2@dots{}@}}
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
@end smallexample
@noindent
in the output templates of patterns (@pxref{Output Template}) or in the
first argument of @code{asm_fprintf}. This construct outputs
@samp{option0}, @samp{option1}, @samp{option2}, etc., if the value of
@code{ASSEMBLER_DIALECT} is zero, one, two, etc. Any special characters
within these strings retain their usual meaning. If there are fewer
alternatives within the braces than the value of
@code{ASSEMBLER_DIALECT}, the construct outputs nothing. If it's needed
to print curly braces or @samp{|} character in assembler output directly,
@samp{%@{}, @samp{%@}} and @samp{%|} can be used.
1996-09-25 01:21:45 +02:00
If you do not define this macro, the characters @samp{@{}, @samp{|} and
@samp{@}} do not have any special meaning when used in templates or
operands to @code{asm_fprintf}.
Define the macros @code{REGISTER_PREFIX}, @code{LOCAL_LABEL_PREFIX},
@code{USER_LABEL_PREFIX} and @code{IMMEDIATE_PREFIX} if you can express
the variations in assembler language syntax with that mechanism. Define
1996-09-25 01:21:45 +02:00
@code{ASSEMBLER_DIALECT} and use the @samp{@{option0|option1@}} syntax
if the syntax variant are larger and involve such things as different
opcodes or operand order.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_REG_PUSH (@var{stream}, @var{regno})
1996-09-25 01:21:45 +02:00
A C expression to output to @var{stream} some assembler code
which will push hard register number @var{regno} onto the stack.
The code need not be optimal, since this macro is used only when
profiling.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_REG_POP (@var{stream}, @var{regno})
1996-09-25 01:21:45 +02:00
A C expression to output to @var{stream} some assembler code
which will pop hard register number @var{regno} off of the stack.
The code need not be optimal, since this macro is used only when
profiling.
@end defmac
1996-09-25 01:21:45 +02:00
@node Dispatch Tables
@subsection Output of Dispatch Tables
@c prevent bad page break with this line
This concerns dispatch tables.
@cindex dispatch table
@defmac ASM_OUTPUT_ADDR_DIFF_ELT (@var{stream}, @var{body}, @var{value}, @var{rel})
1996-09-25 01:21:45 +02:00
A C statement to output to the stdio stream @var{stream} an assembler
pseudo-instruction to generate a difference between two labels.
@var{value} and @var{rel} are the numbers of two internal labels. The
definitions of these labels are output using
@code{(*targetm.asm_out.internal_label)}, and they must be printed in the same
1996-09-25 01:21:45 +02:00
way here. For example,
@smallexample
1996-09-25 01:21:45 +02:00
fprintf (@var{stream}, "\t.word L%d-L%d\n",
@var{value}, @var{rel})
@end smallexample
1996-09-25 01:21:45 +02:00
You must provide this macro on machines where the addresses in a
dispatch table are relative to the table's own address. If defined, GCC
will also use this macro on all machines when producing PIC@.
@var{body} is the body of the @code{ADDR_DIFF_VEC}; it is provided so that the
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
mode and flags can be read.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ADDR_VEC_ELT (@var{stream}, @var{value})
1996-09-25 01:21:45 +02:00
This macro should be provided on machines where the addresses
in a dispatch table are absolute.
The definition should be a C statement to output to the stdio stream
@var{stream} an assembler pseudo-instruction to generate a reference to
a label. @var{value} is the number of an internal label whose
definition is output using @code{(*targetm.asm_out.internal_label)}.
1996-09-25 01:21:45 +02:00
For example,
@smallexample
1996-09-25 01:21:45 +02:00
fprintf (@var{stream}, "\t.word L%d\n", @var{value})
@end smallexample
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_CASE_LABEL (@var{stream}, @var{prefix}, @var{num}, @var{table})
1996-09-25 01:21:45 +02:00
Define this if the label before a jump-table needs to be output
specially. The first three arguments are the same as for
@code{(*targetm.asm_out.internal_label)}; the fourth argument is the
jump-table which follows (a @code{jump_table_data} containing an
1996-09-25 01:21:45 +02:00
@code{addr_vec} or @code{addr_diff_vec}).
This feature is used on system V to output a @code{swbeg} statement
for the table.
If this macro is not defined, these labels are output with
@code{(*targetm.asm_out.internal_label)}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_CASE_END (@var{stream}, @var{num}, @var{table})
1996-09-25 01:21:45 +02:00
Define this if something special must be output at the end of a
jump-table. The definition should be a C statement to be executed
after the assembler code for the table is written. It should write
the appropriate code to stdio stream @var{stream}. The argument
@var{table} is the jump-table insn, and @var{num} is the label-number
of the preceding label.
If this macro is not defined, nothing special is output at the end of
the jump-table.
@end defmac
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_EMIT_UNWIND_LABEL (FILE *@var{stream}, tree @var{decl}, int @var{for_eh}, int @var{empty})
This target hook emits a label at the beginning of each FDE@. It
Enabled linkonce support for Darwin. * target.h (struct gcc_target): New target hook, unwind_label. * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. * output.h (default_emit_unwind_label): New function. * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. (TARGET_USES_WEAK_UNWIND_INFO): New target macro. (TARGET_SUPPORTS_HIDDEN): New target macro. * dwarf2out.c (struct dw_fde_struct): Add field for function decl that corresponds to this FDE. (FRAME_BEGIN_LABEL): Allow target to override default label. (output_call_frame_info): If FDEs are linknonce, then use extra indirection for FDE encoding, output a label for each FDE, and output an empty label for each function without an FDE. (dwarf2out_begin_prologue): Set up decl field when creating an FDE. * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for decls with DECL_ONE_ONLY set, if that macro is defined. (make_decl_one_only): Don't use DECL_COMMON if we're compiling for a SUPPORTS_ONE_ONLY target. * config/darwin-protos.h (darwin_unique_section): Declare. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_make_decl_one_only): Likewise. * config/darwin.c (machopic_finish): Get rid of tweak that eliminate stubs for symbols that are defined. (darwin_encode_section_info): Don't treat weak functions as defined. (darwin_make_decl_one_only): Define. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_unique_section): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_asm_output_dwarf_delta): Difference between two labels is local only if both labels are local. * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. (ASM_MAKE_LABEL_LINKONCE): Likewise. (TARGET_SUPPORTS_HIDDEN): Likewise. (TARGET_USES_WEAK_UNWIND_INFO): Likewise. (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. (FRAME_BEGIN_LABEL): Likewise. (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. (ASM_DECLARE_FUNCTION_NAME): Likewise. (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. (TARGET_ASM_UNIQUE_SECTION): Define. (EH_FRAME_SECTION_NAME): Define. (EH_FRAME_SECTION_ATTR): Likewise. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (TARGET_ASM_NAMED_SECTION): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, TARGET_ASM_EMIT_UNWIND_LABEL. * cp/decl2.c (maybe_make_one_only): Look at TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether to make an explicit instantiation weak. * cp/method.c (use_thunk): Make sure we call comdat_linkage when appropriate. * cp/pt.c (do_type_instantiation): On systems where weak symbols don't go in a static archive's TOC, explicit instantiation of a class must imply *explicit* instantiation of its memeber. From-SVN: r79394
2004-03-12 18:09:03 +01:00
should be defined on targets where FDEs need special labels, and it
should write the appropriate label, for the FDE associated with the
function declaration @var{decl}, to the stdio stream @var{stream}.
The third argument, @var{for_eh}, is a boolean: true if this is for an
exception table. The fourth argument, @var{empty}, is a boolean:
true if this is a placeholder label for an omitted FDE@.
Enabled linkonce support for Darwin. * target.h (struct gcc_target): New target hook, unwind_label. * target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook. * output.h (default_emit_unwind_label): New function. * default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro. (TARGET_USES_WEAK_UNWIND_INFO): New target macro. (TARGET_SUPPORTS_HIDDEN): New target macro. * dwarf2out.c (struct dw_fde_struct): Add field for function decl that corresponds to this FDE. (FRAME_BEGIN_LABEL): Allow target to override default label. (output_call_frame_info): If FDEs are linknonce, then use extra indirection for FDE encoding, output a label for each FDE, and output an empty label for each function without an FDE. (dwarf2out_begin_prologue): Set up decl field when creating an FDE. * varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for decls with DECL_ONE_ONLY set, if that macro is defined. (make_decl_one_only): Don't use DECL_COMMON if we're compiling for a SUPPORTS_ONE_ONLY target. * config/darwin-protos.h (darwin_unique_section): Declare. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_make_decl_one_only): Likewise. * config/darwin.c (machopic_finish): Get rid of tweak that eliminate stubs for symbols that are defined. (darwin_encode_section_info): Don't treat weak functions as defined. (darwin_make_decl_one_only): Define. (darwin_asm_named_section): Likewise. (darwin_section_type_flags): Likewise. (darwin_unique_section): Likewise. (darwin_emit_unwind_label): Likewise. (darwin_non_lazy_pcrel): Likewise. (darwin_asm_output_dwarf_delta): Difference between two labels is local only if both labels are local. * config/darwin.h (MAKE_DECL_ONE_ONLY): Define. (ASM_MAKE_LABEL_LINKONCE): Likewise. (TARGET_SUPPORTS_HIDDEN): Likewise. (TARGET_USES_WEAK_UNWIND_INFO): Likewise. (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise. (FRAME_BEGIN_LABEL): Likewise. (ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect. (ASM_DECLARE_FUNCTION_NAME): Likewise. (darwin_eh_frame_section): Give __eh_frame section the coalesced flag. (TARGET_ASM_UNIQUE_SECTION): Define. (EH_FRAME_SECTION_NAME): Define. (EH_FRAME_SECTION_ATTR): Likewise. (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. (TARGET_ASM_NAMED_SECTION): Likewise. (TARGET_SECTION_TYPE_FLAGS): Likewise. * doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO, TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN, TARGET_ASM_EMIT_UNWIND_LABEL. * cp/decl2.c (maybe_make_one_only): Look at TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether to make an explicit instantiation weak. * cp/method.c (use_thunk): Make sure we call comdat_linkage when appropriate. * cp/pt.c (do_type_instantiation): On systems where weak symbols don't go in a static archive's TOC, explicit instantiation of a class must imply *explicit* instantiation of its memeber. From-SVN: r79394
2004-03-12 18:09:03 +01:00
The default is that FDEs are not given nonlocal labels.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL (FILE *@var{stream})
This target hook emits a label at the beginning of the exception table.
It should be defined on targets where it is desirable for the table
to be broken up according to function.
The default is that no label is emitted.
@end deftypefn
@deftypefn {Target Hook} void TARGET_ASM_EMIT_EXCEPT_PERSONALITY (rtx @var{personality})
If the target implements @code{TARGET_ASM_UNWIND_EMIT}, this hook may be used to emit a directive to install a personality hook into the unwind info. This hook should not be used if dwarf2 unwind info is used.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} void TARGET_ASM_UNWIND_EMIT (FILE *@var{stream}, rtx_insn *@var{insn})
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
This target hook emits assembly directives required to unwind the
given instruction. This is only used when @code{TARGET_EXCEPT_UNWIND_INFO}
returns @code{UI_TARGET}.
@end deftypefn
@deftypevr {Target Hook} bool TARGET_ASM_UNWIND_EMIT_BEFORE_INSN
True if the @code{TARGET_ASM_UNWIND_EMIT} hook should be called before the assembly for @var{insn} has been emitted, false if the hook should be called afterward.
@end deftypevr
@node Exception Region Output
1996-09-25 01:21:45 +02:00
@subsection Assembler Commands for Exception Regions
@c prevent bad page break with this line
This describes commands marking the start and the end of an exception
region.
@defmac EH_FRAME_SECTION_NAME
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections. * target-def.h (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. * Makefile.in (toplev.o): Depend on TARGET_H. (varasm.o, dbxout.o): Likewise. * c-common.c (decl_attributes): Check targetm.have_named_sections instead of ifdef ASM_OUTPUT_SECTION_NAME. * dbxout.c (dbxout_function_decl): Likewise. (dbxout_function_end): Likewise. * toplev.c (compile_file): Likewise. * varasm.c (exception_section): Likewise. * cp/decl2.c (finish_objects): Likewise. * defaults.h (EH_FRAME_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. (UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME. (UNIQUE_SECTION_P): Remove. * dwarf2out.c (SECTION_FORMAT): Remove. (ASM_OUTPUT_SECTION): Remove. (output_call_frame_info): Use named_section_flags. (output_comp_unit, dwarf2out_start_source_file): Likewise. (dwarf2out_end_source_file, dwarf2out_define): Likewise. (dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise. * varasm.c (in_eh_frame, eh_frame_section): Remove. (named_section_flags): New. (named_section): Use it and targetm.section_type_flags. (resolve_unique_section): New. (assemble_start_function): Use it. (asm_emit_uninitialised, assemble_variable): Likewise. (default_section_type_flags): New. (default_no_named_section, default_elf_asm_named_section): New. (default_coff_asm_named_section, default_pe_asm_named_section): New. * output.h: Update varasm.c decls. (SECTION_*): New flags. * crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP. (__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section. * config/elfos.h (UNIQUE_SECTION_P): Remove. * config/alpha/elf.h, config/arm/linux-elf.h: Likewise. * config/arm/pe.h, config/arm/unknown-elf.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/win32.h: Likewise. * config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise. * config/mips/elf.h, config/mips/elf64.h: Likewise. * config/mips/iris6gld.h, config/mips/mips.h: Likewise. * config/pa/pa64-hpux.h, * config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. * config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise. * config/alpha/vms.h, config/arm/coff.h: Likewise. * config/arm/conix-elf.h, config/arm/elf.h: Likewise. * config/arm/linux-elf.h, config/arm/pe.h: Likewise. * config/arm/unknown-elf.h, config/avr/avr.h: Likewise. * config/c4x/c4x.h, config/h8300/h8300.h: Likewise. * config/i386/cygwin.h, config/i386/djgpp.h: Likewise. * config/i386/i386-interix.h, config/i386/i386elf.h : Likewise. * config/i386/sco5.h, config/i386/win32.h: Likewise. * config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise. * config/mcore/mcore.h, config/mips/elf.h: Likewise. * config/mips/elf64.h, config/mips/iris6.h: Likewise. * config/mips/netbsd.h, config/mips/openbsd.h: Likewise. * config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise. * config/rs6000/xcoff.h, config/sh/sh.h: Likewise. * config/sparc/sysv4.h: Likewise. * config/nextstep.h: Error until named sections implemented. * config/a29k/a29k.c (a29k_asm_named_section): New. * config/alpha/alpha.c (SECTION_VMS_OVERLAY): New. (vms_section_type_flags, vms_asm_named_section): New. * config/arm/arm.c (arm_elf_asm_named_section): New. * config/avr/avr.c (asm_output_section_name): Remove. * config/avr/avr-protos.h: Update. * config/c4x/c4x.c (c4x_asm_named_section): New. * config/h8300/h8300.c (h8300_asm_named_section): New. * config/i386/i386.c (sco_asm_named_section): New. * config/i386/winnt.c (SECTION_PE_SHARED): New. (i386_pe_section_type_flags): New. (i386_pe_asm_named_section): New. * config/i386/i386-protos.h: Update. * config/m68k/m68k.c (m68k_coff_asm_named_section): New. * config/mcore/mcore.c (mcore_asm_named_section): New. * config/mips/mips.c (iris6_asm_named_section): New. * config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY instead of UNIQUE_SECTION_P. * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New. (xcoff_asm_named_section): New. * config/sh/sh.c (sh_asm_named_section): New. * config/sparc/sparc.c (sparc_elf_asm_named_section): New. * config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove. (EH_FRAME_SECTION_NAME): New. (EXCEPTION_SECTION): New. * config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove. (DEBUG_*_SECTION): Remove. * config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove. * config/mips/iris6.h (DEBUG_*_SECTION): Remove. (EH_FRAME_SECTION_ASM_OP): Remove. * doc/tm.texi (UNIQUE_SECTION_P): Remove. (ASM_OUTPUT_SECTION_NAME): Remove. (TARGET_ASM_NAMED_SECTION): New. (TARGET_HAVE_NAMED_SECTIONS): New. (TARGET_SECTION_TYPE_FLAGS): New. (EH_FRAME_SECTION_ASM_OP): Remove. (EH_FRAME_SECTION_NAME): New. From-SVN: r44623
2001-08-04 03:31:41 +02:00
If defined, a C string constant for the name of the section containing
exception handling frame unwind information. If not defined, GCC will
provide a default definition if the target supports named sections.
@file{crtstuff.c} uses this macro to switch to the appropriate section.
1997-09-10 20:00:28 +02:00
You should define this symbol if your target supports DWARF 2 frame
unwind information and the default definition does not work.
@end defmac
1997-09-10 20:00:28 +02:00
@defmac EH_FRAME_IN_DATA_SECTION
If defined, DWARF 2 frame unwind information will be placed in the
data section even though the target supports named sections. This
might be necessary, for instance, if the system linker does garbage
collection and sections cannot be marked as not to be collected.
Do not define this macro unless @code{TARGET_ASM_NAMED_SECTION} is
also defined.
@end defmac
@defmac EH_TABLES_CAN_BE_READ_ONLY
Define this macro to 1 if your target is such that no frame unwind
information encoding used with non-PIC code will ever require a
runtime relocation, but the linker may not support merging read-only
and read-write sections into a single read-write section.
@end defmac
@defmac MASK_RETURN_ADDR
An rtx used to mask the return address found via @code{RETURN_ADDR_RTX}, so
1996-09-25 01:21:45 +02:00
that it does not contain any extraneous set bits in it.
@end defmac
1997-09-10 20:00:28 +02:00
@defmac DWARF2_UNWIND_INFO
1997-09-10 20:00:28 +02:00
Define this macro to 0 if your target supports DWARF 2 frame unwind
information, but it does not yet work with exception handling.
Otherwise, if your target supports this information (if it defines
@code{INCOMING_RETURN_ADDR_RTX} and @code{OBJECT_FORMAT_ELF}),
GCC will provide a default definition of 1.
@end defmac
1997-09-10 20:00:28 +02:00
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypefn {Common Target Hook} {enum unwind_info_type} TARGET_EXCEPT_UNWIND_INFO (struct gcc_options *@var{opts})
This hook defines the mechanism that will be used for exception handling
by the target. If the target has ABI specified unwind tables, the hook
should return @code{UI_TARGET}. If the target is to use the
@code{setjmp}/@code{longjmp}-based exception handling scheme, the hook
should return @code{UI_SJLJ}. If the target supports DWARF 2 frame unwind
information, the hook should return @code{UI_DWARF2}.
1997-09-10 20:00:28 +02:00
A target may, if exceptions are disabled, choose to return @code{UI_NONE}.
This may end up simplifying other parts of target-specific code. The
default implementation of this hook never returns @code{UI_NONE}.
1997-09-10 20:00:28 +02:00
Note that the value returned by this hook should be constant. It should
target.def (supports_split_stack, [...]): Take gcc_options parameters. * target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-25 14:16:03 +01:00
not depend on anything except the command-line switches described by
@var{opts}. In particular, the
setting @code{UI_SJLJ} must be fixed at compiler start-up as C pre-processor
macros and builtin functions related to exception handling are set up
depending on this setting.
The default implementation of the hook first honors the
@option{--enable-sjlj-exceptions} configure option, then
target.def (supports_split_stack, [...]): Take gcc_options parameters. * target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-25 14:16:03 +01:00
@code{DWARF2_UNWIND_INFO}, and finally defaults to @code{UI_SJLJ}. If
@code{DWARF2_UNWIND_INFO} depends on command-line options, the target
must define this hook so that @var{opts} is used correctly.
@end deftypefn
target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h. * target.def (default_target_flags, handle_option, supports_split_stack, optimization_table, init_struct, except_unwind_info, unwind_tables_default, have_named_sections): Move to common/common-target.def. * target.h (enum opt_levels, struct default_options): Move to common/common-target.h. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.c. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info, default_target_handle_option, empty_optimization_table): Move to common/common-targhooks.h. * common/common-target-def.h: Include common/common-targhooks.h. (TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION defined. * common/common-target.def (handle_option, option_init_struct, option_optimization_table, default_target_flags, except_unwind_info, supports_split_stack, unwind_tables_default, have_named_sections): Move from target.def. (HOOK_PREFIX): Undefine at end of file. * common/common-target.h: Include input.h. (enum opt_levels, struct default_options): Move from target.h. * common/common-targhooks.c, common/common-targhooks.h: New. * config.gcc (target_has_targetm_common): Default to yes. (moxie*): Set target_has_targetm_common=no. (hppa*-*-*): Don't set target_has_targetm_common=yes. * doc/tm.texi: Regenerate. * Makefile.in (COMMON_TARGET_H): Add $(INPUT_H). (C_TARGET_DEF_H): Add common/common-targhooks.h. (GCC_OBJS): Remove vec.o. (OBJS): Remove hooks.o and vec.o. (OBJS-libcommon-target): Add vec.o, hooks.o and common/common-targhooks.o. (c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o, tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o, expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o, cfglayout.o, $(out_object_file), $(common_out_object_file)): Update dependencies. (common/common-targhooks.o): New. * common/config/default-common.c: Include tm.h. Add FIXME comment. * common/config/pa/pa-common.c: Include more headers. Take copyright dates from pa.c. (pa_option_optimization_table, pa_handle_option, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move from pa.c. * common/config/alpha/alpha-common.c, common/config/arm/arm-common.c, common/config/avr/avr-common.c, common/config/bfin/bfin-common.c, common/config/cris/cris-common.c, common/config/fr30/fr30-common.c, common/config/frv/frv-common.c, common/config/h8300/h8300-common.c, common/config/i386/i386-common.c, common/config/ia64/ia64-common.c, common/config/iq2000/iq2000-common.c, common/config/lm32/lm32-common.c, common/config/m32c/m32c-common.c, common/config/m32r/m32r-common.c, common/config/m68k/m68k-common.c, common/config/mcore/mcore-common.c, common/config/mep/mep-common.c, common/config/microblaze/microblaze-common.c, common/config/mips/mips-common.c, common/config/mmix/mmix-common.c, common/config/mn10300/mn10300-common.c, common/config/pdp11/pdp11-common.c, common/config/picochip/picochip-common.c, common/config/rs6000/rs6000-common.c, common/config/rx/rx-common.c, common/config/s390/s390-common.c, common/config/score/score-common.c, common/config/sh/sh-common.c, common/config/sparc/sparc-common.c, common/config/spu/spu-common.c, common/config/v850/v850-common.c, common/config/vax/vax-common.c, common/config/xstormy16/xstormy16-common.c, common/config/xtensa/xtensa-common.c: New. * config/alpha/alpha.c: Include common/common-target.h. (alpha_option_optimization_table, alpha_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c. * config/arm/arm-protos.h (arm_except_unwind_info): Declare. * config/arm/arm.c (arm_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to arm-common.c. * config/avr/avr.c (avr_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to avr-common.c. * config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h. (bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION, TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c. * config/bfin/bfin.h struct bfin_cpu): Move from bfin.c. * config/cris/cris.c (cris_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to cris-common.c. * config/fr30/fr30.c (fr30_option_optimization_table, TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move to fr30-common.c. * config/frv/frv.c (frv_option_optimization_table, MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c. * config/h8300/h8300.c (h8300_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c. * config/i386/i386-protos.h (ix86_handle_option): Declare. * config/i386/i386.c: Include common/common-target.h. (OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET, OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET, OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET, OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET, OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET, OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET, OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET, OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET, OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET, OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET, OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET, OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET, OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET, OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET, OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET, OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET, OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET, OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET, OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET, OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET, OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET, OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET, OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET, OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET, OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET, OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET, OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET, OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET, OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option, ix86_option_optimization_table, ix86_option_init_struct, ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to i386-common.c. * config/i386/t-i386 (i386.o): Update dependencies. * config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare. * config/ia64/ia64.c (ia64_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, ia64_handle_option): Move to ia64-common.c. * config/iq2000/iq2000.c (iq2000_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c. * config/lm32/lm32.c (lm32_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to lm32-common.c. * config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to m32c-common.c. * config/m32r/m32r.c (m32r_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO, m32r_handle_option): Move to m32r-common.c. (m32r_memory_move_cost): Remove comment referring to TARGET_HANDLE_OPTION. * config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option): Move to m68k-common.c. * config/mcore/mcore.c (mcore_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c. * config/mep/mep.c (mep_option_optimization_table, mep_handle_option, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS): Move to mep-common.c. * config/microblaze/microblaze.c (microblaze_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c. * config/mips/mips.c (mips_handle_option, mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to mips-common.c. * config/mmix/mmix.c (mmix_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mmix-common.c. * config/mn10300/mn10300.c (mn10300_option_optimization_table, mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c. * config/pa/pa.c: Include common/common-target.h. (pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, pa_handle_option): Move to pa-common.c. (pa_option_override): Use targetm_common.except_unwind_info. (pa_asm_output_mi_thunk, pa_function_section): Use targetm_common.have_named_sections. * config/pdp11/pdp11.c (pdp11_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, pdp11_handle_option, pdp11_option_init_struct): Move to pdp11-common.c. * config/picochip/picochip.c (picochip_option_optimization_table, TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c. * config/rs6000/rs6000.c: Include common/common-target.h. (rs6000_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct, rs6000_handle_option): Move to rs6000-common.c. * config/rs6000/t-rs6000 (rs6000.o): Update dependencies. * config/rx/rx.c (rx_handle_option, rx_option_optimization_table, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c. * config/s390/s390.c (processor_flags_table, s390_option_optimization_table, s390_option_init_struct, s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT): Move to s390-common.c. * config/s390/s390.h (processor_flags_table): Declare. * config/score/score.c (score_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS, score_handle_option): Move to score-common.c. * config/sh/sh.c (sh_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, sh_handle_option, sh_option_init_struct): Move to sh-common.c. * config/sparc/sparc.c: Include common/common-target.h. (sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c. * config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO, spu_option_init_struct): Move to spu-common.c. * config/stormy16/stormy16.c (xstorym16_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c. * config/v850/v850.c (small_memory_physical_max, v850_handle_memory_optionn v850_handle_option, v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to v850-common.c. * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to vax-common.c. * config/xtensa/xtensa.c (xtensa_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE): Move to xtensa-common.c. * cfglayout.c: Include common/common-target.h. (fixup_reorder_chain): Use targetm_common.have_named_sections. * cfgrtl.c: Include common/common-target.h. (force_nonfallthru_and_redirect, commit_one_edge_insertion): Use targetm_common.have_named_sections. * dbxout.c: Include common/common-target.h. (dbxout_function_end): Use targetm_common.have_named_sections. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use targetm_common.except_unwind_info. * dwarf2out.c: Include common/common-target.h. (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Use targetm_common.except_unwind_info. * except.c: Include common/common-target.h. (init_eh, finish_eh_generation, output_one_function_exception_table): Use targetm_common.except_unwind_info. (switch_to_exception_section): Use targetm_common.have_named_sections. * explow.c: Include common/common-target.h. * expr.c: Include common/common-target.h. (build_personality_function): Use targetm_common.except_unwind_info. * function.c: Include common/common-target.h. (expand_function_end): Use targetm_common.except_unwind_info. * haifa-sched.c: Include common/common-target.h. (sched_create_recovery_edges): Use targetm_common.have_named_sections. * lto-opts.c: Include common/common-target.h instead of target.h. (lto_reissue_options): Use targetm_common.handle_option. * opts.c: Include common/common-target.h. (target_handle_option): Use targetm_common.handle_option. (init_options_struct): Update comment referring to targetm.target_option.optimization. Use targetm_common.default_target_flags, targetm_common.unwind_tables_default and targetm_common.option_init_struct. (default_options_optimization): Use targetm_common.option_optimization_table. (finish_options): Use targetm_common.except_unwind_info, targetm_common.unwind_tables_default, targetm_common.have_named_sections and targetm_common.supports_split_stack. * toplev.c: Include common/common-target.h. (process_options): Use targetm_common.have_named_sections. * tree-tailcall.c: Include common/common-target.h. (suitable_for_tail_call_opt_p): Use targetm_common.except_unwind_info. * tree.c: Include common/common-target.h. (build_common_builtin_nodes): Use targetm_common.except_unwind_info. * varasm.c: Include common/common-target.h. (resolve_unique_section, hot_function_section, default_function_section): Use targetm_common.have_named_sections. ada: * gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o. (ada/utils.o): Update dependencies. * gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add ../../../libcpp/libcpp.a. * gcc-interface/utils.c: Include common/common-target.h. (process_attributes): Use targetm_common.have_named_sections. c-family: * c-common.c: Include common/common-target.h. (handle_section_attribute): Use targetm_common.have_named_sections. * c-cppbuiltin.c: Include common/common-target.h. (c_cpp_builtins): Use targetm_common.except_unwind_info. cp: * Make-lang.in (cp/method.o): Update dependencies. * method.c: Include common/common-target.h. (use_thunk): Use targetm_common.have_named_sections. go: * Make-lang.in (go/go-lang.o, go/go-backend.o): Update dependencies. * go-backend.c: Include common/common-target.h. (go_write_export_data): Use targetm_common.have_named_sections. * go-lang.c: Include common/common-target.h. (go_langhook_init_options_struct): Use targetm_common.supports_split_stack. po: * exgettext: Handle common/ directory and subdirectories. From-SVN: r175064
2011-06-15 01:11:35 +02:00
@deftypevr {Common Target Hook} bool TARGET_UNWIND_TABLES_DEFAULT
Makefile.in: Set and use UNWIND_H. 2005-06-28 Paul Brook <paul@codesourcery.com> gcc/ * Makefile.in: Set and use UNWIND_H. Install as unwind.h. * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. * except.c (add_ehspec_entry): Generate arm eabi filter lists. (assign_filter_values): Ditto. (output_ttype): New function. (output_function_exception_table): Use output_ttype. Generate arm eabi filter lists. (default_init_unwind_resume_libfunc): New function. * except.h (default_init_unwind_resume_libfunc): Add prototype. * optabs.c (init_optabs): Don't set unwind_resume_libfunc. * opts.c (decode_options): Use targetm.unwind_tables_default. * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default and arm_eabi_unwinder. * unwind-c.c: Support Arm EABI unwinder. * unwind.h: Rename ... * unwind-generic.h: ... To this. * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. (TARGET_UNWID_TABLES_DEFAULT): Document. * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Define. (thumb_pushpop, thumb_output_function_prologue): Output unwinding directives. (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when !TARGET_UNWIND_INFO. (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. * config/arm/lib1funcs.asm: Include libunwind.S. * config/arm/libgcc-bpabi.ver: Add unwinding routines. * config/arm/libunwind.S: New file. * config/arm/pr-support.c: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/unwind-arm.c: New file. * config/arm/unwind-arm.h: New file. * config/i386/t-netware (USER_H): Remove unwind.h. * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. gcc/cp/ * Make-lang.in (cp/except.o): Depend on $(TARGET_H) * except.c: Include target.h. (init_exception_processing): Initialize unwind_resume_libfunc. * doc/tm.texi: Document TARGET_ASM_TTYPE gcc/ada/ * misc.c (gnat_init_gcc_eh): Call default_init_unwind_resume_libfunc. gcc/java/ * decl.c (java_init_decl_processing): Call default_init_unwind_resume_libfunc. gcc/objc/ * objc-act.c (objc_init_exceptions): Call default_init_unwind_resume_libfunc. libstdc++/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Check for __cxa_end_cleanup. * libsupc++/Makefile.am (sources): Add eh_call.c and eh_arm.c. * libsupc++/eh_arm.cc: New file. * libsupc++/eh_call.cc: New file. * libsupc++/eh_catch.cc (__cxa_get_exception_ptr): Use __gxx_caught_object. (__cxa_begin_catch): Ditto. Use __is_gxx_exception_class. Call _Unwind_Complete when using the ARM EABI. (__cxa_end_catch): Use __is_gxx_exception_class. * libsupc++/eh_personality.cc: Define NO_SIZE_OF_ENCODED_VALUE when using the ARM EABI. (save_caught_exception, restore_caught_exception): New functions. (_throw_typet): New typedef. (get_ttype_entry, get_adjusted_ptr, check_exception_spec): Add ARM EABI implementations. (PERSONALITY_FUNCTION): Use new functions. Addd support for ARM EABI unwinding libary. (__cxa_unexpected): Disable when using the ARM EABI. * libsupc++/eh_throw.cc (__cxa_throw): Use __GXX_INIT_EXCEPTION_CLASS. (__cxa_rethrow): Use __is_gxx_exception_class. Call _Unwind_RaiseException when using the ARM EABI. * libsupc++/unwind-cxx.h (struct __cxa_exception): Add fields for ARM EABI semantics. (struct __cxa_eh_globals): Ditto. (__cxa_call_terminate): Add prototype. (__cxa_type_match, __cxa_begin_cleanup, __cxa_end_cleanup): Add prototypes. (__get_exception_header_from_obj, __get_exception_header_from_ue): Move earlier in file. (__is_gxx_exception_class, __GXX_INIT_EXCEPTION_CLASS, __gxx_caught_object): New functions. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * src/Makefie.in: Regenerate. * testsuite/makefile.in: Regenerate. From-SVN: r101385
2005-06-28 21:52:27 +02:00
This variable should be set to @code{true} if the target ABI requires unwinding
target.def (supports_split_stack, [...]): Take gcc_options parameters. * target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-25 14:16:03 +01:00
tables even when exceptions are not used. It must not be modified by
command-line option processing.
@end deftypevr
Makefile.in: Set and use UNWIND_H. 2005-06-28 Paul Brook <paul@codesourcery.com> gcc/ * Makefile.in: Set and use UNWIND_H. Install as unwind.h. * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. * except.c (add_ehspec_entry): Generate arm eabi filter lists. (assign_filter_values): Ditto. (output_ttype): New function. (output_function_exception_table): Use output_ttype. Generate arm eabi filter lists. (default_init_unwind_resume_libfunc): New function. * except.h (default_init_unwind_resume_libfunc): Add prototype. * optabs.c (init_optabs): Don't set unwind_resume_libfunc. * opts.c (decode_options): Use targetm.unwind_tables_default. * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default and arm_eabi_unwinder. * unwind-c.c: Support Arm EABI unwinder. * unwind.h: Rename ... * unwind-generic.h: ... To this. * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. (TARGET_UNWID_TABLES_DEFAULT): Document. * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Define. (thumb_pushpop, thumb_output_function_prologue): Output unwinding directives. (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when !TARGET_UNWIND_INFO. (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. * config/arm/lib1funcs.asm: Include libunwind.S. * config/arm/libgcc-bpabi.ver: Add unwinding routines. * config/arm/libunwind.S: New file. * config/arm/pr-support.c: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/unwind-arm.c: New file. * config/arm/unwind-arm.h: New file. * config/i386/t-netware (USER_H): Remove unwind.h. * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. gcc/cp/ * Make-lang.in (cp/except.o): Depend on $(TARGET_H) * except.c: Include target.h. (init_exception_processing): Initialize unwind_resume_libfunc. * doc/tm.texi: Document TARGET_ASM_TTYPE gcc/ada/ * misc.c (gnat_init_gcc_eh): Call default_init_unwind_resume_libfunc. gcc/java/ * decl.c (java_init_decl_processing): Call default_init_unwind_resume_libfunc. gcc/objc/ * objc-act.c (objc_init_exceptions): Call default_init_unwind_resume_libfunc. libstdc++/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Check for __cxa_end_cleanup. * libsupc++/Makefile.am (sources): Add eh_call.c and eh_arm.c. * libsupc++/eh_arm.cc: New file. * libsupc++/eh_call.cc: New file. * libsupc++/eh_catch.cc (__cxa_get_exception_ptr): Use __gxx_caught_object. (__cxa_begin_catch): Ditto. Use __is_gxx_exception_class. Call _Unwind_Complete when using the ARM EABI. (__cxa_end_catch): Use __is_gxx_exception_class. * libsupc++/eh_personality.cc: Define NO_SIZE_OF_ENCODED_VALUE when using the ARM EABI. (save_caught_exception, restore_caught_exception): New functions. (_throw_typet): New typedef. (get_ttype_entry, get_adjusted_ptr, check_exception_spec): Add ARM EABI implementations. (PERSONALITY_FUNCTION): Use new functions. Addd support for ARM EABI unwinding libary. (__cxa_unexpected): Disable when using the ARM EABI. * libsupc++/eh_throw.cc (__cxa_throw): Use __GXX_INIT_EXCEPTION_CLASS. (__cxa_rethrow): Use __is_gxx_exception_class. Call _Unwind_RaiseException when using the ARM EABI. * libsupc++/unwind-cxx.h (struct __cxa_exception): Add fields for ARM EABI semantics. (struct __cxa_eh_globals): Ditto. (__cxa_call_terminate): Add prototype. (__cxa_type_match, __cxa_begin_cleanup, __cxa_end_cleanup): Add prototypes. (__get_exception_header_from_obj, __get_exception_header_from_ue): Move earlier in file. (__is_gxx_exception_class, __GXX_INIT_EXCEPTION_CLASS, __gxx_caught_object): New functions. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * src/Makefie.in: Regenerate. * testsuite/makefile.in: Regenerate. From-SVN: r101385
2005-06-28 21:52:27 +02:00
builtins.c (expand_builtin_setjmp): Delete. * builtins.c (expand_builtin_setjmp): Delete. (expand_builtin) <BUILT_IN_SETJMP>: Mark as unreachable. <BUILT_IN_SETJMP_SETUP>: New case. <BUILT_IN_SETJMP_DISPATCHER>: Likewise. <BUILT_IN_SETJMP_RECEIVER>: Likewise. * builtins.def (BUILT_IN_SETJMP_SETUP): New built-in stub. (BUILT_IN_SETJMP_DISPATCHER): Likewise. (BUILT_IN_SETJMP_RECEIVER): Likewise. * gimple-low.c (struct lower_data): New field calls_builtin_setjmp. (lower_function_body): Initialize it to false. If it is set to true at the end of the processing, emit the setjmp dispatcher. (lower_stmt) <CALL_EXPR>: Invoke lower_builtin_setjmp if the callee is __builtin_setjmp and set calls_builtin_setjmp to true as well. <MODIFY_EXPR>: Fall through to above case if there is a CALL_EXPR on the rhs of the assignment. (lower_builtin_setjmp): New function. * tree.c (build_common_builtin_nodes): Build BUILT_IN_SETJMP_SETUP, BUILT_IN_SETJMP_DISPATCHER and BUILT_IN_SETJMP_RECEIVER nodes. * tree-cfg.c (make_exit_edges) <CALL_EXPR>: Use specific predicate to detect calls that can go to non-local labels. Use specific helper to create the abnormal edges associated with them. <MODIFY_EXPR>: Likewise. (make_abnormal_goto_edges): New function extracted from... (make_goto_expr_edges): ...here. Call it for computed gotos. (simple_goto_p): Minor tweak. (tree_can_make_abnormal_goto): New predicate. (tree_redirect_edge_and_branch): Return zero on all abnormal edges. (tree_purge_dead_abnormal_call_edges): New function. * tree-flow.h (tree_can_make_abnormal_goto): Declare. (tree_purge_dead_abnormal_call_edges): Likewise. (make_abnormal_goto_edges): Likewise. * tree-inline.c (expand_call_inline): Simplify statement frobbing. Purge all dead abnormal edges if the call was in the last statement. * tree-optimize.c (has_abnormal_outgoing_edge_p): New predicate. (execute_fixup_cfg): If there are non-local labels in the function, scan the basic blocks and split them at calls that can go to non-local labels or add missing abnormal call edges. Write down the CFG in the dump file. (pass_fixup_cfg): Remove TODO_dump_func flag. * unwind-sjlj.c: Poison setjmp. * doc/install.texi (enable-sjlj-exceptions): Use more general wording. * doc/tm.texi (DWARF2_UNWIND_INFO): Likewise. (TARGET_UNWIND_TABLES_DEFAULT): Fix typo. (DONT_USE_BUILTIN_SETJMP): Document it. From-SVN: r117298
2006-09-29 08:32:58 +02:00
@defmac DONT_USE_BUILTIN_SETJMP
Define this macro to 1 if the @code{setjmp}/@code{longjmp}-based scheme
should use the @code{setjmp}/@code{longjmp} functions from the C library
instead of the @code{__builtin_setjmp}/@code{__builtin_longjmp} machinery.
@end defmac
@defmac JMP_BUF_SIZE
This macro has no effect unless @code{DONT_USE_BUILTIN_SETJMP} is also
defined. Define this macro if the default size of @code{jmp_buf} buffer
for the @code{setjmp}/@code{longjmp}-based exception handling mechanism
is not large enough, or if it is much too large.
The default size is @code{FIRST_PSEUDO_REGISTER * sizeof(void *)}.
@end defmac
@defmac DWARF_CIE_DATA_ALIGNMENT
This macro need only be defined if the target might save registers in the
function prologue at an offset to the stack pointer that is not aligned to
@code{UNITS_PER_WORD}. The definition should be the negative minimum
alignment if @code{STACK_GROWS_DOWNWARD} is defined, and the positive
minimum alignment otherwise. @xref{SDB and DWARF}. Only applicable if
the target supports DWARF 2 frame unwind information.
@end defmac
1996-09-25 01:21:45 +02:00
@deftypevr {Target Hook} bool TARGET_TERMINATE_DW2_EH_FRAME_INFO
Contains the value true if the target should add a zero word onto the
end of a Dwarf-2 frame info section when used for exception handling.
Default value is false if @code{EH_FRAME_SECTION_NAME} is defined, and
true otherwise.
@end deftypevr
@deftypefn {Target Hook} rtx TARGET_DWARF_REGISTER_SPAN (rtx @var{reg})
Given a register, this hook should return a parallel of registers to
represent where to find the register pieces. Define this hook if the
register and its mode are represented in Dwarf in non-contiguous
locations, or if the register should be represented in more than one
register in Dwarf. Otherwise, this hook should return @code{NULL_RTX}.
If not defined, the default is to return @code{NULL_RTX}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_DWARF_FRAME_REG_MODE (int @var{regno})
Given a register, this hook should return the mode which the
corresponding Dwarf frame register should have. This is normally
used to return a smaller mode than the raw mode to prevent call
clobbered parts of a register altering the frame register size
@end deftypefn
@deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address})
If some registers are represented in Dwarf-2 unwind information in
multiple pieces, define this hook to fill in information about the
sizes of those pieces in the table used by the unwinder at runtime.
It will be called by @code{expand_builtin_init_dwarf_reg_sizes} after
filling in a single size corresponding to each hard register;
@var{address} is the address of the table.
@end deftypefn
Makefile.in: Set and use UNWIND_H. 2005-06-28 Paul Brook <paul@codesourcery.com> gcc/ * Makefile.in: Set and use UNWIND_H. Install as unwind.h. * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. * except.c (add_ehspec_entry): Generate arm eabi filter lists. (assign_filter_values): Ditto. (output_ttype): New function. (output_function_exception_table): Use output_ttype. Generate arm eabi filter lists. (default_init_unwind_resume_libfunc): New function. * except.h (default_init_unwind_resume_libfunc): Add prototype. * optabs.c (init_optabs): Don't set unwind_resume_libfunc. * opts.c (decode_options): Use targetm.unwind_tables_default. * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default and arm_eabi_unwinder. * unwind-c.c: Support Arm EABI unwinder. * unwind.h: Rename ... * unwind-generic.h: ... To this. * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. (TARGET_UNWID_TABLES_DEFAULT): Document. * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Define. (thumb_pushpop, thumb_output_function_prologue): Output unwinding directives. (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when !TARGET_UNWIND_INFO. (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. * config/arm/lib1funcs.asm: Include libunwind.S. * config/arm/libgcc-bpabi.ver: Add unwinding routines. * config/arm/libunwind.S: New file. * config/arm/pr-support.c: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/unwind-arm.c: New file. * config/arm/unwind-arm.h: New file. * config/i386/t-netware (USER_H): Remove unwind.h. * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. gcc/cp/ * Make-lang.in (cp/except.o): Depend on $(TARGET_H) * except.c: Include target.h. (init_exception_processing): Initialize unwind_resume_libfunc. * doc/tm.texi: Document TARGET_ASM_TTYPE gcc/ada/ * misc.c (gnat_init_gcc_eh): Call default_init_unwind_resume_libfunc. gcc/java/ * decl.c (java_init_decl_processing): Call default_init_unwind_resume_libfunc. gcc/objc/ * objc-act.c (objc_init_exceptions): Call default_init_unwind_resume_libfunc. libstdc++/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Check for __cxa_end_cleanup. * libsupc++/Makefile.am (sources): Add eh_call.c and eh_arm.c. * libsupc++/eh_arm.cc: New file. * libsupc++/eh_call.cc: New file. * libsupc++/eh_catch.cc (__cxa_get_exception_ptr): Use __gxx_caught_object. (__cxa_begin_catch): Ditto. Use __is_gxx_exception_class. Call _Unwind_Complete when using the ARM EABI. (__cxa_end_catch): Use __is_gxx_exception_class. * libsupc++/eh_personality.cc: Define NO_SIZE_OF_ENCODED_VALUE when using the ARM EABI. (save_caught_exception, restore_caught_exception): New functions. (_throw_typet): New typedef. (get_ttype_entry, get_adjusted_ptr, check_exception_spec): Add ARM EABI implementations. (PERSONALITY_FUNCTION): Use new functions. Addd support for ARM EABI unwinding libary. (__cxa_unexpected): Disable when using the ARM EABI. * libsupc++/eh_throw.cc (__cxa_throw): Use __GXX_INIT_EXCEPTION_CLASS. (__cxa_rethrow): Use __is_gxx_exception_class. Call _Unwind_RaiseException when using the ARM EABI. * libsupc++/unwind-cxx.h (struct __cxa_exception): Add fields for ARM EABI semantics. (struct __cxa_eh_globals): Ditto. (__cxa_call_terminate): Add prototype. (__cxa_type_match, __cxa_begin_cleanup, __cxa_end_cleanup): Add prototypes. (__get_exception_header_from_obj, __get_exception_header_from_ue): Move earlier in file. (__is_gxx_exception_class, __GXX_INIT_EXCEPTION_CLASS, __gxx_caught_object): New functions. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * src/Makefie.in: Regenerate. * testsuite/makefile.in: Regenerate. From-SVN: r101385
2005-06-28 21:52:27 +02:00
@deftypefn {Target Hook} bool TARGET_ASM_TTYPE (rtx @var{sym})
This hook is used to output a reference from a frame unwinding table to
the type_info object identified by @var{sym}. It should return @code{true}
if the reference was output. Returning @code{false} will cause the
reference to be output using the normal Dwarf2 routines.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypevr {Target Hook} bool TARGET_ARM_EABI_UNWINDER
This flag should be set to @code{true} on targets that use an ARM EABI
Makefile.in: Set and use UNWIND_H. 2005-06-28 Paul Brook <paul@codesourcery.com> gcc/ * Makefile.in: Set and use UNWIND_H. Install as unwind.h. * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. * except.c (add_ehspec_entry): Generate arm eabi filter lists. (assign_filter_values): Ditto. (output_ttype): New function. (output_function_exception_table): Use output_ttype. Generate arm eabi filter lists. (default_init_unwind_resume_libfunc): New function. * except.h (default_init_unwind_resume_libfunc): Add prototype. * optabs.c (init_optabs): Don't set unwind_resume_libfunc. * opts.c (decode_options): Use targetm.unwind_tables_default. * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default and arm_eabi_unwinder. * unwind-c.c: Support Arm EABI unwinder. * unwind.h: Rename ... * unwind-generic.h: ... To this. * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. (TARGET_UNWID_TABLES_DEFAULT): Document. * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Define. (thumb_pushpop, thumb_output_function_prologue): Output unwinding directives. (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when !TARGET_UNWIND_INFO. (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. * config/arm/lib1funcs.asm: Include libunwind.S. * config/arm/libgcc-bpabi.ver: Add unwinding routines. * config/arm/libunwind.S: New file. * config/arm/pr-support.c: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/unwind-arm.c: New file. * config/arm/unwind-arm.h: New file. * config/i386/t-netware (USER_H): Remove unwind.h. * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. gcc/cp/ * Make-lang.in (cp/except.o): Depend on $(TARGET_H) * except.c: Include target.h. (init_exception_processing): Initialize unwind_resume_libfunc. * doc/tm.texi: Document TARGET_ASM_TTYPE gcc/ada/ * misc.c (gnat_init_gcc_eh): Call default_init_unwind_resume_libfunc. gcc/java/ * decl.c (java_init_decl_processing): Call default_init_unwind_resume_libfunc. gcc/objc/ * objc-act.c (objc_init_exceptions): Call default_init_unwind_resume_libfunc. libstdc++/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Check for __cxa_end_cleanup. * libsupc++/Makefile.am (sources): Add eh_call.c and eh_arm.c. * libsupc++/eh_arm.cc: New file. * libsupc++/eh_call.cc: New file. * libsupc++/eh_catch.cc (__cxa_get_exception_ptr): Use __gxx_caught_object. (__cxa_begin_catch): Ditto. Use __is_gxx_exception_class. Call _Unwind_Complete when using the ARM EABI. (__cxa_end_catch): Use __is_gxx_exception_class. * libsupc++/eh_personality.cc: Define NO_SIZE_OF_ENCODED_VALUE when using the ARM EABI. (save_caught_exception, restore_caught_exception): New functions. (_throw_typet): New typedef. (get_ttype_entry, get_adjusted_ptr, check_exception_spec): Add ARM EABI implementations. (PERSONALITY_FUNCTION): Use new functions. Addd support for ARM EABI unwinding libary. (__cxa_unexpected): Disable when using the ARM EABI. * libsupc++/eh_throw.cc (__cxa_throw): Use __GXX_INIT_EXCEPTION_CLASS. (__cxa_rethrow): Use __is_gxx_exception_class. Call _Unwind_RaiseException when using the ARM EABI. * libsupc++/unwind-cxx.h (struct __cxa_exception): Add fields for ARM EABI semantics. (struct __cxa_eh_globals): Ditto. (__cxa_call_terminate): Add prototype. (__cxa_type_match, __cxa_begin_cleanup, __cxa_end_cleanup): Add prototypes. (__get_exception_header_from_obj, __get_exception_header_from_ue): Move earlier in file. (__is_gxx_exception_class, __GXX_INIT_EXCEPTION_CLASS, __gxx_caught_object): New functions. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * src/Makefie.in: Regenerate. * testsuite/makefile.in: Regenerate. From-SVN: r101385
2005-06-28 21:52:27 +02:00
based unwinding library, and @code{false} on other targets. This effects
the format of unwinding tables, and how the unwinder in entered after
running a cleanup. The default is @code{false}.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
Makefile.in: Set and use UNWIND_H. 2005-06-28 Paul Brook <paul@codesourcery.com> gcc/ * Makefile.in: Set and use UNWIND_H. Install as unwind.h. * c-decl.c (finish_decl): Call default_init_unwind_resume_libfunc. * except.c (add_ehspec_entry): Generate arm eabi filter lists. (assign_filter_values): Ditto. (output_ttype): New function. (output_function_exception_table): Use output_ttype. Generate arm eabi filter lists. (default_init_unwind_resume_libfunc): New function. * except.h (default_init_unwind_resume_libfunc): Add prototype. * optabs.c (init_optabs): Don't set unwind_resume_libfunc. * opts.c (decode_options): Use targetm.unwind_tables_default. * target-def.h (TARGET_ASM_TTYPE): Provide and use definition. (TARGET_ARM_EABI_UNWINDER, TARGET_UNWIND_TABLES_DEFAULT): Ditto. * target.h (struct gcc_target): Add asm.ttype, unwind_tables_default and arm_eabi_unwinder. * unwind-c.c: Support Arm EABI unwinder. * unwind.h: Rename ... * unwind-generic.h: ... To this. * doc/tm.texi (TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Document. (TARGET_UNWID_TABLES_DEFAULT): Document. * config/arm/arm-protos.h (arm_output_fn_unwind): Add prototype. * config/arm/arm.c (arm_unwind_emit, arm_output_ttype): New functions. (TARGET_UNWIND_EMIT, TARGET_ASM_TTYPE, TARGET_ARM_EABI_UNWINDER): Define. (thumb_pushpop, thumb_output_function_prologue): Output unwinding directives. (arm_unwind_emit_stm, arm_unwind_emit_set): New functions. * config/arm/arm.h (MUST_USE_SJLJ_EXCEPTIONS): Only define when !TARGET_UNWIND_INFO. (ARM_OUTPUT_FN_UNWIND, ARM_EABI_UNWIND_TABLES): Define. * config/arm/bpabi.h (TARGET_UNWIND_INFO): Define. * config/arm/elf.h (ASM_DECLARE_FUNCTION_NAME, ASM_DECLARE_FUNCTION_SIZE): Use ARM_OUTPUT_FN_UNWIND. * config/arm/lib1funcs.asm: Include libunwind.S. * config/arm/libgcc-bpabi.ver: Add unwinding routines. * config/arm/libunwind.S: New file. * config/arm/pr-support.c: New file. * config/arm/t-bpabi (LIB1ASMFUNCS): Add _unwind. (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/t-symbian (UNWIND_H, LIB2ADDEH, LIB2ADDEHDEP): Set. * config/arm/unwind-arm.c: New file. * config/arm/unwind-arm.h: New file. * config/i386/t-netware (USER_H): Remove unwind.h. * config/ia64/ia64.h (TARGET_UNWIND_TABLES_DEFAULT): Define. gcc/cp/ * Make-lang.in (cp/except.o): Depend on $(TARGET_H) * except.c: Include target.h. (init_exception_processing): Initialize unwind_resume_libfunc. * doc/tm.texi: Document TARGET_ASM_TTYPE gcc/ada/ * misc.c (gnat_init_gcc_eh): Call default_init_unwind_resume_libfunc. gcc/java/ * decl.c (java_init_decl_processing): Call default_init_unwind_resume_libfunc. gcc/objc/ * objc-act.c (objc_init_exceptions): Call default_init_unwind_resume_libfunc. libstdc++/ * acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Check for __cxa_end_cleanup. * libsupc++/Makefile.am (sources): Add eh_call.c and eh_arm.c. * libsupc++/eh_arm.cc: New file. * libsupc++/eh_call.cc: New file. * libsupc++/eh_catch.cc (__cxa_get_exception_ptr): Use __gxx_caught_object. (__cxa_begin_catch): Ditto. Use __is_gxx_exception_class. Call _Unwind_Complete when using the ARM EABI. (__cxa_end_catch): Use __is_gxx_exception_class. * libsupc++/eh_personality.cc: Define NO_SIZE_OF_ENCODED_VALUE when using the ARM EABI. (save_caught_exception, restore_caught_exception): New functions. (_throw_typet): New typedef. (get_ttype_entry, get_adjusted_ptr, check_exception_spec): Add ARM EABI implementations. (PERSONALITY_FUNCTION): Use new functions. Addd support for ARM EABI unwinding libary. (__cxa_unexpected): Disable when using the ARM EABI. * libsupc++/eh_throw.cc (__cxa_throw): Use __GXX_INIT_EXCEPTION_CLASS. (__cxa_rethrow): Use __is_gxx_exception_class. Call _Unwind_RaiseException when using the ARM EABI. * libsupc++/unwind-cxx.h (struct __cxa_exception): Add fields for ARM EABI semantics. (struct __cxa_eh_globals): Ditto. (__cxa_call_terminate): Add prototype. (__cxa_type_match, __cxa_begin_cleanup, __cxa_end_cleanup): Add prototypes. (__get_exception_header_from_obj, __get_exception_header_from_ue): Move earlier in file. (__is_gxx_exception_class, __GXX_INIT_EXCEPTION_CLASS, __gxx_caught_object): New functions. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libmath/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * src/Makefie.in: Regenerate. * testsuite/makefile.in: Regenerate. From-SVN: r101385
2005-06-28 21:52:27 +02:00
1996-09-25 01:21:45 +02:00
@node Alignment Output
@subsection Assembler Commands for Alignment
@c prevent bad page break with this line
This describes commands for alignment.
@defmac JUMP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}, which is
a common destination of jumps and has no fallthru incoming edge.
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
define the macro.
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @var{align_jumps} in the target's
@code{TARGET_OPTION_OVERRIDE}. Otherwise, you should try to honor the user's
selection in @var{align_jumps} in a @code{JUMP_ALIGN} implementation.
@end defmac
@deftypefn {Target Hook} int TARGET_ASM_JUMP_ALIGN_MAX_SKIP (rtx_insn *@var{label})
The maximum number of bytes to skip before @var{label} when applying
@code{JUMP_ALIGN}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
@end deftypefn
@defmac LABEL_ALIGN_AFTER_BARRIER (@var{label})
The alignment (log base 2) to put in front of @var{label}, which follows
a @code{BARRIER}.
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
define the macro.
@end defmac
@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP (rtx_insn *@var{label})
The maximum number of bytes to skip before @var{label} when applying
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@code{LABEL_ALIGN_AFTER_BARRIER}. This works only if
@code{ASM_OUTPUT_MAX_SKIP_ALIGN} is defined.
@end deftypefn
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@defmac LOOP_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label} that heads
a frequently executed basic block (usually the header of a loop).
1996-09-25 01:21:45 +02:00
This macro need not be defined if you don't want any special alignment
to be done at such a time. Most machine descriptions do not currently
define the macro.
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @code{align_loops} in the target's
@code{TARGET_OPTION_OVERRIDE}. Otherwise, you should try to honor the user's
selection in @code{align_loops} in a @code{LOOP_ALIGN} implementation.
@end defmac
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@deftypefn {Target Hook} int TARGET_ASM_LOOP_ALIGN_MAX_SKIP (rtx_insn *@var{label})
The maximum number of bytes to skip when applying @code{LOOP_ALIGN} to
@var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN} is
defined.
@end deftypefn
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@defmac LABEL_ALIGN (@var{label})
The alignment (log base 2) to put in front of @var{label}.
If @code{LABEL_ALIGN_AFTER_BARRIER} / @code{LOOP_ALIGN} specify a different alignment,
the maximum of the specified values is used.
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
Unless it's necessary to inspect the @var{label} parameter, it is better
to set the variable @code{align_labels} in the target's
@code{TARGET_OPTION_OVERRIDE}. Otherwise, you should try to honor the user's
selection in @code{align_labels} in a @code{LABEL_ALIGN} implementation.
@end defmac
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@deftypefn {Target Hook} int TARGET_ASM_LABEL_ALIGN_MAX_SKIP (rtx_insn *@var{label})
The maximum number of bytes to skip when applying @code{LABEL_ALIGN}
to @var{label}. This works only if @code{ASM_OUTPUT_MAX_SKIP_ALIGN}
is defined.
@end deftypefn
flags.h: New variables align_loops... * flags.h: New variables align_loops, align_loops_log, align_jumps, align_jumps_log, align_labels, align_labels_log, align_functions, align_functions_log. * toplev.c: Define them. (f_options): Handle -falign-* when they have no argument. (main): Add logic to set variables for -falign-functions, -falign-jumps, -falign-labels, -falign-loops. Make it -fsched-verbose=<n> and -finline-limit=<n>. (display_help): Change help to match options. * final.c (LABEL_ALIGN): Default to align_labels_log. (LABEL_ALIGN_MAX_SKIP): Default to align_labels-1. (LOOP_ALIGN): Default to align_loops_log. (LOOP_ALIGN_MAX_SKIP): Default to align_loops-1. (LABEL_ALIGN_AFTER_BARRIER): Default to align_jumps_log. (LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP): Default to align_jumps-1. * varasm.c (assemble_start_function): Handle align_functions. * config/sparc/sparc.h: Don't declare sparc_align_*. Don't provide LABEL_ALIGN_AFTER_BARRIER or LOOP_ALIGN. (DEFAULT_SPARC_ALIGN_FUNCS): Delete; take functionality into sparc.c. (FUNCTION_BOUNDARY): Fix incorrect use---it's not just a request, it's a promise. * config/sparc/sparc.c: Delete sparc_align_loops, sparc_align_jumps, sparc_align_funcs and the corresponding string variables. (sparc_override_options): Default align_functions on ultrasparc. Delete -malign-* handling. * config/mips/mips.c (override_options): On 64-bit targets, try to align code to 64-bit boundaries. (print_operand): New substitution, %~, which aligns labels to align_labels_log. * config/mips/mips.md (div_trap_normal): Use %~. (div_trap_mips16): Likewise. (abssi): Likewise. (absdi2): Likewise. (ffssi2): Likewise. (ffsdi2): Likewise. (ashldi3_internal): Likewise. (ashrdi3_internal): Likewise. (lshrdi3_internal): Likewise. (casesi_internal): Likewise. Plus corresponding documentation changes. From-SVN: r29045
1999-09-02 07:42:06 +02:00
@defmac ASM_OUTPUT_SKIP (@var{stream}, @var{nbytes})
1996-09-25 01:21:45 +02:00
A C statement to output to the stdio stream @var{stream} an assembler
instruction to advance the location counter by @var{nbytes} bytes.
Those bytes should be zero when loaded. @var{nbytes} will be a C
expression of type @code{unsigned HOST_WIDE_INT}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_NO_SKIP_IN_TEXT
1996-09-25 01:21:45 +02:00
Define this macro if @code{ASM_OUTPUT_SKIP} should not be used in the
1998-02-19 01:04:36 +01:00
text section because it fails to put zeros in the bytes that are skipped.
1996-09-25 01:21:45 +02:00
This is true on many Unix systems, where the pseudo--op to skip bytes
produces no-op instructions rather than zeros when used in the text
section.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_OUTPUT_ALIGN (@var{stream}, @var{power})
1996-09-25 01:21:45 +02:00
A C statement to output to the stdio stream @var{stream} an assembler
command to advance the location counter to a multiple of 2 to the
@var{power} bytes. @var{power} will be a C expression of type @code{int}.
@end defmac
@defmac ASM_OUTPUT_ALIGN_WITH_NOP (@var{stream}, @var{power})
Like @code{ASM_OUTPUT_ALIGN}, except that the ``nop'' instruction is used
for padding, if necessary.
@end defmac
@defmac ASM_OUTPUT_MAX_SKIP_ALIGN (@var{stream}, @var{power}, @var{max_skip})
A C statement to output to the stdio stream @var{stream} an assembler
command to advance the location counter to a multiple of 2 to the
@var{power} bytes, but only if @var{max_skip} or fewer bytes are needed to
satisfy the alignment request. @var{power} and @var{max_skip} will be
a C expression of type @code{int}.
@end defmac
1996-09-25 01:21:45 +02:00
@need 3000
@node Debugging Info
@section Controlling Debugging Information Format
@c prevent bad page break with this line
This describes how to specify debugging information.
@menu
* All Debuggers:: Macros that affect all debugging formats uniformly.
* DBX Options:: Macros enabling specific options in DBX format.
* DBX Hooks:: Hook macros for varying DBX format.
* File Names and DBX:: Macros controlling output of file names in DBX format.
* SDB and DWARF:: Macros for SDB (COFF) and DWARF formats.
* VMS Debug:: Macros for VMS debug format.
1996-09-25 01:21:45 +02:00
@end menu
@node All Debuggers
@subsection Macros Affecting All Debugging Formats
@c prevent bad page break with this line
These macros affect all debugging formats.
@defmac DBX_REGISTER_NUMBER (@var{regno})
1996-09-25 01:21:45 +02:00
A C expression that returns the DBX register number for the compiler
1750a.h (DBX_REGISTER_NUMBER): Don't define. * 1750a.h (DBX_REGISTER_NUMBER): Don't define. * alpha.h (DBX_REGISTER_NUMBER): Likewise. * arc.h (DBX_REGISTER_NUMBER): Likewise. * arm/aout.h (DBX_REGISTER_NUMBER): Likewise. * avr.h (DBX_REGISTER_NUMBER): Likewise. * c4x.h (DBX_REGISTER_NUMBER): Likewise. * clipper.h (DBX_REGISTER_NUMBER): Likewise. * convex.h (DBX_REGISTER_NUMBER): Likewise. * cris.h (DBX_REGISTER_NUMBER): Likewise. * dsp16xx.h (DBX_REGISTER_NUMBER): Likewise. * elxsi.h (DBX_REGISTER_NUMBER): Likewise. * fr30.h (DBX_REGISTER_NUMBER): Likewise. * h8300.h (DBX_REGISTER_NUMBER): Likewise. * i370.h (DBX_REGISTER_NUMBER): Likewise. * i860.h (DBX_REGISTER_NUMBER): Likewise. * i860/paragon.h (DBX_REGISTER_NUMBER): Likewise. * i860/sysv3.h (DBX_REGISTER_NUMBER): Likewise. * i860/sysv4.h (DBX_REGISTER_NUMBER): Likewise. * m32r.h (DBX_REGISTER_NUMBER): Likewise. * m68hc11.h (DBX_REGISTER_NUMBER): Likewise. * m88k.h (DBX_REGISTER_NUMBER): Likewise. * mcore/mcore-elf.h (DBX_REGISTER_NUMBER): Likewise. * mcore.h (DBX_REGISTER_NUMBER): Likewise. * mn10200.h (DBX_REGISTER_NUMBER): Likewise. * mn10300.h (DBX_REGISTER_NUMBER): Likewise. * pdp11.h (DBX_REGISTER_NUMBER): Likewise. * romp.h (DBX_REGISTER_NUMBER): Likewise. * rs6000.h (DBX_REGISTER_NUMBER): Likewise. * rs6000/sysv4.h (DBX_REGISTER_NUMBER): Likewise. * s390/linux.h (DBX_REGISTER_NUMBER): Likewise. * stormy16.h (DBX_REGISTER_NUMBER): Likewise. * v850.h (DBX_REGISTER_NUMBER): Likewise. * vax.h (DBX_REGISTER_NUMBER): Likewise. * we32k.h (DBX_REGISTER_NUMBER): Likewise. * defaults.h (DBX_REGISTER_NUMBER): Provide a default. * doc/tm.texi (DBX_REGISTER_NUMBER): Update. From-SVN: r47256
2001-11-22 03:19:58 +01:00
register number @var{regno}. In the default macro provided, the value
of this expression will be @var{regno} itself. But sometimes there are
some registers that the compiler knows about and DBX does not, or vice
versa. In such cases, some register may need to have one number in the
compiler and another for DBX@.
1996-09-25 01:21:45 +02:00
If two registers have consecutive numbers inside GCC, and they can be
1996-09-25 01:21:45 +02:00
used as a pair to hold a multiword value, then they @emph{must} have
consecutive numbers after renumbering with @code{DBX_REGISTER_NUMBER}.
Otherwise, debuggers will be unable to access such a pair, because they
expect register pairs to be consecutive in their own numbering scheme.
If you find yourself defining @code{DBX_REGISTER_NUMBER} in way that
does not preserve register pairs, then what you must do instead is
redefine the actual register numbering scheme.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DEBUGGER_AUTO_OFFSET (@var{x})
1996-09-25 01:21:45 +02:00
A C expression that returns the integer offset value for an automatic
variable having address @var{x} (an RTL expression). The default
computation assumes that @var{x} is based on the frame-pointer and
gives the offset from the frame-pointer. This is required for targets
that produce debugging output for DBX or COFF-style debugging output
for SDB and allow the frame-pointer to be eliminated when the
@option{-g} options is used.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DEBUGGER_ARG_OFFSET (@var{offset}, @var{x})
1996-09-25 01:21:45 +02:00
A C expression that returns the integer offset value for an argument
having address @var{x} (an RTL expression). The nominal offset is
@var{offset}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac PREFERRED_DEBUGGING_TYPE
A C expression that returns the type of debugging output GCC should
produce when the user specifies just @option{-g}. Define
this if you have arranged for GCC to support more than one format of
debugging output. Currently, the allowable values are @code{DBX_DEBUG},
@code{SDB_DEBUG}, @code{DWARF_DEBUG}, @code{DWARF2_DEBUG},
@code{XCOFF_DEBUG}, @code{VMS_DEBUG}, and @code{VMS_AND_DWARF2_DEBUG}.
1996-09-25 01:21:45 +02:00
When the user specifies @option{-ggdb}, GCC normally also uses the
value of this macro to select the debugging output format, but with two
exceptions. If @code{DWARF2_DEBUGGING_INFO} is defined, GCC uses the
value @code{DWARF2_DEBUG}. Otherwise, if @code{DBX_DEBUGGING_INFO} is
defined, GCC uses @code{DBX_DEBUG}.
1996-09-25 01:21:45 +02:00
The value of this macro only affects the default debugging output; the
user can always get a specific type of output by using @option{-gstabs},
@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
@end defmac
1996-09-25 01:21:45 +02:00
@node DBX Options
@subsection Specific Options for DBX Output
@c prevent bad page break with this line
These are specific options for DBX output.
@defmac DBX_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for DBX
in response to the @option{-g} option.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac XCOFF_DEBUGGING_INFO
Define this macro if GCC should produce XCOFF format debugging output
in response to the @option{-g} option. This is a variant of DBX format.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DEFAULT_GDB_EXTENSIONS
Define this macro to control whether GCC should by default generate
1996-09-25 01:21:45 +02:00
GDB's extended version of DBX debugging information (assuming DBX-format
debugging information is enabled at all). If you don't define the
macro, the default is 1: always generate the extended information
if there is any occasion to.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DEBUG_SYMS_TEXT
1996-09-25 01:21:45 +02:00
Define this macro if all @code{.stabs} commands should be output while
in the text section.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_STABS_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabs\t"} to define an ordinary debugging symbol.
If you don't define this macro, @code{"\t.stabs\t"} is used. This macro
applies only to DBX debugging information format.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_STABD_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabd\t"} to define a debugging symbol whose
value is the current location. If you don't define this macro,
@code{"\t.stabd\t"} is used. This macro applies only to DBX debugging
information format.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac ASM_STABN_OP
A C string constant, including spacing, naming the assembler pseudo op to
use instead of @code{"\t.stabn\t"} to define a debugging symbol with no
name. If you don't define this macro, @code{"\t.stabn\t"} is used. This
macro applies only to DBX debugging information format.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_NO_XREFS
1996-09-25 01:21:45 +02:00
Define this macro if DBX on your system does not support the construct
@samp{xs@var{tagname}}. On some systems, this construct is used to
describe a forward reference to a structure named @var{tagname}.
On other systems, this construct is not supported at all.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_CONTIN_LENGTH
1996-09-25 01:21:45 +02:00
A symbol name in DBX-format debugging information is normally
continued (split into two separate @code{.stabs} directives) when it
exceeds a certain length (by default, 80 characters). On some
operating systems, DBX requires this splitting; on others, splitting
must not be done. You can inhibit splitting by defining this macro
with the value zero. You can override the default splitting-length by
defining this macro as an expression for the length you desire.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_CONTIN_CHAR
1996-09-25 01:21:45 +02:00
Normally continuation is indicated by adding a @samp{\} character to
the end of a @code{.stabs} string when a continuation follows. To use
a different character instead, define this macro as a character
constant for the character you want to use. Do not define this macro
if backslash is correct for your system.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_STATIC_STAB_DATA_SECTION
1996-09-25 01:21:45 +02:00
Define this macro if it is necessary to go to the data section before
outputting the @samp{.stabs} pseudo-op for a non-global static
variable.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_TYPE_DECL_STABS_CODE
1996-09-25 01:21:45 +02:00
The value to use in the ``code'' field of the @code{.stabs} directive
for a typedef. The default is @code{N_LSYM}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_STATIC_CONST_VAR_CODE
1996-09-25 01:21:45 +02:00
The value to use in the ``code'' field of the @code{.stabs} directive
for a static variable located in the text section. DBX format does not
provide any ``right'' way to do this. The default is @code{N_FUN}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_REGPARM_STABS_CODE
1996-09-25 01:21:45 +02:00
The value to use in the ``code'' field of the @code{.stabs} directive
for a parameter passed in registers. DBX format does not provide any
``right'' way to do this. The default is @code{N_RSYM}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_REGPARM_STABS_LETTER
1996-09-25 01:21:45 +02:00
The letter to use in DBX symbol data to identify a symbol as a parameter
passed in registers. DBX format does not customarily provide any way to
do this. The default is @code{'P'}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_FUNCTION_FIRST
1996-09-25 01:21:45 +02:00
Define this macro if the DBX information for a function and its
arguments should precede the assembler code for the function. Normally,
in DBX format, the debugging information entirely follows the assembler
code.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_BLOCKS_FUNCTION_RELATIVE
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
Define this macro, with value 1, if the value of a symbol describing
the scope of a block (@code{N_LBRAC} or @code{N_RBRAC}) should be
relative to the start of the enclosing function. Normally, GCC uses
an absolute address.
@end defmac
@defmac DBX_LINES_FUNCTION_RELATIVE
Define this macro, with value 1, if the value of a symbol indicating
the current line number (@code{N_SLINE}) should be relative to the
start of the enclosing function. Normally, GCC uses an absolute address.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_USE_BINCL
Define this macro if GCC should generate @code{N_BINCL} and
1996-09-25 01:21:45 +02:00
@code{N_EINCL} stabs for included header files, as on Sun systems. This
macro also directs GCC to output a type number as a pair of a file
number and a type number within the file. Normally, GCC does not
1996-09-25 01:21:45 +02:00
generate @code{N_BINCL} or @code{N_EINCL} stabs, and it outputs a single
number for a type number.
@end defmac
1996-09-25 01:21:45 +02:00
@node DBX Hooks
@subsection Open-Ended Hooks for DBX Format
@c prevent bad page break with this line
These are hooks for DBX format.
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
@defmac DBX_OUTPUT_SOURCE_LINE (@var{stream}, @var{line}, @var{counter})
A C statement to output DBX debugging information before code for line
number @var{line} of the current source file to the stdio stream
@var{stream}. @var{counter} is the number of time the macro was
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
invoked, including the current invocation; it is intended to generate
unique labels in the assembly output.
This macro should not be defined if the default output is correct, or
if it can be made correct by defining @code{DBX_LINES_FUNCTION_RELATIVE}.
@end defmac
@defmac NO_DBX_FUNCTION_END
1996-09-25 01:21:45 +02:00
Some stabs encapsulation formats (in particular ECOFF), cannot handle the
@code{.stabs "",N_FUN,,0,0,Lscope-function-1} gdb dbx extension construct.
1996-09-25 01:21:45 +02:00
On those machines, define this macro to turn this feature off without
disturbing the rest of the gdb extensions.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac NO_DBX_BNSYM_ENSYM
Some assemblers cannot handle the @code{.stabd BNSYM/ENSYM,0,0} gdb dbx
extension construct. On those machines, define this macro to turn this
feature off without disturbing the rest of the gdb extensions.
@end defmac
1996-09-25 01:21:45 +02:00
@node File Names and DBX
@subsection File Names in DBX Format
@c prevent bad page break with this line
This describes file names in DBX format.
@defmac DBX_OUTPUT_MAIN_SOURCE_FILENAME (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement to output DBX debugging information to the stdio stream
dbxout.c: Include obstack.h. * dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
2004-10-27 03:29:42 +02:00
@var{stream}, which indicates that file @var{name} is the main source
1996-09-25 01:21:45 +02:00
file---the file specified as the input file for compilation.
This macro is called only once, at the beginning of compilation.
This macro need not be defined if the standard form of output
for DBX debugging information is appropriate.
dbxout.c: Include obstack.h. * dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
2004-10-27 03:29:42 +02:00
It may be necessary to refer to a label equal to the beginning of the
text section. You can use @samp{assemble_name (stream, ltext_label_name)}
to do so. If you do this, you must also set the variable
@var{used_ltext_label_name} to @code{true}.
@end defmac
1996-09-25 01:21:45 +02:00
dbxout.c: Include obstack.h. * dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
2004-10-27 03:29:42 +02:00
@defmac NO_DBX_MAIN_SOURCE_DIRECTORY
Define this macro, with value 1, if GCC should not emit an indication
of the current directory for compilation and current source language at
the beginning of the file.
@end defmac
1996-09-25 01:21:45 +02:00
dbxout.c: Include obstack.h. * dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
2004-10-27 03:29:42 +02:00
@defmac NO_DBX_GCC_MARKER
Define this macro, with value 1, if GCC should not emit an indication
that this object file was compiled by GCC@. The default is to emit
an @code{N_OPT} stab at the beginning of every source file, with
@samp{gcc2_compiled.} for the string and value 0.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DBX_OUTPUT_MAIN_SOURCE_FILE_END (@var{stream}, @var{name})
1996-09-25 01:21:45 +02:00
A C statement to output DBX debugging information at the end of
dbxout.c: Include obstack.h. * dbxout.c: Include obstack.h. (ASM_STABS_OP): Take XCOFF_DEBUGGING_INFO into account in default definition. (ASM_STABD_OP, NO_DBX_MAIN_SOURCE_DIRECTORY, DBX_CONTIN_CHAR): Default-define here. (DBX_CONTIN_LENGTH): Move definition with others. (DBX_FINISH_STABS): New target macro. (current_sym_code, current_sym_value, current_sym_addr) (current_sym_nchars, CHARS, dbxout_continue) (print_int_cst_octal, print_octal, print_wide_int) (dbxout_prepare_symbol, dbxout_finish_symbol): Delete. (stabstr_ob, stabstr_last_contin_point): New variables. (NUMBER_FMT_LOOP): New improper macro. (dbxout_int, dbxout_stab_value_zero, dbxout_stab_value_label) (dbxout_stab_value_label_diff, dbxout_stab_value_internal_label) (dbxout_stab_value_internal_label_diff, dbxout_stabd) (dbxout_begin_stabn, dbxout_begin_stabn_sline) (dbxout_begin_simple_stabs, dbxout_begin_simple_stabs_desc) (dbxout_begin_complex_stabs, dbxout_finish_complex_stabs) (stabstr_C, stabstr_S, stabstr_I, stabstr_D, stabstr_U, stabstr_O) (stabstr_continue, DECL_ACCESSIBILITY_CHAR) New functions and/or proper function-like macros. (CONTIN): Use stabstr_continue, unconditionally. (get_lang_number): Define unconditionally, with ATTRIBUTE_UNUSED. (dbxout_init): Initialize stabstr_ob. Check NO_DBX_MAIN_SOURCE_DIRECTORY. Only write out the Ltext label if it was used. Use the new interfaces. (dbxout_source_file): Remove file argument; always write to asm_out_file. Use the new interfaces. (dbxout_type_method_1): Remove second argument which is always DECL_ASSEMBLER_NAME of the first argument. Use the new interfaces. (dbxout_type_methods): Remove write-only variables. Use the new interfaces. (dbxout_parms): Refactor to remove code duplicated in each of several successive if-else-if blocks. Use the new interfaces. (dbxout_function_end, emit_bincl_stab, dbxout_end_source_file) (dbxout_source_line, dbxout_finish, dbxout_type_index) (dbxout_type_fields, dbxout_range_type, dbxout_type, dbxout_type_name) (dbxout_class_name_qualifiers, dbxout_symbol, dbxout_symbol_location) (dbxout_symbol_name, dbxout_reg_parms, dbxout_args) (dbx_output_lbrac, dbx_output_rbrac, dbxout_block): Use the new interfaces. * Makefile.in (dbxout.o): Update dependencies. * defaults.h: Don't define ASM_STABD_OP. * output.h: Prototype new dbxout_* interfaces. * system.h: Poison DBX_OUTPUT_GCC_MARKER and DBX_FINISH_SYMBOL. * varasm.c: Don't define ASM_STABS_OP. (default_stabs_asm_out_constructor, default_stabs_asm_out_destructor): Use the new dbxout.c interfaces. Call sorry if neither DBX_DEBUGGING_INFO nor XCOFF_DEBUGGING_INFO is defined. * xcoffout.h: Don't define ASM_STABS_OP. (DBX_FINISH_SYMBOL): Rewrite and rename DBX_FINISH_STABS. (DBX_OUTPUT_MAIN_SOURCE_DIRECTORY, DBX_OUTPUT_GCC_MARKER): Delete. (NO_DBX_MAIN_SOURCE_DIRECTORY, NO_DBX_GCC_MARKER): Define. (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Change bare block to do { ... } while (0) idiom. * config/alpha/alpha.c (num_source_filenames): Export. * config/alpha/alpha.h (num_source_filenames): Declare. (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/m32r/m32r.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. Always use .debugsym. Update commentary. * config/mips/mips.h (DBX_OUTPUT_SOURCE_LINE): Use new interfaces. (SDB_OUTPUT_SOURCE_LINE): Add missing newline. * config/rs6000/linux64.h (DBX_OUTPUT_SOURCE_LINE, DBX_OUTPUT_BRAC): Use new interfaces. * config/rs6000/rs6000.c: If TARGET_MACHO, include gstab.h. (macho_branch_islands): Use new interfaces. * doc/tm.texi: Update. From-SVN: r89623
2004-10-27 03:29:42 +02:00
compilation of the main source file @var{name}. Output should be
written to the stdio stream @var{stream}.
1996-09-25 01:21:45 +02:00
If you don't define this macro, nothing special is output at the end
of compilation, which is correct for most machines.
@end defmac
1996-09-25 01:21:45 +02:00
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
@defmac DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
Define this macro @emph{instead of} defining
@code{DBX_OUTPUT_MAIN_SOURCE_FILE_END}, if what needs to be output at
the end of compilation is an @code{N_SO} stab with an empty string,
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
whose value is the highest absolute text address in the file.
@end defmac
1996-09-25 01:21:45 +02:00
@need 2000
@node SDB and DWARF
@subsection Macros for SDB and DWARF Output
@c prevent bad page break with this line
Here are macros for SDB and DWARF output.
@defmac SDB_DEBUGGING_INFO
Define this macro if GCC should produce COFF-style debugging output
for SDB in response to the @option{-g} option.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
debugging output in response to the @option{-g} option.
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} int TARGET_DWARF_CALLING_CONVENTION (const_tree @var{function})
Define this to enable the dwarf attribute @code{DW_AT_calling_convention} to
be emitted for each function. Instead of an integer return the enum
value for the @code{DW_CC_} tag.
@end deftypefn
1997-08-11 17:56:58 +02:00
To support optional call frame debugging information, you must also
define @code{INCOMING_RETURN_ADDR_RTX} and either set
@code{RTX_FRAME_RELATED_P} on the prologue insns if you use RTL for the
prologue, or call @code{dwarf2out_def_cfa} and @code{dwarf2out_reg_save}
Makefile.in (final.o): Depend on target.h. * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. From-SVN: r43817
2001-07-06 20:40:17 +02:00
as appropriate from @code{TARGET_ASM_FUNCTION_PROLOGUE} if you don't.
@end defmac
1997-08-11 17:56:58 +02:00
@defmac DWARF2_FRAME_INFO
Define this macro to a nonzero value if GCC should always output
Dwarf 2 frame information. If @code{TARGET_EXCEPT_UNWIND_INFO}
(@pxref{Exception Region Output}) returns @code{UI_DWARF2}, and
exceptions are enabled, GCC will output this information not matter
how you define @code{DWARF2_FRAME_INFO}.
@end defmac
@deftypefn {Target Hook} {enum unwind_info_type} TARGET_DEBUG_UNWIND_INFO (void)
This hook defines the mechanism that will be used for describing frame
unwind information to the debugger. Normally the hook will return
@code{UI_DWARF2} if DWARF 2 debug information is enabled, and
return @code{UI_NONE} otherwise.
A target may return @code{UI_DWARF2} even when DWARF 2 debug information
is disabled in order to always output DWARF 2 frame information.
A target may return @code{UI_TARGET} if it has ABI specified unwind tables.
This will suppress generation of the normal debug frame unwind information.
@end deftypefn
@defmac DWARF2_ASM_LINE_DEBUG_INFO
Define this macro to be a nonzero value if the assembler can generate Dwarf 2
line debug info sections. This will result in much more compact line number
tables, and hence is desirable if it works.
@end defmac
@deftypevr {Target Hook} bool TARGET_WANT_DEBUG_PUB_SECTIONS
True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them.
@end deftypevr
@deftypevr {Target Hook} bool TARGET_FORCE_AT_COMP_DIR
True if the @code{DW_AT_comp_dir} attribute should be emitted for each compilation unit. This attribute is required for the darwin linker to emit debug information.
@end deftypevr
re PR debug/47590 (pragma optimize doesn't recompute derived options (was: var tracking produces wrong debug in code where optimization is turned off using pragma)) PR debug/47590 * target.def (delay_sched2, delay_vartrack): New. * doc/tm.texi.in: Update. * doc/tm.texi: Rebuild. * sched-rgn.c (gate_handle_sched2): Fail if delay_sched2. * var-tracking.c (gate_handle_var_tracking): Likewise. * config/bfin/bfin.c (bfin_flag_schedule_insns2): Drop. (bfin_flag_var_tracking): Drop. (output_file_start): Don't save and override flag_var_tracking. (bfin_option_override): Ditto flag_schedule_insns_after_reload. (bfin_reorg): Test original variables. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. * config/ia64/ia64.c (ia64_flag_schedule_insns2): Drop. (ia64_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (ia64_file_start): Don't save and override flag_var_tracking. (ia64_override_options_after_change): Ditto flag_schedule_insns_after_reload. (ia64_reorg): Test original variables. * config/picochip/picochip.c (picochip_flag_schedule_insns2): Drop. (picochip_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (picochip_option_override): Don't save and override flag_schedule_insns_after_reload. (picochip_asm_file_start): Ditto flag_var_tracking. (picochip_reorg): Test original variables. * config/spu/spu.c (spu_flag_var_tracking): Drop. (TARGET_DELAY_VARTRACK): Define. (spu_var_tracking): New. (spu_machine_dependent_reorg): Call it. (asm_file_start): Don't save and override flag_var_tracking. From-SVN: r174595
2011-06-03 03:41:54 +02:00
@deftypevr {Target Hook} bool TARGET_DELAY_SCHED2
True if sched2 is not to be run at its normal place.
This usually means it will be run as part of machine-specific reorg.
re PR debug/47590 (pragma optimize doesn't recompute derived options (was: var tracking produces wrong debug in code where optimization is turned off using pragma)) PR debug/47590 * target.def (delay_sched2, delay_vartrack): New. * doc/tm.texi.in: Update. * doc/tm.texi: Rebuild. * sched-rgn.c (gate_handle_sched2): Fail if delay_sched2. * var-tracking.c (gate_handle_var_tracking): Likewise. * config/bfin/bfin.c (bfin_flag_schedule_insns2): Drop. (bfin_flag_var_tracking): Drop. (output_file_start): Don't save and override flag_var_tracking. (bfin_option_override): Ditto flag_schedule_insns_after_reload. (bfin_reorg): Test original variables. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. * config/ia64/ia64.c (ia64_flag_schedule_insns2): Drop. (ia64_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (ia64_file_start): Don't save and override flag_var_tracking. (ia64_override_options_after_change): Ditto flag_schedule_insns_after_reload. (ia64_reorg): Test original variables. * config/picochip/picochip.c (picochip_flag_schedule_insns2): Drop. (picochip_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (picochip_option_override): Don't save and override flag_schedule_insns_after_reload. (picochip_asm_file_start): Ditto flag_var_tracking. (picochip_reorg): Test original variables. * config/spu/spu.c (spu_flag_var_tracking): Drop. (TARGET_DELAY_VARTRACK): Define. (spu_var_tracking): New. (spu_machine_dependent_reorg): Call it. (asm_file_start): Don't save and override flag_var_tracking. From-SVN: r174595
2011-06-03 03:41:54 +02:00
@end deftypevr
@deftypevr {Target Hook} bool TARGET_DELAY_VARTRACK
True if vartrack is not to be run at its normal place.
This usually means it will be run as part of machine-specific reorg.
@end deftypevr
@deftypevr {Target Hook} bool TARGET_NO_REGISTER_ALLOCATION
True if register allocation and the passes
following it should not be run. Usually true only for virtual assembler
targets.
re PR debug/47590 (pragma optimize doesn't recompute derived options (was: var tracking produces wrong debug in code where optimization is turned off using pragma)) PR debug/47590 * target.def (delay_sched2, delay_vartrack): New. * doc/tm.texi.in: Update. * doc/tm.texi: Rebuild. * sched-rgn.c (gate_handle_sched2): Fail if delay_sched2. * var-tracking.c (gate_handle_var_tracking): Likewise. * config/bfin/bfin.c (bfin_flag_schedule_insns2): Drop. (bfin_flag_var_tracking): Drop. (output_file_start): Don't save and override flag_var_tracking. (bfin_option_override): Ditto flag_schedule_insns_after_reload. (bfin_reorg): Test original variables. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. * config/ia64/ia64.c (ia64_flag_schedule_insns2): Drop. (ia64_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (ia64_file_start): Don't save and override flag_var_tracking. (ia64_override_options_after_change): Ditto flag_schedule_insns_after_reload. (ia64_reorg): Test original variables. * config/picochip/picochip.c (picochip_flag_schedule_insns2): Drop. (picochip_flag_var_tracking): Drop. (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define. (picochip_option_override): Don't save and override flag_schedule_insns_after_reload. (picochip_asm_file_start): Ditto flag_var_tracking. (picochip_reorg): Test original variables. * config/spu/spu.c (spu_flag_var_tracking): Drop. (TARGET_DELAY_VARTRACK): Define. (spu_var_tracking): New. (spu_machine_dependent_reorg): Call it. (asm_file_start): Don't save and override flag_var_tracking. From-SVN: r174595
2011-06-03 03:41:54 +02:00
@end deftypevr
@defmac ASM_OUTPUT_DWARF_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
A C statement to issue assembly directives that create a difference
tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. * doc/tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. Use @var to indicate metavariables. * dwarf2asm.h (dw2_asm_output_offset): Add section parameter. * dwarf2asm.c (dw2_asm_output_offset): Add base section parameter. Pass to ASM_OUTPUT_DWARF_OFFSET. * dwarf2out.c (debug_frame_section): New. (output_call_frame_info): Use debug_frame_section. Pass it to dw2_asm_output_offset. (output_die): Pass appropriate section to dw2_asm_output_offset. (output_compilation_unit_header): Likewise. (output_pubnames): Likewise. (output_aranges): Likewise. (enum dw_val_class): Break dw_val_class_lbl_offset into dw_val_class_lineptr and dw_val_class_macptr. (add_AT_lbl_offset): Delete. (add_AT_lineptr): New. (add_AT_macptr): New. (AT_lbl): Expect a lineptr or macptr. (print_die): Handle dw_val_class_lineptr and dw_val_class_macptr. (attr_checksum): Likewise. (same_dw_val_p): Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (dwarf2out_finish): Call add_AT_lineptr and add_AT_macptr instead of add_AT_lbl_offset. * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/i386/i386.c (x86_file_start): Call darwin_file_start. * config/darwin-protos.h (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/rs6000/rs6000.c (rs6000_darwin_file_start): Call darwin_file_start. * config/darwin.c (darwin_emit_unwind_label): Don't output label if not EH section; simplify. (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/darwin.h (DEBUG_FRAME_SECTION): In __DWARF segment, mark as 'debug'. (DEBUG_INFO_SECTION): Likewise. (DEBUG_ABBREV_SECTION): Likewise. (DEBUG_ARANGES_SECTION): Likewise. (DEBUG_MACINFO_SECTION): Likewise. (DEBUG_LINE_SECTION): Likewise. (DEBUG_LOC_SECTION): Likewise. (DEBUG_PUBNAMES_SECTION): Likewise. (DEBUG_STR_SECTION): Likewise. (DEBUG_RANGES_SECTION): Likewise. (FRAME_BEGIN_LABEL): Must start with 'L' in debug section. (ASM_OUTPUT_DWARF_OFFSET): New. From-SVN: r112168
2006-03-17 01:35:32 +01:00
@var{lab1} minus @var{lab2}, using an integer of the given @var{size}.
@end defmac
This patch adds the end prologue and begin epilogue markers in Dwarf2 that are needed by the VMS debugger on I64. * config/ia64/vms.h (ASM_OUTPUT_DWARF_DELTA_UNITS): Remove. (ASM_OUTPUT_DWARF_VMS_DELTA: Define new macro. * dbxout.c (gcc_debug_hooks): New entry begin_epilogue. * debug.c: Likewise. * sdbout.c: Likewise. * vmsdbgout.c: Likewise. * debug.h: Likewise. (dwarf2out_vms_{begin,end}_prologue): Declare. * doc/tm.texi (ASM_OUTPUT_DWARF_VMS_DELTA): Document. * dwarf2asm.c (dw2_asm_output_vms_delta): New function. (ASM_OUTPUT_DWARF_VMS_DELTA): Call it. * dwarf2asm.h (dw2_asm_output_vms_delta): Declare. * dwarf2out.c (dw_fde_struct): New fields dw_fde_vms_{end,begin}_prologue. (PROLOGUE_END_LABEL, EPILOGUE_BEGIN_LABEL): New macros. (dwarf2out_begin_prologue): Set dw_fde_struct defaults for above. (dwarf2out_vms_end_prologue): New function. (dwarf2out_vms_begin_epilogue): New function. (dw_val_struct): New value dw_val_class_vms_delta. (gcc_debug_hooks): New entry begin_epilogue. Set end_prologue, begin_epilogue for VMS. (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): Declare new static functions. (dwarf_attr_name): New cases DW_AT_HP_{prologue,epilogue}. (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): New static functions. (print_die): New case dw_val_class_vms_delta. (attr_checksum): Likewise. (same_dw_val_p: Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (gen_subprogram_die): Call add_AT_vms_delta on VMS. (dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue * dwarf2out.h (dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue * final.c (final_scan_insn): Likewise. Call begin_epilogue. From-SVN: r160858
2010-06-16 21:40:46 +02:00
@defmac ASM_OUTPUT_DWARF_VMS_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2})
A C statement to issue assembly directives that create a difference
between the two given labels in system defined units, e.g. instruction
slots on IA64 VMS, using an integer of the given size.
@end defmac
tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. * doc/tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. Use @var to indicate metavariables. * dwarf2asm.h (dw2_asm_output_offset): Add section parameter. * dwarf2asm.c (dw2_asm_output_offset): Add base section parameter. Pass to ASM_OUTPUT_DWARF_OFFSET. * dwarf2out.c (debug_frame_section): New. (output_call_frame_info): Use debug_frame_section. Pass it to dw2_asm_output_offset. (output_die): Pass appropriate section to dw2_asm_output_offset. (output_compilation_unit_header): Likewise. (output_pubnames): Likewise. (output_aranges): Likewise. (enum dw_val_class): Break dw_val_class_lbl_offset into dw_val_class_lineptr and dw_val_class_macptr. (add_AT_lbl_offset): Delete. (add_AT_lineptr): New. (add_AT_macptr): New. (AT_lbl): Expect a lineptr or macptr. (print_die): Handle dw_val_class_lineptr and dw_val_class_macptr. (attr_checksum): Likewise. (same_dw_val_p): Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (dwarf2out_finish): Call add_AT_lineptr and add_AT_macptr instead of add_AT_lbl_offset. * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/i386/i386.c (x86_file_start): Call darwin_file_start. * config/darwin-protos.h (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/rs6000/rs6000.c (rs6000_darwin_file_start): Call darwin_file_start. * config/darwin.c (darwin_emit_unwind_label): Don't output label if not EH section; simplify. (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/darwin.h (DEBUG_FRAME_SECTION): In __DWARF segment, mark as 'debug'. (DEBUG_INFO_SECTION): Likewise. (DEBUG_ABBREV_SECTION): Likewise. (DEBUG_ARANGES_SECTION): Likewise. (DEBUG_MACINFO_SECTION): Likewise. (DEBUG_LINE_SECTION): Likewise. (DEBUG_LOC_SECTION): Likewise. (DEBUG_PUBNAMES_SECTION): Likewise. (DEBUG_STR_SECTION): Likewise. (DEBUG_RANGES_SECTION): Likewise. (FRAME_BEGIN_LABEL): Must start with 'L' in debug section. (ASM_OUTPUT_DWARF_OFFSET): New. From-SVN: r112168
2006-03-17 01:35:32 +01:00
@defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{section})
A C statement to issue assembly directives that create a
tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. * doc/tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. Use @var to indicate metavariables. * dwarf2asm.h (dw2_asm_output_offset): Add section parameter. * dwarf2asm.c (dw2_asm_output_offset): Add base section parameter. Pass to ASM_OUTPUT_DWARF_OFFSET. * dwarf2out.c (debug_frame_section): New. (output_call_frame_info): Use debug_frame_section. Pass it to dw2_asm_output_offset. (output_die): Pass appropriate section to dw2_asm_output_offset. (output_compilation_unit_header): Likewise. (output_pubnames): Likewise. (output_aranges): Likewise. (enum dw_val_class): Break dw_val_class_lbl_offset into dw_val_class_lineptr and dw_val_class_macptr. (add_AT_lbl_offset): Delete. (add_AT_lineptr): New. (add_AT_macptr): New. (AT_lbl): Expect a lineptr or macptr. (print_die): Handle dw_val_class_lineptr and dw_val_class_macptr. (attr_checksum): Likewise. (same_dw_val_p): Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (dwarf2out_finish): Call add_AT_lineptr and add_AT_macptr instead of add_AT_lbl_offset. * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/i386/i386.c (x86_file_start): Call darwin_file_start. * config/darwin-protos.h (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/rs6000/rs6000.c (rs6000_darwin_file_start): Call darwin_file_start. * config/darwin.c (darwin_emit_unwind_label): Don't output label if not EH section; simplify. (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/darwin.h (DEBUG_FRAME_SECTION): In __DWARF segment, mark as 'debug'. (DEBUG_INFO_SECTION): Likewise. (DEBUG_ABBREV_SECTION): Likewise. (DEBUG_ARANGES_SECTION): Likewise. (DEBUG_MACINFO_SECTION): Likewise. (DEBUG_LINE_SECTION): Likewise. (DEBUG_LOC_SECTION): Likewise. (DEBUG_PUBNAMES_SECTION): Likewise. (DEBUG_STR_SECTION): Likewise. (DEBUG_RANGES_SECTION): Likewise. (FRAME_BEGIN_LABEL): Must start with 'L' in debug section. (ASM_OUTPUT_DWARF_OFFSET): New. From-SVN: r112168
2006-03-17 01:35:32 +01:00
section-relative reference to the given @var{label}, using an integer of the
given @var{size}. The label is known to be defined in the given @var{section}.
@end defmac
@defmac ASM_OUTPUT_DWARF_PCREL (@var{stream}, @var{size}, @var{label})
A C statement to issue assembly directives that create a self-relative
tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. * doc/tm.texi (SDB and DWARF): Add extra parameter to ASM_OUTPUT_DWARF_OFFSET. Use @var to indicate metavariables. * dwarf2asm.h (dw2_asm_output_offset): Add section parameter. * dwarf2asm.c (dw2_asm_output_offset): Add base section parameter. Pass to ASM_OUTPUT_DWARF_OFFSET. * dwarf2out.c (debug_frame_section): New. (output_call_frame_info): Use debug_frame_section. Pass it to dw2_asm_output_offset. (output_die): Pass appropriate section to dw2_asm_output_offset. (output_compilation_unit_header): Likewise. (output_pubnames): Likewise. (output_aranges): Likewise. (enum dw_val_class): Break dw_val_class_lbl_offset into dw_val_class_lineptr and dw_val_class_macptr. (add_AT_lbl_offset): Delete. (add_AT_lineptr): New. (add_AT_macptr): New. (AT_lbl): Expect a lineptr or macptr. (print_die): Handle dw_val_class_lineptr and dw_val_class_macptr. (attr_checksum): Likewise. (same_dw_val_p): Likewise. (size_of_die): Likewise. (value_format): Likewise. (output_die): Likewise. (dwarf2out_finish): Call add_AT_lineptr and add_AT_macptr instead of add_AT_lbl_offset. * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/i386/i386.c (x86_file_start): Call darwin_file_start. * config/darwin-protos.h (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_OFFSET): Add extra parameter. * config/rs6000/rs6000.c (rs6000_darwin_file_start): Call darwin_file_start. * config/darwin.c (darwin_emit_unwind_label): Don't output label if not EH section; simplify. (darwin_file_start): New. (darwin_asm_output_dwarf_offset): New. * config/darwin.h (DEBUG_FRAME_SECTION): In __DWARF segment, mark as 'debug'. (DEBUG_INFO_SECTION): Likewise. (DEBUG_ABBREV_SECTION): Likewise. (DEBUG_ARANGES_SECTION): Likewise. (DEBUG_MACINFO_SECTION): Likewise. (DEBUG_LINE_SECTION): Likewise. (DEBUG_LOC_SECTION): Likewise. (DEBUG_PUBNAMES_SECTION): Likewise. (DEBUG_STR_SECTION): Likewise. (DEBUG_RANGES_SECTION): Likewise. (FRAME_BEGIN_LABEL): Must start with 'L' in debug section. (ASM_OUTPUT_DWARF_OFFSET): New. From-SVN: r112168
2006-03-17 01:35:32 +01:00
reference to the given @var{label}, using an integer of the given @var{size}.
@end defmac
collect2.c (DO_COLLECT_EXPORT_LIST): New internal macro, always defined. * collect2.c (DO_COLLECT_EXPORT_LIST): New internal macro, always defined. Reflect definition or absence of such for COLLECT_EXPORT_LIST. Readability helper. (scanfilter): New enum, to help control what symbols are to be considered or ignored by scan_prog_file. (enum pass): Rename as "scanpass", moved together with scanfilter prior to scan_prog_file's prototype. (scan_prog_file): Accept and honor scanpass and scanfilter arguments. Group prototype with the scanpass/scanfilter definitions, factorize head comments for the several implementations at the prototype. (main): Reorganize the first pass link control to let AIX drag only the needed frame tables in executables. Prevent frame tables collection during the scan aimed at static ctors. Pre-link and scan for frame tables later to compensate. * doc/tm.texi (ASM_OUTPUT_DWARF_TABLE_REF): New macro. A C statement to issue assembly directives that create a reference to the given DWARF table identifier label from the current function section. * dwarf2out.c (switch_to_eh_frame_section): Add a BACK argument to differentiate first time section entry. Only emit a .data tables start identifier label the first time around. (switch_to_frame_table_section): New function. Helper for output_call_frame_info to switch possibly BACK into the eh_frame or the debug_frame section depending on FOR_EH. (output_call_frame_info): Use helper to first enter the proper frame section. (output_fde): Use ASM_OUTPUT_DWARF_TABLE_REF when defined to emit a link to the frame table start label from each function section. * config/rs6000/rs6000.c (rs6000_aix_asm_output_dwarf_table_ref): New function. Implementation of ASM_OUTPUT_DWARF_TABLE_REF. * config/rs6000/rs6000-protos.h: Declare it. * config/rs6000/aix.h (ASM_OUTPUT_DWARF_TABLE_REF): Define. From-SVN: r151157
2009-08-28 11:04:52 +02:00
@defmac ASM_OUTPUT_DWARF_TABLE_REF (@var{label})
A C statement to issue assembly directives that create a reference to
the DWARF table identifier @var{label} from the current section. This
is used on some systems to avoid garbage collecting a DWARF table which
is referenced by a function.
@end defmac
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} void TARGET_ASM_OUTPUT_DWARF_DTPREL (FILE *@var{file}, int @var{size}, rtx @var{x})
re PR debug/21889 (Native Solaris assembler cannot grok DTP-relative debug symbols) PR target/21889 * target.h (gcc_target) <asm_out>: New field output_dwarf_dtprel. * target-def.h (TARGET_ASM_OUTPUT_DWARF_DTPREL): New macro. (TARGET_ASM_OUT): Add it. * doc/tm.texi (Debugging Info): Document it. * dwarf2out.c (output_loc_operands) <INTERNAL_DW_OP_tls_addr>: Test it instead of ASM_OUTPUT_DWARF_DTPREL. (loc_descriptor_from_tree_1) <VAR_DECL>: Likewise. * system.h: Poison ASM_OUTPUT_DWARF_DTPREL. * config/frv/frv-protos.h (frv_output_dwarf_dtprel): Delete. * config/frv/frv.c (frv_output_dwarf_dtprel): Make static and unused. (gen_inlined_tls_plt): Remove unused variable MEM. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to frv_output_dwarf_dtprel. * config/frv/frv.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/i386/i386-protos.h (i386_output_dwarf_dtprel): Delete. * config/i386/i386.c (i386_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to i386_output_dwarf_dtprel. * config/i386/i386.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/ia64/ia64-protos.h (ia64_output_dwarf_dtprel): Delete. * config/ia64/ia64.c (ia64_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to ia64_output_dwarf_dtprel. * config/ia64/ia64.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/rs6000/rs6000-protos.h (rs6000_output_dwarf_dtprel): Delete. * config/rs6000/rs6000.c (rs6000_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to rs6000_output_dwarf_dtprel * config/rs6000/rs6000.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/s390/s390-protos.h (s390_output_dwarf_dtprel): Delete. * config/s390/s390.c (s390_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to s390_output_dwarf_dtprel. * config/s390/s390.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config/sparc/sol2-gas.h (TARGET_SUN_TLS): Define to 0. (TARGET_GNU_TLS): Define to 1. * config/sparc/sparc-protos.h (sparc_output_dwarf_dtprel): Delete. * config/sparc/sparc.c (sparc_output_dwarf_dtprel): Make static and unused. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Define to sparc_output_dwarf_dtprel if TARGET_GNU_TLS only. * config/sparc/sparc.h (ASM_OUTPUT_DWARF_DTPREL): Delete. * config.gcc (sparc64-*-solaris2*): Include tm-dwarf2.h last. (sparc-*-solaris2*): Likewise on Solaris 7 and up. From-SVN: r100742
2005-06-08 07:05:45 +02:00
If defined, this target hook is a function which outputs a DTP-relative
reference to the given TLS symbol of the specified size.
@end deftypefn
@defmac PUT_SDB_@dots{}
1996-09-25 01:21:45 +02:00
Define these macros to override the assembler syntax for the special
SDB assembler directives. See @file{sdbout.c} for a list of these
macros and their arguments. If the standard syntax is used, you need
not define them yourself.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SDB_DELIM
1996-09-25 01:21:45 +02:00
Some assemblers do not support a semicolon as a delimiter, even between
SDB assembler directives. In that case, define this macro to be the
delimiter to use (usually @samp{\n}). It is not necessary to define
a new set of @code{PUT_SDB_@var{op}} macros if this is the only change
required.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SDB_ALLOW_UNKNOWN_REFERENCES
1996-09-25 01:21:45 +02:00
Define this macro to allow references to unknown structure,
union, or enumeration tags to be emitted. Standard COFF does not
allow handling of unknown references, MIPS ECOFF has support for
it.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SDB_ALLOW_FORWARD_REFERENCES
1996-09-25 01:21:45 +02:00
Define this macro to allow references to structure, union, or
enumeration tags that have not yet been seen to be handled. Some
assemblers choke if forward tags are used, while some require it.
@end defmac
1996-09-25 01:21:45 +02:00
dbxout.c (asmfile): Delete. * dbxout.c (asmfile): Delete. All uses changed to asm_out_file. (DBX_BLOCKS_FUNCTION_RELATIVE, DBX_LINES_FUNCTION_RELATIVE): Default to 0. (dbxout_source_line): Use DBX_OUTPUT_SOURCE_LINE when defined. When it is not, but DBX_LINES_FUNCTION_RELATIVE is true, emit an internal label and an N_SLINE .stabn whose value is the difference between that label and the function entry label. (dbxout_finish): If DBX_OUTPUT_MAIN_SOURCE_FILE_END is not defined, but DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END is, emit a label and an N_SO stab with an empty string referring to it. (dbx_output_lbrac, dbx_output_rbrac): Use if statement instead of #ifdef directive to test DBX_BLOCKS_FUNCTION_RELATIVE. (dbxout_type_methods, dbxout_symbol): Remove #if 0 block. (dbxout_prepare_symbol): Remove #ifdef WINNING_GDB block, this macro is never defined. * sdbout.c (sdbout_source_line_counter): Delete. (PUT_SDB_SRC_FILE): Delete. Uses replaced with sole definition. (sdbout_source_line): Use SDB_OUTPUT_SOURCE_LINE, which takes only two arguments. * xcoffout.c (ASM_OUTPUT_SOURCE_LINE): Rename ASM_OUTPUT_LINE. * config/dbxcoff.h, config/dbxelf.h: Remove unncessary #undefs. * config/c4x/c4x.h, config/pa/pa.h: Remove unnecessary macro definitions (identical to default). * config/darwin.h, config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/h8300/coff.h, config/pa/som.h, config/sh/elf.h: Define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END, not DBX_OUTPUT_MAIN_SOURCE_FILE_END. * config/dbxcoff.h, config/dbxelf.h, config/ptx4.h * config/mcore/mcore-pe.h, config/pa/som.h, config/sh/elf.h: Define DBX_LINES_FUNCTION_RELATIVE, not ASM_OUTPUT_SOURCE_LINE. * config/alpha/alpha-protos.h: Don't prototype alpha_output_lineno. * config/alpha/alpha.c: Move declaration of num_source_filenames up. (alpha_start_function): Use SDB_OUTPUT_SOURCE_LINE. (sym_lineno): Delete. (alpha_output_filename): Do not emit N_SOL stabs here. Remove now-unused variable. (alpha_output_lineno): Delete. * config/mips/mips-protos.h: Don't prototype mips_output_lineno. * config/mips/mips.c (mips_output_filename): Don't use ASM_OUTPUT_FILENAME. Don't emit N_SOL stabs here. (mips_output_lineno): Delete. (mips_output_function_prologue: Use SDB_OUTPUT_SOURCE_LINE. * config/alpha/alpha.h: Define DBX_OUTPUT_SOURCE_LINE and SDB_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/mips/mips.h: Likewise. Don't define ASM_OUTPUT_FILENAME. * config/mips/sdb.h: Use SDB_OUTPUT_SOURCE_LINE. * config/avr/avr.h: Don't define ASM_OUTPUT_SOURCE_LINE. * config/mmix/mmix.h: Likewise. * config/mmix/mmix.c (mmix_asm_output_source_line): Delete. * config/mmix/mmix-protos.h: Don't prototype it. * config/alpha/unicosmk.h: Also #undef PREFERRED_DEBUGGING_TYPE; no need to #undef ASM_OUTPUT_SOURCE_LINE. * config/arm/aout.h: Remove RISCiX-specific definition of DBX_OUTPUT_MAIN_SOURCE_FILENAME. * config/m32r/m32r.h: Define DBX_OUTPUT_SOURCE_LINE, not ASM_OUTPUT_SOURCE_LINE. * config/rs6000/rs6000.h: (ASM_OUTPUT_SOURCE_LINE): Rename DBX_OUTPUT_SOURCE_LINE. Don't use current_function_func_begin_label. * config/vax/elf.h: No need to define DBX_OUTPUT_FUNCTION_END. * doc/tm.texi: Update. From-SVN: r89357
2004-10-21 02:53:47 +02:00
@defmac SDB_OUTPUT_SOURCE_LINE (@var{stream}, @var{line})
A C statement to output SDB debugging information before code for line
number @var{line} of the current source file to the stdio stream
@var{stream}. The default is to emit an @code{.ln} directive.
@end defmac
@need 2000
@node VMS Debug
@subsection Macros for VMS Debug Format
@c prevent bad page break with this line
Here are macros for VMS debug format.
@defmac VMS_DEBUGGING_INFO
Define this macro if GCC should produce debugging output for VMS
in response to the @option{-g} option. The default behavior for VMS
is to generate minimal debug info for a traceback in the absence of
@option{-g} unless explicitly overridden with @option{-g0}. This
target.def (target_option.optimization): New hook. * target.def (target_option.optimization): New hook. * doc/tm.texi.in (OPTIMIZATION_OPTIONS): Change to TARGET_OPTION_OPTIMIZATION hook. * doc/tm.texi: Regenerate. * hooks.c (hook_void_int_int): New. * hooks.h (hook_void_int_int): Declare. * opts.c: Don't include tm_p.h. (decode_options): Use targetm.target_option.optimization instead of OPTIMIZATION_OPTIONS. * system.h (OPTIMIZATION_OPTIONS): Poison. * config/arm/arm-protos.h (arm_optimization_options): Remove. * config/arm/arm.c (TARGET_OPTION_OPTIMIZATION): Define. (arm_optimization_options): Rename to arm_option_optimization. Make static. * config/arm/arm.h (OPTIMIZATION_OPTIONS): Remove. * config/cris/cris.c (TARGET_OPTION_OPTIMIZATION): Define. (cris_option_optimization): New. * config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove. * config/crx/crx.c (TARGET_OPTION_OPTIMIZATION): Define. (crx_option_optimization): New. * config/crx/crx.h (OPTIMIZATION_OPTIONS): Remove. * config/frv/frv-protos.h (frv_optimization_options): Remove. * config/frv/frv.c (TARGET_OPTION_OPTIMIZATION): Define. (frv_optimization_options): Rename to frv_option_optimization. Make static. * config/frv/frv.h (OPTIMIZATION_OPTIONS): Remove. * config/h8300/h8300.c (h8300_option_optimization): New. (TARGET_OPTION_OPTIMIZATION): Define. * config/h8300/h8300.h (OPTIMIZATION_OPTIONS): Remove. * config/i386/i386-protos.h (optimization_options): Remove. * config/i386/i386.c (optimization_options): Rename to ix86_option_optimization. Make static. (TARGET_OPTION_OPTIMIZATION): Define. * config/i386/i386.h (OPTIMIZATION_OPTIONS): Remove. * config/ia64/ia64-protos.h (ia64_optimization_options): Remove. * config/ia64/ia64.c (TARGET_OPTION_OPTIMIZATION): Define. (ia64_optimization_options): Rename to ia64_option_optimization. Make static. Call SUBTARGET_OPTIMIZATION_OPTIONS. * config/ia64/ia64.h (OPTIMIZATION_OPTIONS): Remove. Remove commented-out definition. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define instead of OPTIMIZATION_OPTIONS. * config/m32r/m32r.c (TARGET_OPTION_OPTIMIZATION): Define. (m32r_option_optimization): New. * config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options): Remove. * config/mcore/mcore.c (TARGET_OPTION_OPTIMIZATION): Define. (mcore_option_optimization): New. * config/mcore/mcore.h (OPTIMIZATION_OPTIONS): Remove. * config/mep/mep-protos.h (mep_optimization_options): Remove. * config/mep/mep.c (TARGET_OPTION_OPTIMIZATION): Define. (mep_optimization_options): Rename to mep_option_optimization. Make static. Take unused level and size parameters. * config/mep/mep.h (OPTIMIZATION_OPTIONS): Remove. * config/mmix/mmix.c (TARGET_OPTION_OPTIMIZATION): Define. (mmix_option_optimization): New. * config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove. * config/pdp11/pdp11.c (TARGET_OPTION_OPTIMIZATION): Define. (pdp11_option_optimization): New. * config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Remove. * config/rs6000/rs6000-protos.h (optimization_options): Remove. * config/rs6000/rs6000.c (TARGET_OPTION_OPTIMIZATION): Define. (optimization_options): Rename to rs6000_option_optimization. Make static. * config/rs6000/rs6000.h (OPTIMIZATION_OPTIONS): Remove. * config/rx/rx-protos.h (rx_set_optimization_options): Remove. * config/rx/rx.c (rx_set_optimization_options): Rename to rx_option_optimization. Make static. Take unused level and size parameters. (TARGET_OPTION_OPTIMIZATION): Define. * config/rx/rx.h (OPTIMIZATION_OPTIONS): Remove. * config/s390/s390-protos.h (optimization_options): Remove. * config/s390/s390.c (optimization_options): Rename to s390_option_optimization. Make static. Don't mark size parameter unused. (TARGET_OPTION_OPTIMIZATION): Define. * config/s390/s390.h (OPTIMIZATION_OPTIONS): Remove. * config/sh/sh-protos.h (sh_optimization_options): Remove. * config/sh/sh.c (TARGET_OPTION_OPTIMIZATION): Define. (sh_optimization_options): Rename to sh_option_optimization. Make static. Don't mark parameters unused. * config/sh/sh.h (OPTIMIZATION_OPTIONS): Remove. * config/spu/spu-protos.h (spu_optimization_options): Remove. * config/spu/spu.c (TARGET_OPTION_OPTIMIZATION): Define. (spu_optimization_options): Rename to spu_option_optimization. Make static. * config/spu/spu.h (OPTIMIZATION_OPTIONS): Remove. * config/v850/v850.c (TARGET_OPTION_OPTIMIZATION): Define. (v850_option_optimization): New. * config/v850/v850.h (OPTIMIZATION_OPTIONS): Remove. * config/xtensa/xtensa.c (TARGET_OPTION_OPTIMIZATION): Define. (xtensa_option_optimization): New. * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Remove. From-SVN: r164335
2010-09-16 14:04:29 +02:00
behavior is controlled by @code{TARGET_OPTION_OPTIMIZATION} and
@code{TARGET_OPTION_OVERRIDE}.
@end defmac
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
@node Floating Point
1996-09-25 01:21:45 +02:00
@section Cross Compilation and Floating Point
@cindex cross compilation and floating point
@cindex floating point and cross compilation
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
While all modern machines use twos-complement representation for integers,
1996-09-25 01:21:45 +02:00
there are a variety of representations for floating point numbers. This
means that in a cross-compiler the representation of floating point numbers
in the compiled program may be different from that used in the machine
doing the compilation.
Because different representation systems may offer different amounts of
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
range and precision, all floating point constants must be represented in
the target machine's format. Therefore, the cross compiler cannot
safely use the host machine's floating point arithmetic; it must emulate
the target's arithmetic. To ensure consistency, GCC always uses
emulation to work with floating point values, even when the host and
target floating point formats are identical.
The following macros are provided by @file{real.h} for the compiler to
use. All parts of the compiler which generate or optimize
emit-rtl.c, [...]: Remove all #ifndef REAL_ARITHMETIC blocks... * emit-rtl.c, final.c, fold-const.c, gengenrtl.c, optabs.c, print-tree.c, real.c, real.h, recog.c, rtl.c, simplify-rtx.c, tree.c, config/m68k/m68k.c, f/com.c, f/target.h, java/expr.c, java/jcf-parse.c, java/lex.c: Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef REAL_ARITHMETIC blocks unconditional. Delete some further #ifdef blocks predicated on REAL_ARITHMETIC. * flags.h, toplev.c: Delete remaining references to flag_pretend_float. * doc/invoke.texi: Remove documentation of -fpretend-float. * doc/tm.texi: Describe the various REAL_* macros as provided by real.h, not by the target configuration files. * config/alpha/alpha.h, config/alpha/unicosmk.h, config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h, config/convex/convex.h, config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h, config/h8300/h8300.h, config/i370/i370.h, config/i386/i386.h, config/i386/osf1elf.h, config/i960/i960.h, config/ia64/ia64.h, config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/dpx2.h, config/m68k/linux-aout.h, config/m68k/linux.h, config/m68k/m68k.h, config/m68k/sun3.h, config/m68k/vxm68k.h, config/mcore/mcore.h, config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h, config/mn10300/mn10300.h, config/pa/pa.h, config/pj/pj.h, config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.h, config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h, config/sparc/sol2.h, config/sparc/sparc.h, config/sparc/vxsim.h, config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Do not define, undefine, or mention in comments any of REAL_ARITHMETIC, REAL_VALUE_ATOF, REAL_VALUE_HTOF, REAL_VALUE_ISNAN, REAL_VALUE_ISINF, REAL_VALUE_TO_TARGET_SINGLE, REAL_VALUE_TO_TARGET_DOUBLE, REAL_VALUE_TO_TARGET_LONG_DOUBLE, REAL_VALUE_TO_DECIMAL, REAL_VALUE_TYPE, REAL_VALUES_EQUAL, REAL_VALUES_LESS, REAL_VALUE_LDEXP, REAL_VALUE_FIX, REAL_VALUE_UNSIGNED_FIX, REAL_VALUE_RNDZINT, REAL_VALUE_UNSIGNED_RNDZINT, REAL_INFINITY, REAL_VALUE_NEGATE, REAL_VALUE_TRUNCATE, REAL_VALUE_TO_INT, or REAL_VALUE_FROM_INT. From-SVN: r50263
2002-03-03 22:10:09 +01:00
floating-point calculations must use these macros. They may evaluate
their operands more than once, so operands must not have side effects.
1996-09-25 01:21:45 +02:00
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
@defmac REAL_VALUE_TYPE
The C data type to be used to hold a floating point value in the target
machine's format. Typically this is a @code{struct} containing an
array of @code{HOST_WIDE_INT}, but all code should treat it as an opaque
quantity.
@end defmac
@deftypefn Macro int REAL_VALUES_EQUAL (REAL_VALUE_TYPE @var{x}, REAL_VALUE_TYPE @var{y})
Compares for equality the two values, @var{x} and @var{y}. If the target
floating point format supports negative zeroes and/or NaNs,
@samp{REAL_VALUES_EQUAL (-0.0, 0.0)} is true, and
@samp{REAL_VALUES_EQUAL (NaN, NaN)} is false.
@end deftypefn
@deftypefn Macro int REAL_VALUES_LESS (REAL_VALUE_TYPE @var{x}, REAL_VALUE_TYPE @var{y})
Tests whether @var{x} is less than @var{y}.
@end deftypefn
@deftypefn Macro HOST_WIDE_INT REAL_VALUE_FIX (REAL_VALUE_TYPE @var{x})
Truncates @var{x} to a signed integer, rounding toward zero.
@end deftypefn
@deftypefn Macro {unsigned HOST_WIDE_INT} REAL_VALUE_UNSIGNED_FIX (REAL_VALUE_TYPE @var{x})
Truncates @var{x} to an unsigned integer, rounding toward zero. If
@var{x} is negative, returns zero.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_ATOF (const char *@var{string}, machine_mode @var{mode})
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
Converts @var{string} into a floating point number in the target machine's
representation for mode @var{mode}. This routine can handle both
decimal and hexadecimal floating point constants, using the syntax
defined by the C language for both.
@end deftypefn
1996-09-25 01:21:45 +02:00
@deftypefn Macro int REAL_VALUE_NEGATIVE (REAL_VALUE_TYPE @var{x})
tm.texi (Run-time Target): Add comment about flag_iso and strict ANSI. 2002-06-11 Eric Christopher <echristo@redhat.com> * doc/tm.texi (Run-time Target): Add comment about flag_iso and strict ANSI. * config/mips/ecoff.h (CPP_PREDEFINES): Remove. * config/mips/ecoffl.h: Ditto. * config/mips/elf64.h (SUBTARGET_CPP_SPEC): Remove. (CPP_PREDEFINES): Ditto. * config/mips/elfl64.h: Ditto. * config/mips/elfl.h: Ditto. * config/mips/iris3.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): #if 0 out until irix header consolidation. * config/mips/iris5.h (CPP_PREDEFINES, SUBTARGET_CPP_SPEC): Replace with SUBTARGET_OS_CPP_BUILTINS. * config/mips/iris6.h: Ditto. (CPLUSPLUS_CPP_SPEC): Remove. * config/mips/linux.h: Ditto. * config/mips/netbsd.h: Ditto. * config/mips/openbsd.h: Ditto. * config/mips/rtems.h: Ditto. * config/mips/rtems64.h: Ditto. * config/mips/sni-svr4.h: Ditto. * config/mips/mips.h (ISA_MIPS1, ISA_MIPS2, ISA_MIPS3, ISA_MIPS4, ISA_MIPS32, ISA_MIPS64): New defines. (GENERATE_MULT3_SI, HAVE_SQRT_P, ISA_HAS_64BIT_REGS, ISA_HAS_BRANCHLIKELY, ISA_HAS_CONDMOVE, ISA_HAS_8CC, ISA_HAS_FP4, ISA_HAS_COND_TRAP, ISA_HAS_MADD_MSUB, ISA_HAS_NMADD_NMSUB, ISA_HAS_CLZ_CLO, ISA_HAS_DCLZ_DCLO): Use. (TARGET_CPU_CPP_BUILTINS): Define. (CPP_PREDEFINES, LONG_MAX_SPEC, CPP_FPR_SPEC, CPP_SPEC): Remove. * config/mips/mips.md (mulsi3_mult3): Use ISA_MIPS32/64. (movdicc): Remove check for ISA_MIPS32. (bunordered, bordered, bungt, bunlt, buneq, bunge, bunle, sunordered_df, sunordered_sf, sordered_df, sordered_sf, sunlt_df, sunlt_sf, sungt_df, sungt_sf, suneq_df, suneq_sf, sunge_df, sunge_sf, sunle_df, sunle_sf): New patterns. From-SVN: r54493
2002-06-11 09:26:38 +02:00
Returns 1 if @var{x} is negative (including negative zero), 0 otherwise.
@end deftypefn
real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. * real.h: Don't define REAL_INFINITY or REAL_IS_NOT_DOUBLE. Always make REAL_VALUE_TYPE a struct containing an array of HOST_WIDE_INT, not a double. Tidy up the code deciding how big it is. Don't declare or use union real_extract. * emit-rtl.c (init_emit_once), varasm.c (immed_real_const_1, decode_rtx_const, output_constant_pool), config/a29k/a29k.c (print_operand), config/arm/arm.c (output_move_double), config/arm/arm.md (consttable_4, consttable_8), config/romp/romp.c (output_fpops), config/s390/s390.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY), config/xtensa/xtensa.c (xtensa_output_literal): Don't use union real_extract. * config/dsp16xx/dsp16xx.c (print_operand), config/i860/i860.c (sfmode_constant_to_ulong), config/ns32k/merlin.h (PRINT_OPERAND), config/ns32k/ns32k.c (print_operand), config/pdp11/pdp11.h (PRINT_OPERAND), config/we32k/we32k.h (PRINT_OPERAND): Don't use local version of union real_extract. * config/convex/convex.c (check_float_value), config/vax/vax.c (vax_float_literal), config/m88k/m88k.md (divdf3), config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2), config/pdp11/pdp11.c (output_move_quad): Don't do host arithmetic on target floating point quantities. * config/a29k/a29k.md, config/dsp16xx/dsp16xx.c (output_dsp16xx_float_const): Don't test HOST_FLOAT_FORMAT. * fold-const.c (fold), simplify-rtx.c (simplify_binary_real): Use MODE_HAS_INFINITIES rather than #ifdef REAL_INFINITY. * real.c (earith): Test INFINITY rather than REAL_INFINITY; NANS implies INFINITY, so can drop #ifdef NANS inside #ifndef INFINITY. * print-rtl.c (print_rtx): Disable code which needs floating-point emulator. * libgcc2.c: Include float.h and use DBL_MANT_DIG, FLT_MANT_DIG, to define DF_SIZE and SF_SIZE, rather than depending on HOST_FLOAT_FORMAT to be defined properly. * ch/grant.c, cp/error.c: Always use REAL_VALUE_TO_DECIMAL; don't test REAL_IS_NOT_DOUBLE. * config/1750a/1750a.c (get_double, float_label): Delete. (print_operand): Delete huge commented-out chunk. Use REAL_VALUE_TO_DECIMAL. * config/1750a/1750a-protos.h: Delete prototypes of deleted functions. * config/convex/convex.h: Always set TARGET_FLOAT_FORMAT to IEEE_FLOAT_FORMAT. * config/i370/i370.h (PRINT_OPERAND [TARGET_HLASM version]): Use REAL_VALUE_TO_DECIMAL as ELF version does. * config/m88k/m88k.c (real_power_of_2_operand, legitimize_operand): Take the REAL_VALUE_TYPE and/or union real_extract out of the union; run the input through REAL_VALUE_TO_TARGET_DOUBLE, then plug the pair of longwords from that into the union. * config/pdp11/pdp11.c (output_move_double): Rearrange parentheses to make automatic indenter happy. * doc/tm.texi (Cross-compilation): Rename node to "Floating Point" and rewrite to describe current situation. Also adjust documentation of REAL_VALUE_TO_TARGET_SINGLE and friends to match code. * doc/rtl.texi: Adjust cross reference. From-SVN: r51210
2002-03-23 02:10:56 +01:00
@deftypefn Macro int REAL_VALUE_ISINF (REAL_VALUE_TYPE @var{x})
Determines whether @var{x} represents infinity (positive or negative).
@end deftypefn
@deftypefn Macro int REAL_VALUE_ISNAN (REAL_VALUE_TYPE @var{x})
Determines whether @var{x} represents a ``NaN'' (not-a-number).
@end deftypefn
@deftypefn Macro void REAL_ARITHMETIC (REAL_VALUE_TYPE @var{output}, enum tree_code @var{code}, REAL_VALUE_TYPE @var{x}, REAL_VALUE_TYPE @var{y})
Calculates an arithmetic operation on the two floating point values
@var{x} and @var{y}, storing the result in @var{output} (which must be a
variable).
The operation to be performed is specified by @var{code}. Only the
following codes are supported: @code{PLUS_EXPR}, @code{MINUS_EXPR},
@code{MULT_EXPR}, @code{RDIV_EXPR}, @code{MAX_EXPR}, @code{MIN_EXPR}.
If @code{REAL_ARITHMETIC} is asked to evaluate division by zero and the
target's floating point format cannot represent infinity, it will call
@code{abort}. Callers should check for this situation first, using
@code{MODE_HAS_INFINITIES}. @xref{Storage Layout}.
@end deftypefn
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_NEGATE (REAL_VALUE_TYPE @var{x})
Returns the negative of the floating point value @var{x}.
@end deftypefn
@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_ABS (REAL_VALUE_TYPE @var{x})
Returns the absolute value of @var{x}.
@end deftypefn
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
@node Mode Switching
@section Mode Switching Instructions
@cindex mode switching
The following macros control mode switching optimizations:
@defmac OPTIMIZE_MODE_SWITCHING (@var{entity})
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
Define this macro if the port needs extra instructions inserted for mode
switching in an optimizing compilation.
For an example, the SH4 can perform both single and double precision
floating point operations, but to perform a single precision operation,
the FPSCR PR bit has to be cleared, while for a double precision
operation, this bit has to be set. Changing the PR bit requires a general
purpose register as a scratch register, hence these FPSCR sets have to
be inserted before reload, i.e.@: you can't put this into instruction emitting
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
or @code{TARGET_MACHINE_DEPENDENT_REORG}.
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
You can have multiple entities that are mode-switched, and select at run time
which entities actually need it. @code{OPTIMIZE_MODE_SWITCHING} should
return nonzero for any @var{entity} that needs mode-switching.
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
If you define this macro, you also have to define
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@code{NUM_MODES_FOR_MODE_SWITCHING}, @code{TARGET_MODE_NEEDED},
@code{TARGET_MODE_PRIORITY} and @code{TARGET_MODE_EMIT}.
@code{TARGET_MODE_AFTER}, @code{TARGET_MODE_ENTRY}, and @code{TARGET_MODE_EXIT}
are optional.
@end defmac
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
@defmac NUM_MODES_FOR_MODE_SWITCHING
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
If you define @code{OPTIMIZE_MODE_SWITCHING}, you have to define this as
initializer for an array of integers. Each initializer element
N refers to an entity that needs mode switching, and specifies the number
of different modes that might need to be set for this entity.
The position of the initializer in the initializer---starting counting at
zero---determines the integer that is used to refer to the mode-switched
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
entity in question.
In macros that take mode arguments / yield a mode result, modes are
represented as numbers 0 @dots{} N @minus{} 1. N is used to specify that no mode
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
switch is needed / supplied.
@end defmac
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
@deftypefn {Target Hook} void TARGET_MODE_EMIT (int @var{entity}, int @var{mode}, int @var{prev_mode}, HARD_REG_SET @var{regs_live})
Generate one or more insns to set @var{entity} to @var{mode}. @var{hard_reg_live} is the set of hard registers live at the point where the insn(s) are to be inserted. @var{prev_moxde} indicates the mode to switch from. Sets of a lower numbered entity will be emitted before sets of a higher numbered entity to a mode of the same or lower priority.
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@end deftypefn
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_MODE_NEEDED (int @var{entity}, rtx_insn *@var{insn})
@var{entity} is an integer specifying a mode-switched entity. If @code{OPTIMIZE_MODE_SWITCHING} is defined, you must define this macro to return an integer value not larger than the corresponding element in @code{NUM_MODES_FOR_MODE_SWITCHING}, to denote the mode that @var{entity} must be switched into prior to the execution of @var{insn}.
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} int TARGET_MODE_AFTER (int @var{entity}, int @var{mode}, rtx_insn *@var{insn})
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@var{entity} is an integer specifying a mode-switched entity. If this macro is defined, it is evaluated for every @var{insn} during mode switching. It determines the mode that an insn results in (if different from the incoming mode).
@end deftypefn
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@deftypefn {Target Hook} int TARGET_MODE_ENTRY (int @var{entity})
If this macro is defined, it is evaluated for every @var{entity} that needs mode switching. It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function entry. If @code{TARGET_MODE_ENTRY} is defined then @code{TARGET_MODE_EXIT} must be defined.
@end deftypefn
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@deftypefn {Target Hook} int TARGET_MODE_EXIT (int @var{entity})
If this macro is defined, it is evaluated for every @var{entity} that needs mode switching. It should evaluate to an integer, which is a mode that @var{entity} is assumed to be switched to at function exit. If @code{TARGET_MODE_EXIT} is defined then @code{TARGET_MODE_ENTRY} must be defined.
@end deftypefn
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
target.def (mode_switching): New hook vector. 2014-05-13 Christian Bruel <christian.bruel@st.com> * target.def (mode_switching): New hook vector. (mode_emit, mode_needed, mode_after, mode_entry): New hooks. (mode_exit, modepriority_to_mode): Likewise. * mode-switching.c (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Hookify. (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. (default_priority_to_mode): Define. * targhooks.h (default_priority_to_mode): Declare. * target.h: Include tm.h and hard-reg-set.h. * doc/tm.texi.in (EMIT_MODE_SET, MODE_NEEDED, MODE_AFTER, MODE_ENTRY) (MODE_EXIT, MODE_PRIORITY_TO_MODE): Delete and hookify. * doc/tm.texi Regenerate. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh_emit_mode_set, sh_mode_priority): Hookify. (sh_mode_needed, sh_mode_after, sh_mode_entry, sh_mode_exit): Likewise. * config/i386/i386.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/i386/i386-protos.h (ix86_mode_needed, ix86_mode_after) (ix86_mode_entrym, ix86_emit_mode_set): Remove external declaration. * config/i386/i386.c (ix86_mode_needed, ix86_mode_after, ix86_mode_exit, (ix86_mode_entry, ix86_mode_priority, ix86_emit_mode_set): Hookify. * config/epiphany/epiphany.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.h (MODE_NEEDED, MODE_AFTER, MODE_ENTRY): Delete (MODE_EXIT, MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * config/sh/sh.c (sh4_emit_mode_set, sh4_mode_needed): Hookify. (sh4_mode_after, sh4_mode_entry, sh4_mode_exit): Likewise. * config/epiphany/epiphany-protos.h (epiphany_mode_needed) (emit_set_fp_mode, epiphany_mode_entry_exit, epiphany_mode_after) (epiphany_mode_priority_to_mode): Remove declaration. * config/epiphany/epiphany.c (emit_set_fp_mode): Hookify. (epiphany_mode_needed, epiphany_mode_priority_to_mode): Likewise. (epiphany_mode_entry, epiphany_mode_exit, epiphany_mode_after): Likewise. (epiphany_mode_priority_to_mode): Change priority type. Hookify. (epiphany_mode_needed, epiphany_mode_entry_exit): Hookify. (epiphany_mode_after, epiphany_mode_entry, emit_set_fp_mode): Hookify. From-SVN: r210354
2014-05-13 10:50:51 +02:00
@deftypefn {Target Hook} int TARGET_MODE_PRIORITY (int @var{entity}, int @var{n})
This macro specifies the order in which modes for @var{entity} are processed. 0 is the highest priority, @code{NUM_MODES_FOR_MODE_SWITCHING[@var{entity}] - 1} the lowest. The value of the macro should be an integer designating a mode for @var{entity}. For any fixed @var{entity}, @code{mode_priority} (@var{entity}, @var{n}) shall be a bijection in 0 @dots{} @code{num_modes_for_mode_switching[@var{entity}] - 1}.
@end deftypefn
Makefile.in (lcm.o): Depend on insn-attr.h. * Makefile.in (lcm.o): Depend on insn-attr.h. * basic-block.h (optimize_mode_switching): Declare. * lcm.c (tm_p.h, insn-attr.h): #include. (seginfo, bb_info): New structs. (antic, transp, comp, delete, insert) : New file-scope static variables. (new_seginfo, add_seginfo, make_preds_opaque, reg_dies): New functions. (reg_becomes_live, optimize_mode_switching): Likewise. * tm.texi: Add description of mode switching macros. * toplev.c (rest_of_compilation): Call optimize_mode_switching. * sh-protos.h (remove_dead_before_cse): Remove prototype. (fldi_ok, fpscr_set_from_mem): New prototypes. * sh.h (OPTIMIZATION_OPTION): Remove sh_flag_remove_dead_before_cse set. (CONST_DOUBLE_OK_FOR_LETTER_P, SECONDARY_INPUT_RELOAD_CLASS): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (sh_flag_remove_dead_before_cse): Remove declaration. (NUM_MODES_FOR_MODE_SWITCHING, OPTIMIZE_MODE_SWITCHING): New macros. (MODE_USES_IN_EXIT_BLOCK, MODE_NEEDED, MODE_AT_ENTRY): Likewise. (MODE_PRIORITY_TO_MODE, EMIT_MODE_SET): Likewise. * sh.c (broken_move): Disable fldi for (TARGET_SH4 && ! TARGET_FMOVD). (barrier_align): Allow for JUMP_INSNS containing a parallel. (machine_dependent_reorg): Remove sh_flag_remove_dead_before_cse set. (fldi_ok): New function. (get_fpscr_rtx): Add fpscr_rtx as GC root. (emit_sf_insn): Only generate fpu switches when optimize < 1. (emit_df_insn): Likewise. (expand_fp_branch, emit_fpscr_use, remove_dead_before_cse): Delete. (sh_flag_remove_dead_before_cse): Delete. (get_free_reg, fpscr_set_from_mem): New functions. * sh.md (movdf, movsf): Remove no_new_pseudos code. (return): Remove emit_fpscr_use / remove_dead_before_cse calls. Co-Authored-By: Andrew MacLeod <amacleod@cygnus.com> From-SVN: r31990
2000-02-15 23:34:33 +01:00
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@node Target Attributes
@section Defining target-specific uses of @code{__attribute__}
@cindex target attributes
@cindex machine attributes
@cindex attributes, target-specific
Target-specific attributes may be defined for functions, data and types.
These are described using the following target hooks; they also need to
be documented in @file{extend.texi}.
@deftypevr {Target Hook} {const struct attribute_spec *} TARGET_ATTRIBUTE_TABLE
If defined, this target hook points to an array of @samp{struct
attribute_spec} (defined in @file{tree.h}) specifying the machine
specific attributes for this target and some of the restrictions on the
entities to which these attributes are applied and the arguments they
take.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_ATTRIBUTE_TAKES_IDENTIFIER_P (const_tree @var{name})
If defined, this target hook is a function which returns true if the
machine-specific attribute named @var{name} expects an identifier
given as its first argument to be passed on as a plain identifier, not
subjected to name lookup. If this is not defined, the default is
false for all machine-specific attributes.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} int TARGET_COMP_TYPE_ATTRIBUTES (const_tree @var{type1}, const_tree @var{type2})
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
If defined, this target hook is a function which returns zero if the attributes on
@var{type1} and @var{type2} are incompatible, one if they are compatible,
and two if they are nearly compatible (which causes a warning to be
generated). If this is not defined, machine-specific attributes are
supposed always to be compatible.
@end deftypefn
@deftypefn {Target Hook} void TARGET_SET_DEFAULT_TYPE_ATTRIBUTES (tree @var{type})
If defined, this target hook is a function which assigns default attributes to
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
the newly defined @var{type}.
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@end deftypefn
@deftypefn {Target Hook} tree TARGET_MERGE_TYPE_ATTRIBUTES (tree @var{type1}, tree @var{type2})
Define this target hook if the merging of type attributes needs special
handling. If defined, the result is a list of the combined
@code{TYPE_ATTRIBUTES} of @var{type1} and @var{type2}. It is assumed
that @code{comptypes} has already been called and returned 1. This
function may call @code{merge_attributes} to handle machine-independent
merging.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_MERGE_DECL_ATTRIBUTES (tree @var{olddecl}, tree @var{newdecl})
Define this target hook if the merging of decl attributes needs special
handling. If defined, the result is a list of the combined
@code{DECL_ATTRIBUTES} of @var{olddecl} and @var{newdecl}.
@var{newdecl} is a duplicate declaration of @var{olddecl}. Examples of
when this is needed are when one attribute overrides another, or when an
attribute is nullified by a subsequent definition. This function may
call @code{merge_attributes} to handle machine-independent merging.
@findex TARGET_DLLIMPORT_DECL_ATTRIBUTES
tree.c (handle_dll_attribute): Move here from i383/winnt.c. * tree.c (handle_dll_attribute): Move here from i383/winnt.c. Replace use of DECL_INLINE with DECL_DECLARED_INLINE_P. Set DECL_VISIBLITY. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. * tree.h (handle_dll_attribute): Declare. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. * c-common.h (c_determine_visibility): Declare. * c-common.c (c_determine_visibility): New function. * c-decl.c (finish_decl): Use it. (finish_function): Likewise. * defaults.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define it to zero, by default. Use #if, not #ifdef, to test it. * config/arm/arm.c (arm_attribute_table): Use handle_dll_attribute. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. * config/arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define to 1. * config/i386/cygming.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define to 1. * config/i386/i386-protos.h (ix86_handle_dll_attribute): Remove. * config/i386/i386.c (ix86_attribute_table): Use handle_dll_attribute for dllimport/dllexport. Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if. * config/i386/winnt.c (ix86_handle_dll_attribute): Remove. * config/mcore/mcore.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define it to 1. * config/mcore/mcore.c (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Test it with #if. * config/sh/symbian-pre.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define it to 1. * doc/extend.texi (dllexport): Clarify and correct documentation. (dllimport): Likewise. * doc/tm.texi (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Mention handle_dll_attribute. * decl.c (start_preparsed_function): Move determine_visibility call. * decl2.c (determine_visibility): Incorporate dllexport testing. * g++.dg/ext/visibility/assign1.C: Use scan-hidden and dg-require-visiblity. * g++.dg/ext/visibility/fvisibility-inlines-hidden.C: Likewise. * g++.dg/ext/visibility/fvisibility.C: Likewise. * g++.dg/ext/visibility/memfuncts.C: Likewise. * g++.dg/ext/visibility/new1.C: Likewise. * g++.dg/ext/visibility/pragma.C: Likewise. * g++.dg/ext/visibility/staticmemfuncts.C: Likewise. * g++.dg/ext/visibility/virtual.C: Likewise. * g++/dg/ext/visibility/visibility-1.C: Likewise. * g++/dg/ext/visibility/visibility-2.C: Likewise. * g++/dg/ext/visibility/visibility-3.C: Likewise. * g++/dg/ext/visibility/visibility-4.C: Likewise. * g++/dg/ext/visibility/visibility-5.C: Likewise. * g++/dg/ext/visibility/visibility-6.C: Likewise. * g++/dg/ext/visibility/visibility-7.C: Likewise. * g++/dg/ext/visibility/visibility-8.C: New test. * gcc.c-torture/compile/dll.x: Remove. * gcc.dg/dll-2.c: Use dg-require-dll * gcc.dg/visibility-10.c: New test. * lib/gcc-dg.exp (dg-require-dll): Add Symbian to list of targets supporting DLLs. * testsuite/lib/scanasm.exp (scan_hidden): New function. (scan_not_hidden): Likewise. From-SVN: r85621
2004-08-06 04:03:29 +02:00
If the only target-specific handling you require is @samp{dllimport}
for Microsoft Windows targets, you should define the macro
@code{TARGET_DLLIMPORT_DECL_ATTRIBUTES} to @code{1}. The compiler
will then define a function called
@code{merge_dllimport_decl_attributes} which can then be defined as
the expansion of @code{TARGET_MERGE_DECL_ATTRIBUTES}. You can also
add @code{handle_dll_attribute} in the attribute table for your port
to perform initial processing of the @samp{dllimport} and
@samp{dllexport} attributes. This is done in @file{i386/cygwin.h} and
@file{i386/i386.c}, for example.
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} bool TARGET_VALID_DLLIMPORT_ATTRIBUTE_P (const_tree @var{decl})
re PR other/44034 (target hooks are hard to maintain) gcc: PR other/44034 * target.def, doc/tm.texi.in, genhooks.c: New files. * target.h: Instead of defining individual hook members, define DEFHOOKPOD / DEFHOOK / DEFHOOK_UNDOC / HOOKSTRUCT and include target.def. * target-def.h: Instead of defining individual hook initializers, include target-hooks-def.h. * df-scan.c, haifa-sched.c, sel-sched.c: Rename targetm members: targetm.live_on_entry -> targetm.extra_live_on_entry targetm.sched.md_finish ->targetm.sched.finish targetm.sched.md_init -> targetm.sched.init targetm.sched.md_init_global -> targetm.sched.init_global targetm.asm_out.unwind_label -> targetm.asm_out.emit_unwind_label targetm.asm_out.except_table_label -> targetm.asm_out.emit_except_table_label targetm.asm_out.visibility -> targetm.asm_out.assemble_visibility targetm.target_help -> targetm.help targetm.vectorize.builtin_support_vector_misalignment -> targetm.vectorize.support_vector_misalignment targetm.file_start_app_off -> targetm.asm_file_start_app_off targetm.file_start_file_directive -> targetm.asm_file_start_file_directive * dwarf2out.c, opts.c, tree-vect-data-refs.c, except.c: Likewise. * varasm.c, config/alpha/alpha.c, config/cris/cris.c: Likewise. * gcc/config/spu/spu.c, config/ia64/ia64.c: Rename target macros: TARGET_VECTOR_ALIGNMENT_REACHABLE -> TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE TARGET_SUPPORT_VECTOR_MISALIGNMENT -> TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT TARGET_UNWIND_EMIT -> TARGET_ASM_UNWIND_EMIT * config/rs6000/rs6000.c, config/arm/arm.c: Likewise. * Makefile.in (TARGET_H): Depend on target.def. (TARGET_DEF_H): Depend on target-hooks-def.h. (target-hooks-def.h, tm.texi, s-target-hooks-def-h): New rules. (s-tm-texi, build/genhooks.o, build/genhooks): Likewise. * doc/tm.texi: Regenerate. gcc/c-family: * c-common.c: Rename targetm member: targetm.enum_va_list -> targetm.enum_va_list_p gcc/po: * EXCLUDES: Add genhooks.c. Index: gcc/doc/tm.texi From-SVN: r161547
2010-06-29 20:22:00 +02:00
@var{decl} is a variable or function with @code{__attribute__((dllimport))} specified. Use this hook if the target needs to add extra validation checks to @code{handle_dll_attribute}.
re PR target/21275 (gcc 4.0.0 crash with mingw when using stdout in global var) PR middle-end/21275 PR middle-end/21766 * target.h (struct gcc_target): Add valid_dllimport_attribute_p target hook. (struct cxx): Add adjust_class_at_definition target hook. * target-def.h: (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): New define, defaulting to hook_bool_tree_true. Add to TARGET_INITIALIZER (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): New define, defaulting to hook_void_tree. Add to TARGET_CXX. * tree.h (struct decl_with_vis): Rename non_addr_const_p field to dllimport_flag. (DECL_NON_ADDR_CONSTANT_P): Replace with DECL_DLLIMPORT_P macro. * tree.c (merge_dllimport_decl_attributes): Check DECL_DLLIMPORT_P instead of attribute. Check for dllexport override. Warn if inconsistent dll linkage. Don't lose old dllimport if decl has had address referenced. Tweak lookup of dllimport atribute. (handle_dll_attribute): Check targetm.valid_dllimport_attribute_p for target specific rules. Don't add dllimport attribute if DECL_DECLARED_INLINE_P. Set DECL_DLLIMPORT_P when adding dllimport attribute. (staticp): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P. * varasm.c (initializer_constant_valid_p): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P PR target/21801 PR target/23589 * config.gcc (i[34567]86-*-cygwin*): Add winnt-cxx.o to 'cxx_target_objs', winnt-stubs,o to 'extra_objs'. (i[34567]86-*-mingw32*): Likewise. * doc/tm.texi (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Document. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Document. * config/i386/winnt.c (i386_pe_dllimport_p): Factor out C++-specific code. Change return value to bool. (i386_pe_dllimport_p): Likewise. (associated_type): Simplify and make language-independent (i386_pe_encode_section_info): Replace override of ambiguous dllimport symbol refs with a gcc_assert. (i386_pe_valid_dllimport_attribute_p): Define. * config/i386/winnt-cxx.c: New file. Define C++ versions of i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. * config/i386/winnt-stubs.c: New file. Define stub versions of lang-specific functions. * config/i386/i386-protos.h: Declare winnt-[cxx|stubs].c functions i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. (i386_pe_valid_dllimport_attribute_p): Declare. * config/i386/cygming.h (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Define. (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Define. * config/i386/t-cygming: Add rules for winnt-cxx.o, winnt-stubs.o. PR target/19704 * config/i386/i386.c (ix86_function_ok_for_sibcall): Replace test for dllimport attribute with test of DECL_DLLIMPORT_P. cp PR target/21801 PR target/23589 * class.c (finish_struct_1): Call targetm.cxx.adjust_class_at_definition. testsuite * gcc.dg/dll-2.c: Add tests for warnings. * gcc.dg/dll-3.c: Likewise. * gcc.dg/dll-4.c: Likewise. * g++.dg/ext/dllimport1.C: Adjust tests for warnings. * g++.dg/ext/dllimport2.C: Likewise. * g++.dg/ext/dllimport3.C: Likewise. * g++.dg/ext/dllimport7.C: Likewise. * g++.dg/ext/dllimport8.C: Likewise. * g++.dg/ext/dllimport9.C: Likewise. From-SVN: r105332
2005-10-12 22:54:50 +02:00
@end deftypefn
@defmac TARGET_DECLSPEC
Define this macro to a nonzero value if you want to treat
@code{__declspec(X)} as equivalent to @code{__attribute((X))}. By
default, this behavior is enabled only for targets that define
@code{TARGET_DLLIMPORT_DECL_ATTRIBUTES}. The current implementation
of @code{__declspec} is via a built-in macro, but you should not rely
on this implementation detail.
@end defmac
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@deftypefn {Target Hook} void TARGET_INSERT_ATTRIBUTES (tree @var{node}, tree *@var{attr_ptr})
Define this target hook if you want to be able to add attributes to a decl
when it is being created. This is normally useful for back ends which
wish to implement a pragma by using the attributes which correspond to
the pragma's effect. The @var{node} argument is the decl which is being
created. The @var{attr_ptr} argument is a pointer to the attribute list
for this decl. The list itself should not be modified, since it may be
shared with other decls, but attributes may be chained on the head of
the list and @code{*@var{attr_ptr}} modified to point to the new
attributes, or a copy of the list may be made if further changes are
needed.
@end deftypefn
MAINTAINERS: Add myself as a maintainer for the RX port. * MAINTAINERS: Add myself as a maintainer for the RX port. gcc * config.gcc: Add support for RX target. * config/rx: New directory. * config/rx/constraints.md: New file. * config/rx/predicates.md: New file. * config/rx/rx.c: New file. * config/rx/rx.h: New file. * config/rx/rx.md: New file. * config/rx/rx.opt: New file. * config/rx/rx-protos.h: New file. * config/rx/t-rx: New file. * doc/extend.texi: Document RX function attributes. * doc/invoke.texi: Document RX specific command line options. * doc/contrib.texi: Document RX contribution. * doc/md.texi: Document RX constraints. * doc/install.texi: Document RX support. libgcc * config.host: Add support for RX target. * config/rx: New directory. * config/rx/rx-abi-functions.c: New file. Supplementary functions for libgcc to support the RX ABI. * config/rx/rx-abi.h: New file. Supplementary header file for libgcc RX ABI functions. * config/rx/t-rx: New file: Makefile fragment for building libgcc for the RX. gcc/testsuite * lib/target-supports.exp (check_profiling_available): Profiling is not, currently, available for the RX port. (check_effective_target_hard_float): Add support for RX target. * gcc.target/rx: New directory. * gcc.target/rx/builtins.c: New test file. * gcc.target/rx/interrupts.c: New test file. * gcc.target/rx/rx-abi-function-tests.c: New test file. * gcc.target/rx/zero-width-bitfield.c: New test file. * gcc.target/rx/i272091.c: New test file. * gcc.target/rx/packed-struct.c: New test file. * gcc.target/rx/rx.exp: New file: Drives RX tests. From-SVN: r153557
2009-10-26 17:30:15 +01:00
@deftypefn {Target Hook} bool TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P (const_tree @var{fndecl})
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
@cindex inlining
2013-07-22 19:46:05 +02:00
This target hook returns @code{true} if it is OK to inline @var{fndecl}
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
into the current function, despite its having target-specific
attributes, @code{false} otherwise. By default, if a function has a
target specific attribute attached to it, it will not be inlined.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} bool TARGET_OPTION_VALID_ATTRIBUTE_P (tree @var{fndecl}, tree @var{name}, tree @var{args}, int @var{flags})
This hook is called to parse @code{attribute(target("..."))}, which
allows setting target-specific options on individual functions.
These function-specific options may differ
from the options specified on the command line. The hook should return
@code{true} if the options are valid.
The hook should set the @code{DECL_FUNCTION_SPECIFIC_TARGET} field in
the function declaration to hold a pointer to a target-specific
@code{struct cl_target_option} structure.
@end deftypefn
re PR target/57756 (Function target attribute is retaining state of previously seen function) PR target/57756 The root-cause of this PR is that global_options is not restored to default before calling ix86_valid_target_attribute_tree and hence target attributes are incorrectly processed sometimes. This patch refactors code in i386.c in functions in the call-chain of ix86_valid_target_attribute_tree to use any gcc_options struct passed as a parameter. It replaces existing code which always uses the global_options struct. 2013-10-15 Sriraman Tallam <tmsriram@google.com> PR target/57756 * optc-save-gen.awk: Add extra parameter to the save and restore target calls. * opth-gen.awk: Generate new TARGET_* macros to accept a parameter. * tree.c (build_optimization_node): New parameter. Add extra parameter to call to cl_optimization_save. (build_target_option_node): New parameter. Add extra parameter to call to cl_target_option_save. * tree.h (build_optimization_node): New parameter. (build_target_option_node): New parameter. * c-family/c-common.c (handle_optimize_attribute): Fix calls to build_optimization_node and build_target_option_node. * c-family/c-pragma.c (handle_pragma_optimize): Ditto. (handle_pragma_push_options): Ditto. * toplev.c (process_options): Ditto. * opts.c (init_options_struct): Check for opts_set non-null. * target.def (target_option.save): New parameter. (target_option.restore): New parameter. * tm.texi: Generate. * config/i386/i386-c.c (ix86_target_macros_internal): Ditto. (ix86_pragma_target_parse): Ditto. * config/i386/i386-protos.h (ix86_valid_target_attribute_tree): New parameters. * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix calls to build_optimization_node and build_target_option_node. (rs6000_valid_attribute_p): Ditto. (rs6000_pragma_target_parse): Ditto. * config/i386/i386.opt (x_ix86_target_flags_explicit): New TargetSave data. * config/i386/i386.h: TARGET_64BIT_P: New Macro TARGET_MMX_P: New Macro. TARGET_3DNOW_P: New Macro. TARGET_3DNOW_A_P: New Macro. TARGET_SSE_P: New Macro. TARGET_SSE2_P: New Macro. TARGET_SSE3_P: New Macro. TARGET_SSSE3_P: New Macro. TARGET_SSE4_1_P: New Macro. TARGET_SSE4_2_P: New Macro. TARGET_AVX_P: New Macro. TARGET_AVX2_P: New Macro. TARGET_AVX512F_P: New Macro. TARGET_AVX512PF_P: New Macro. TARGET_AVX512ER_P: New Macro. TARGET_AVX512CD_P: New Macro. TARGET_FMA_P: New Macro. TARGET_SSE4A_P: New Macro. TARGET_FMA4_P: New Macro. TARGET_XOP_P: New Macro. TARGET_LWP_P: New Macro. TARGET_ABM_P: New Macro. TARGET_BMI_P: New Macro. TARGET_BMI2_P: New Macro. TARGET_LZCNT_P: New Macro. TARGET_TBM_P: New Macro. TARGET_POPCNT_P: New Macro. TARGET_SAHF_P: New Macro. TARGET_MOVBE_P: New Macro. TARGET_CRC32_P: New Macro. TARGET_AES_P: New Macro. TARGET_PCLMUL_P: New Macro. TARGET_CMPXCHG16B_P: New Macro. TARGET_FSGSBASE_P: New Macro. TARGET_RDRND_P: New Macro. TARGET_F16C_P: New Macro. TARGET_RTM_P: New Macro. TARGET_HLE_P: New Macro. TARGET_RDSEED_P: New Macro. TARGET_PRFCHW_P: New Macro. TARGET_ADX_P: New Macro. TARGET_FXSR_P: New Macro. TARGET_XSAVE_P: New Macro. TARGET_XSAVEOPT_P: New Macro. TARGET_LP64_P: New Macro. TARGET_X32_P: New Macro. TARGET_FPMATH_DEFAULT_P: New Macro. TARGET_FLOAT_RETURNS_IN_80387_P: New Macro. * config/i386/i386.c (ix86_option_override_internal): New parameters. opts and opts_set. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_isa_flags to access opts->x_ix86_isa_flags. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_stringop_alg to access opts->x_ix86_stringop_alg. Change ix86_pmode to access opts->x_ix86_pmode. Change ix86_abi to access opts->x_ix86_abi. Change ix86_cmodel to access opts->x_ix86_cmodel. Change ix86_asm_dialect to access opts->x_ix86_asm_dialect. Change ix86_isa_flags_explicit to access opts->x_ix86_isa_flags_explicit. Change ix86_dump_tunes to access opts->x_ix86_dump_tunes. Change ix86_regparm to access opts->x_ix86_regparm. Change ix86_branch_cost to access opts->x_ix86_branch_cost. Change ix86_preferred_stack_boundary_arg to access opts->x_ix86_preferred_stack_boundary_arg. Change ix86_force_align_arg_pointer to access opts->x_ix86_force_align_arg_pointer. Change ix86_incoming_stack_boundar_arg to access opts->x_ix86_incoming_stack_boundar_arg. Change ix86_fpmath to access opts->x_ix86_fpmath. Change ix86_veclibabi_type to access opts->x_ix86_veclibabi_type. Change ix86_recip_name to access opts->x_ix86_recip_name. Change ix86_stack_protector_guard to access opts->x_ix86_stack_protector_guard. Change ix86_tune_memcpy_strategy to access opts->x_ix86_tune_memcpy_strategy. Change ix86_tune_memset_strategy to access opts->x_ix86_tune_memset_strategy. Change global_options to access opts. Change global_options_set to access opts_set. Change TARGET_64BIT to TARGET_64BIT_P (opts->...) Change TARGET_MMX to TARGET_MMX_P (opts->...) Change TARGET_3DNOW to TARGET_3DNOW_P (opts->...) Change TARGET_3DNOW_A to TARGET_3DNOW_A_P (opts->...) Change TARGET_SSE to TARGET_SSE_P (opts->...) Change TARGET_SSE2 to TARGET_SSE2_P (opts->...) Change TARGET_SSE3 to TARGET_SSE3_P (opts->...) Change TARGET_SSSE3 to TARGET_SSSE3_P (opts->...) Change TARGET_SSE4_1 to TARGET_SSE4_1_P (opts->...) Change TARGET_SSE4_2 to TARGET_SSE4_2_P (opts->...) Change TARGET_AVX to TARGET_AVX_P (opts->...) Change TARGET_AVX2 to TARGET_AVX2_P (opts->...) Change TARGET_AVX512F to TARGET_AVX512F_P (opts->...) Change TARGET_AVX512PF to TARGET_AVX512PF_P (opts->...) Change TARGET_AVX512ER to TARGET_AVX512ER_P (opts->...) Change TARGET_AVX512CD to TARGET_AVX512CD_P (opts->...) Change TARGET_FMA to TARGET_FMA_P (opts->...) Change TARGET_SSE4A to TARGET_SSE4A_P (opts->...) Change TARGET_FMA4 to TARGET_FMA4_P (opts->...) Change TARGET_XOP to TARGET_XOP_P (opts->...) Change TARGET_LWP to TARGET_LWP_P (opts->...) Change TARGET_ABM to TARGET_ABM_P (opts->...) Change TARGET_BMI to TARGET_BMI_P (opts->...) Change TARGET_BMI2 to TARGET_BMI2_P (opts->...) Change TARGET_LZCNT to TARGET_LZCNT_P (opts->...) Change TARGET_TBM to TARGET_TBM_P (opts->...) Change TARGET_POPCNT to TARGET_POPCNT_P (opts->...) Change TARGET_SAHF to TARGET_SAHF_P (opts->...) Change TARGET_MOVBE to TARGET_MOVBE_P (opts->...) Change TARGET_CRC32 to TARGET_CRC32_P (opts->...) Change TARGET_AES to TARGET_AES_P (opts->...) Change TARGET_PCLMUL to TARGET_PCLMUL_P (opts->...) Change TARGET_CMPXCHG16B to TARGET_CMPXCHG16B_P (opts->...) Change TARGET_FSGSBASE to TARGET_FSGSBASE_P (opts->...) Change TARGET_RDRND to TARGET_RDRND_P (opts->...) Change TARGET_F16C to TARGET_F16C_P (opts->...) Change TARGET_RTM to TARGET_RTM_P (opts->...) Change TARGET_HLE to TARGET_HLE_P (opts->...) Change TARGET_RDSEED to TARGET_RDSEED_P (opts->...) Change TARGET_PRFCHW to TARGET_PRFCHW_P (opts->...) Change TARGET_ADX to TARGET_ADX_P (opts->...) Change TARGET_FXSR to TARGET_FXSR_P (opts->...) Change TARGET_XSAVE to TARGET_XSAVE_P (opts->...) Change TARGET_XSAVEOPT to TARGET_XSAVEOPT_P (opts->...) Change TARGET_LP64 to TARGET_LP64_P (opts->...) Change TARGET_X32 to TARGET_X32_P (opts->...) Change TARGET_FPMATH_DEFAULT to TARGET_FPMATH_DEFAULT_P (opts->...) Change TARGET_FLOAT_RETURNS_IN_80387 to TARGET_FLOAT_RETURNS_IN_80387_P (opts->...) (ix86_function_specific_save): New parameter. Use opts-> fields to replace global fields. (ix86_function_specific_restore): Ditto. (ix86_valid_target_attribute_inner_p): New parameters. Fix recursive call. Fix call to ix86_handle_option and set_option. (ix86_valid_target_attribute_tree): New parameters. Change global_options to access opts. Change global_options_set to access opts_set. Fix call to ix86_valid_target_attribute_inner_p. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_fpmath to access opts->x_ix86_fpmath Fix call to ix86_option_override_internal. Fix call to ix86_add_new_builtins. Fix calls to build_optimization_node and build_target_option_node. (ix86_valid_target_attribute_p): Remove access to global_options. Use new gcc_options structure func_options. Fix call to ix86_valid_target_attribute_tree. Fix call to build_optimization_node. (get_builtin_code_for_version): Fix call to ix86_valid_target_attribute_tree. PR target/57756 * gcc.target/i386/pr57756.c: New test. * gcc.target/i386/pr57756_2.c: New test. From-SVN: r203634
2013-10-15 23:43:21 +02:00
@deftypefn {Target Hook} void TARGET_OPTION_SAVE (struct cl_target_option *@var{ptr}, struct gcc_options *@var{opts})
This hook is called to save any additional target-specific information
in the @code{struct cl_target_option} structure for function-specific
re PR target/57756 (Function target attribute is retaining state of previously seen function) PR target/57756 The root-cause of this PR is that global_options is not restored to default before calling ix86_valid_target_attribute_tree and hence target attributes are incorrectly processed sometimes. This patch refactors code in i386.c in functions in the call-chain of ix86_valid_target_attribute_tree to use any gcc_options struct passed as a parameter. It replaces existing code which always uses the global_options struct. 2013-10-15 Sriraman Tallam <tmsriram@google.com> PR target/57756 * optc-save-gen.awk: Add extra parameter to the save and restore target calls. * opth-gen.awk: Generate new TARGET_* macros to accept a parameter. * tree.c (build_optimization_node): New parameter. Add extra parameter to call to cl_optimization_save. (build_target_option_node): New parameter. Add extra parameter to call to cl_target_option_save. * tree.h (build_optimization_node): New parameter. (build_target_option_node): New parameter. * c-family/c-common.c (handle_optimize_attribute): Fix calls to build_optimization_node and build_target_option_node. * c-family/c-pragma.c (handle_pragma_optimize): Ditto. (handle_pragma_push_options): Ditto. * toplev.c (process_options): Ditto. * opts.c (init_options_struct): Check for opts_set non-null. * target.def (target_option.save): New parameter. (target_option.restore): New parameter. * tm.texi: Generate. * config/i386/i386-c.c (ix86_target_macros_internal): Ditto. (ix86_pragma_target_parse): Ditto. * config/i386/i386-protos.h (ix86_valid_target_attribute_tree): New parameters. * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix calls to build_optimization_node and build_target_option_node. (rs6000_valid_attribute_p): Ditto. (rs6000_pragma_target_parse): Ditto. * config/i386/i386.opt (x_ix86_target_flags_explicit): New TargetSave data. * config/i386/i386.h: TARGET_64BIT_P: New Macro TARGET_MMX_P: New Macro. TARGET_3DNOW_P: New Macro. TARGET_3DNOW_A_P: New Macro. TARGET_SSE_P: New Macro. TARGET_SSE2_P: New Macro. TARGET_SSE3_P: New Macro. TARGET_SSSE3_P: New Macro. TARGET_SSE4_1_P: New Macro. TARGET_SSE4_2_P: New Macro. TARGET_AVX_P: New Macro. TARGET_AVX2_P: New Macro. TARGET_AVX512F_P: New Macro. TARGET_AVX512PF_P: New Macro. TARGET_AVX512ER_P: New Macro. TARGET_AVX512CD_P: New Macro. TARGET_FMA_P: New Macro. TARGET_SSE4A_P: New Macro. TARGET_FMA4_P: New Macro. TARGET_XOP_P: New Macro. TARGET_LWP_P: New Macro. TARGET_ABM_P: New Macro. TARGET_BMI_P: New Macro. TARGET_BMI2_P: New Macro. TARGET_LZCNT_P: New Macro. TARGET_TBM_P: New Macro. TARGET_POPCNT_P: New Macro. TARGET_SAHF_P: New Macro. TARGET_MOVBE_P: New Macro. TARGET_CRC32_P: New Macro. TARGET_AES_P: New Macro. TARGET_PCLMUL_P: New Macro. TARGET_CMPXCHG16B_P: New Macro. TARGET_FSGSBASE_P: New Macro. TARGET_RDRND_P: New Macro. TARGET_F16C_P: New Macro. TARGET_RTM_P: New Macro. TARGET_HLE_P: New Macro. TARGET_RDSEED_P: New Macro. TARGET_PRFCHW_P: New Macro. TARGET_ADX_P: New Macro. TARGET_FXSR_P: New Macro. TARGET_XSAVE_P: New Macro. TARGET_XSAVEOPT_P: New Macro. TARGET_LP64_P: New Macro. TARGET_X32_P: New Macro. TARGET_FPMATH_DEFAULT_P: New Macro. TARGET_FLOAT_RETURNS_IN_80387_P: New Macro. * config/i386/i386.c (ix86_option_override_internal): New parameters. opts and opts_set. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_isa_flags to access opts->x_ix86_isa_flags. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_stringop_alg to access opts->x_ix86_stringop_alg. Change ix86_pmode to access opts->x_ix86_pmode. Change ix86_abi to access opts->x_ix86_abi. Change ix86_cmodel to access opts->x_ix86_cmodel. Change ix86_asm_dialect to access opts->x_ix86_asm_dialect. Change ix86_isa_flags_explicit to access opts->x_ix86_isa_flags_explicit. Change ix86_dump_tunes to access opts->x_ix86_dump_tunes. Change ix86_regparm to access opts->x_ix86_regparm. Change ix86_branch_cost to access opts->x_ix86_branch_cost. Change ix86_preferred_stack_boundary_arg to access opts->x_ix86_preferred_stack_boundary_arg. Change ix86_force_align_arg_pointer to access opts->x_ix86_force_align_arg_pointer. Change ix86_incoming_stack_boundar_arg to access opts->x_ix86_incoming_stack_boundar_arg. Change ix86_fpmath to access opts->x_ix86_fpmath. Change ix86_veclibabi_type to access opts->x_ix86_veclibabi_type. Change ix86_recip_name to access opts->x_ix86_recip_name. Change ix86_stack_protector_guard to access opts->x_ix86_stack_protector_guard. Change ix86_tune_memcpy_strategy to access opts->x_ix86_tune_memcpy_strategy. Change ix86_tune_memset_strategy to access opts->x_ix86_tune_memset_strategy. Change global_options to access opts. Change global_options_set to access opts_set. Change TARGET_64BIT to TARGET_64BIT_P (opts->...) Change TARGET_MMX to TARGET_MMX_P (opts->...) Change TARGET_3DNOW to TARGET_3DNOW_P (opts->...) Change TARGET_3DNOW_A to TARGET_3DNOW_A_P (opts->...) Change TARGET_SSE to TARGET_SSE_P (opts->...) Change TARGET_SSE2 to TARGET_SSE2_P (opts->...) Change TARGET_SSE3 to TARGET_SSE3_P (opts->...) Change TARGET_SSSE3 to TARGET_SSSE3_P (opts->...) Change TARGET_SSE4_1 to TARGET_SSE4_1_P (opts->...) Change TARGET_SSE4_2 to TARGET_SSE4_2_P (opts->...) Change TARGET_AVX to TARGET_AVX_P (opts->...) Change TARGET_AVX2 to TARGET_AVX2_P (opts->...) Change TARGET_AVX512F to TARGET_AVX512F_P (opts->...) Change TARGET_AVX512PF to TARGET_AVX512PF_P (opts->...) Change TARGET_AVX512ER to TARGET_AVX512ER_P (opts->...) Change TARGET_AVX512CD to TARGET_AVX512CD_P (opts->...) Change TARGET_FMA to TARGET_FMA_P (opts->...) Change TARGET_SSE4A to TARGET_SSE4A_P (opts->...) Change TARGET_FMA4 to TARGET_FMA4_P (opts->...) Change TARGET_XOP to TARGET_XOP_P (opts->...) Change TARGET_LWP to TARGET_LWP_P (opts->...) Change TARGET_ABM to TARGET_ABM_P (opts->...) Change TARGET_BMI to TARGET_BMI_P (opts->...) Change TARGET_BMI2 to TARGET_BMI2_P (opts->...) Change TARGET_LZCNT to TARGET_LZCNT_P (opts->...) Change TARGET_TBM to TARGET_TBM_P (opts->...) Change TARGET_POPCNT to TARGET_POPCNT_P (opts->...) Change TARGET_SAHF to TARGET_SAHF_P (opts->...) Change TARGET_MOVBE to TARGET_MOVBE_P (opts->...) Change TARGET_CRC32 to TARGET_CRC32_P (opts->...) Change TARGET_AES to TARGET_AES_P (opts->...) Change TARGET_PCLMUL to TARGET_PCLMUL_P (opts->...) Change TARGET_CMPXCHG16B to TARGET_CMPXCHG16B_P (opts->...) Change TARGET_FSGSBASE to TARGET_FSGSBASE_P (opts->...) Change TARGET_RDRND to TARGET_RDRND_P (opts->...) Change TARGET_F16C to TARGET_F16C_P (opts->...) Change TARGET_RTM to TARGET_RTM_P (opts->...) Change TARGET_HLE to TARGET_HLE_P (opts->...) Change TARGET_RDSEED to TARGET_RDSEED_P (opts->...) Change TARGET_PRFCHW to TARGET_PRFCHW_P (opts->...) Change TARGET_ADX to TARGET_ADX_P (opts->...) Change TARGET_FXSR to TARGET_FXSR_P (opts->...) Change TARGET_XSAVE to TARGET_XSAVE_P (opts->...) Change TARGET_XSAVEOPT to TARGET_XSAVEOPT_P (opts->...) Change TARGET_LP64 to TARGET_LP64_P (opts->...) Change TARGET_X32 to TARGET_X32_P (opts->...) Change TARGET_FPMATH_DEFAULT to TARGET_FPMATH_DEFAULT_P (opts->...) Change TARGET_FLOAT_RETURNS_IN_80387 to TARGET_FLOAT_RETURNS_IN_80387_P (opts->...) (ix86_function_specific_save): New parameter. Use opts-> fields to replace global fields. (ix86_function_specific_restore): Ditto. (ix86_valid_target_attribute_inner_p): New parameters. Fix recursive call. Fix call to ix86_handle_option and set_option. (ix86_valid_target_attribute_tree): New parameters. Change global_options to access opts. Change global_options_set to access opts_set. Fix call to ix86_valid_target_attribute_inner_p. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_fpmath to access opts->x_ix86_fpmath Fix call to ix86_option_override_internal. Fix call to ix86_add_new_builtins. Fix calls to build_optimization_node and build_target_option_node. (ix86_valid_target_attribute_p): Remove access to global_options. Use new gcc_options structure func_options. Fix call to ix86_valid_target_attribute_tree. Fix call to build_optimization_node. (get_builtin_code_for_version): Fix call to ix86_valid_target_attribute_tree. PR target/57756 * gcc.target/i386/pr57756.c: New test. * gcc.target/i386/pr57756_2.c: New test. From-SVN: r203634
2013-10-15 23:43:21 +02:00
options from the @code{struct gcc_options} structure.
@xref{Option file format}.
@end deftypefn
re PR target/57756 (Function target attribute is retaining state of previously seen function) PR target/57756 The root-cause of this PR is that global_options is not restored to default before calling ix86_valid_target_attribute_tree and hence target attributes are incorrectly processed sometimes. This patch refactors code in i386.c in functions in the call-chain of ix86_valid_target_attribute_tree to use any gcc_options struct passed as a parameter. It replaces existing code which always uses the global_options struct. 2013-10-15 Sriraman Tallam <tmsriram@google.com> PR target/57756 * optc-save-gen.awk: Add extra parameter to the save and restore target calls. * opth-gen.awk: Generate new TARGET_* macros to accept a parameter. * tree.c (build_optimization_node): New parameter. Add extra parameter to call to cl_optimization_save. (build_target_option_node): New parameter. Add extra parameter to call to cl_target_option_save. * tree.h (build_optimization_node): New parameter. (build_target_option_node): New parameter. * c-family/c-common.c (handle_optimize_attribute): Fix calls to build_optimization_node and build_target_option_node. * c-family/c-pragma.c (handle_pragma_optimize): Ditto. (handle_pragma_push_options): Ditto. * toplev.c (process_options): Ditto. * opts.c (init_options_struct): Check for opts_set non-null. * target.def (target_option.save): New parameter. (target_option.restore): New parameter. * tm.texi: Generate. * config/i386/i386-c.c (ix86_target_macros_internal): Ditto. (ix86_pragma_target_parse): Ditto. * config/i386/i386-protos.h (ix86_valid_target_attribute_tree): New parameters. * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix calls to build_optimization_node and build_target_option_node. (rs6000_valid_attribute_p): Ditto. (rs6000_pragma_target_parse): Ditto. * config/i386/i386.opt (x_ix86_target_flags_explicit): New TargetSave data. * config/i386/i386.h: TARGET_64BIT_P: New Macro TARGET_MMX_P: New Macro. TARGET_3DNOW_P: New Macro. TARGET_3DNOW_A_P: New Macro. TARGET_SSE_P: New Macro. TARGET_SSE2_P: New Macro. TARGET_SSE3_P: New Macro. TARGET_SSSE3_P: New Macro. TARGET_SSE4_1_P: New Macro. TARGET_SSE4_2_P: New Macro. TARGET_AVX_P: New Macro. TARGET_AVX2_P: New Macro. TARGET_AVX512F_P: New Macro. TARGET_AVX512PF_P: New Macro. TARGET_AVX512ER_P: New Macro. TARGET_AVX512CD_P: New Macro. TARGET_FMA_P: New Macro. TARGET_SSE4A_P: New Macro. TARGET_FMA4_P: New Macro. TARGET_XOP_P: New Macro. TARGET_LWP_P: New Macro. TARGET_ABM_P: New Macro. TARGET_BMI_P: New Macro. TARGET_BMI2_P: New Macro. TARGET_LZCNT_P: New Macro. TARGET_TBM_P: New Macro. TARGET_POPCNT_P: New Macro. TARGET_SAHF_P: New Macro. TARGET_MOVBE_P: New Macro. TARGET_CRC32_P: New Macro. TARGET_AES_P: New Macro. TARGET_PCLMUL_P: New Macro. TARGET_CMPXCHG16B_P: New Macro. TARGET_FSGSBASE_P: New Macro. TARGET_RDRND_P: New Macro. TARGET_F16C_P: New Macro. TARGET_RTM_P: New Macro. TARGET_HLE_P: New Macro. TARGET_RDSEED_P: New Macro. TARGET_PRFCHW_P: New Macro. TARGET_ADX_P: New Macro. TARGET_FXSR_P: New Macro. TARGET_XSAVE_P: New Macro. TARGET_XSAVEOPT_P: New Macro. TARGET_LP64_P: New Macro. TARGET_X32_P: New Macro. TARGET_FPMATH_DEFAULT_P: New Macro. TARGET_FLOAT_RETURNS_IN_80387_P: New Macro. * config/i386/i386.c (ix86_option_override_internal): New parameters. opts and opts_set. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_isa_flags to access opts->x_ix86_isa_flags. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_stringop_alg to access opts->x_ix86_stringop_alg. Change ix86_pmode to access opts->x_ix86_pmode. Change ix86_abi to access opts->x_ix86_abi. Change ix86_cmodel to access opts->x_ix86_cmodel. Change ix86_asm_dialect to access opts->x_ix86_asm_dialect. Change ix86_isa_flags_explicit to access opts->x_ix86_isa_flags_explicit. Change ix86_dump_tunes to access opts->x_ix86_dump_tunes. Change ix86_regparm to access opts->x_ix86_regparm. Change ix86_branch_cost to access opts->x_ix86_branch_cost. Change ix86_preferred_stack_boundary_arg to access opts->x_ix86_preferred_stack_boundary_arg. Change ix86_force_align_arg_pointer to access opts->x_ix86_force_align_arg_pointer. Change ix86_incoming_stack_boundar_arg to access opts->x_ix86_incoming_stack_boundar_arg. Change ix86_fpmath to access opts->x_ix86_fpmath. Change ix86_veclibabi_type to access opts->x_ix86_veclibabi_type. Change ix86_recip_name to access opts->x_ix86_recip_name. Change ix86_stack_protector_guard to access opts->x_ix86_stack_protector_guard. Change ix86_tune_memcpy_strategy to access opts->x_ix86_tune_memcpy_strategy. Change ix86_tune_memset_strategy to access opts->x_ix86_tune_memset_strategy. Change global_options to access opts. Change global_options_set to access opts_set. Change TARGET_64BIT to TARGET_64BIT_P (opts->...) Change TARGET_MMX to TARGET_MMX_P (opts->...) Change TARGET_3DNOW to TARGET_3DNOW_P (opts->...) Change TARGET_3DNOW_A to TARGET_3DNOW_A_P (opts->...) Change TARGET_SSE to TARGET_SSE_P (opts->...) Change TARGET_SSE2 to TARGET_SSE2_P (opts->...) Change TARGET_SSE3 to TARGET_SSE3_P (opts->...) Change TARGET_SSSE3 to TARGET_SSSE3_P (opts->...) Change TARGET_SSE4_1 to TARGET_SSE4_1_P (opts->...) Change TARGET_SSE4_2 to TARGET_SSE4_2_P (opts->...) Change TARGET_AVX to TARGET_AVX_P (opts->...) Change TARGET_AVX2 to TARGET_AVX2_P (opts->...) Change TARGET_AVX512F to TARGET_AVX512F_P (opts->...) Change TARGET_AVX512PF to TARGET_AVX512PF_P (opts->...) Change TARGET_AVX512ER to TARGET_AVX512ER_P (opts->...) Change TARGET_AVX512CD to TARGET_AVX512CD_P (opts->...) Change TARGET_FMA to TARGET_FMA_P (opts->...) Change TARGET_SSE4A to TARGET_SSE4A_P (opts->...) Change TARGET_FMA4 to TARGET_FMA4_P (opts->...) Change TARGET_XOP to TARGET_XOP_P (opts->...) Change TARGET_LWP to TARGET_LWP_P (opts->...) Change TARGET_ABM to TARGET_ABM_P (opts->...) Change TARGET_BMI to TARGET_BMI_P (opts->...) Change TARGET_BMI2 to TARGET_BMI2_P (opts->...) Change TARGET_LZCNT to TARGET_LZCNT_P (opts->...) Change TARGET_TBM to TARGET_TBM_P (opts->...) Change TARGET_POPCNT to TARGET_POPCNT_P (opts->...) Change TARGET_SAHF to TARGET_SAHF_P (opts->...) Change TARGET_MOVBE to TARGET_MOVBE_P (opts->...) Change TARGET_CRC32 to TARGET_CRC32_P (opts->...) Change TARGET_AES to TARGET_AES_P (opts->...) Change TARGET_PCLMUL to TARGET_PCLMUL_P (opts->...) Change TARGET_CMPXCHG16B to TARGET_CMPXCHG16B_P (opts->...) Change TARGET_FSGSBASE to TARGET_FSGSBASE_P (opts->...) Change TARGET_RDRND to TARGET_RDRND_P (opts->...) Change TARGET_F16C to TARGET_F16C_P (opts->...) Change TARGET_RTM to TARGET_RTM_P (opts->...) Change TARGET_HLE to TARGET_HLE_P (opts->...) Change TARGET_RDSEED to TARGET_RDSEED_P (opts->...) Change TARGET_PRFCHW to TARGET_PRFCHW_P (opts->...) Change TARGET_ADX to TARGET_ADX_P (opts->...) Change TARGET_FXSR to TARGET_FXSR_P (opts->...) Change TARGET_XSAVE to TARGET_XSAVE_P (opts->...) Change TARGET_XSAVEOPT to TARGET_XSAVEOPT_P (opts->...) Change TARGET_LP64 to TARGET_LP64_P (opts->...) Change TARGET_X32 to TARGET_X32_P (opts->...) Change TARGET_FPMATH_DEFAULT to TARGET_FPMATH_DEFAULT_P (opts->...) Change TARGET_FLOAT_RETURNS_IN_80387 to TARGET_FLOAT_RETURNS_IN_80387_P (opts->...) (ix86_function_specific_save): New parameter. Use opts-> fields to replace global fields. (ix86_function_specific_restore): Ditto. (ix86_valid_target_attribute_inner_p): New parameters. Fix recursive call. Fix call to ix86_handle_option and set_option. (ix86_valid_target_attribute_tree): New parameters. Change global_options to access opts. Change global_options_set to access opts_set. Fix call to ix86_valid_target_attribute_inner_p. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_fpmath to access opts->x_ix86_fpmath Fix call to ix86_option_override_internal. Fix call to ix86_add_new_builtins. Fix calls to build_optimization_node and build_target_option_node. (ix86_valid_target_attribute_p): Remove access to global_options. Use new gcc_options structure func_options. Fix call to ix86_valid_target_attribute_tree. Fix call to build_optimization_node. (get_builtin_code_for_version): Fix call to ix86_valid_target_attribute_tree. PR target/57756 * gcc.target/i386/pr57756.c: New test. * gcc.target/i386/pr57756_2.c: New test. From-SVN: r203634
2013-10-15 23:43:21 +02:00
@deftypefn {Target Hook} void TARGET_OPTION_RESTORE (struct gcc_options *@var{opts}, struct cl_target_option *@var{ptr})
This hook is called to restore any additional target-specific
information in the @code{struct cl_target_option} structure for
re PR target/57756 (Function target attribute is retaining state of previously seen function) PR target/57756 The root-cause of this PR is that global_options is not restored to default before calling ix86_valid_target_attribute_tree and hence target attributes are incorrectly processed sometimes. This patch refactors code in i386.c in functions in the call-chain of ix86_valid_target_attribute_tree to use any gcc_options struct passed as a parameter. It replaces existing code which always uses the global_options struct. 2013-10-15 Sriraman Tallam <tmsriram@google.com> PR target/57756 * optc-save-gen.awk: Add extra parameter to the save and restore target calls. * opth-gen.awk: Generate new TARGET_* macros to accept a parameter. * tree.c (build_optimization_node): New parameter. Add extra parameter to call to cl_optimization_save. (build_target_option_node): New parameter. Add extra parameter to call to cl_target_option_save. * tree.h (build_optimization_node): New parameter. (build_target_option_node): New parameter. * c-family/c-common.c (handle_optimize_attribute): Fix calls to build_optimization_node and build_target_option_node. * c-family/c-pragma.c (handle_pragma_optimize): Ditto. (handle_pragma_push_options): Ditto. * toplev.c (process_options): Ditto. * opts.c (init_options_struct): Check for opts_set non-null. * target.def (target_option.save): New parameter. (target_option.restore): New parameter. * tm.texi: Generate. * config/i386/i386-c.c (ix86_target_macros_internal): Ditto. (ix86_pragma_target_parse): Ditto. * config/i386/i386-protos.h (ix86_valid_target_attribute_tree): New parameters. * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix calls to build_optimization_node and build_target_option_node. (rs6000_valid_attribute_p): Ditto. (rs6000_pragma_target_parse): Ditto. * config/i386/i386.opt (x_ix86_target_flags_explicit): New TargetSave data. * config/i386/i386.h: TARGET_64BIT_P: New Macro TARGET_MMX_P: New Macro. TARGET_3DNOW_P: New Macro. TARGET_3DNOW_A_P: New Macro. TARGET_SSE_P: New Macro. TARGET_SSE2_P: New Macro. TARGET_SSE3_P: New Macro. TARGET_SSSE3_P: New Macro. TARGET_SSE4_1_P: New Macro. TARGET_SSE4_2_P: New Macro. TARGET_AVX_P: New Macro. TARGET_AVX2_P: New Macro. TARGET_AVX512F_P: New Macro. TARGET_AVX512PF_P: New Macro. TARGET_AVX512ER_P: New Macro. TARGET_AVX512CD_P: New Macro. TARGET_FMA_P: New Macro. TARGET_SSE4A_P: New Macro. TARGET_FMA4_P: New Macro. TARGET_XOP_P: New Macro. TARGET_LWP_P: New Macro. TARGET_ABM_P: New Macro. TARGET_BMI_P: New Macro. TARGET_BMI2_P: New Macro. TARGET_LZCNT_P: New Macro. TARGET_TBM_P: New Macro. TARGET_POPCNT_P: New Macro. TARGET_SAHF_P: New Macro. TARGET_MOVBE_P: New Macro. TARGET_CRC32_P: New Macro. TARGET_AES_P: New Macro. TARGET_PCLMUL_P: New Macro. TARGET_CMPXCHG16B_P: New Macro. TARGET_FSGSBASE_P: New Macro. TARGET_RDRND_P: New Macro. TARGET_F16C_P: New Macro. TARGET_RTM_P: New Macro. TARGET_HLE_P: New Macro. TARGET_RDSEED_P: New Macro. TARGET_PRFCHW_P: New Macro. TARGET_ADX_P: New Macro. TARGET_FXSR_P: New Macro. TARGET_XSAVE_P: New Macro. TARGET_XSAVEOPT_P: New Macro. TARGET_LP64_P: New Macro. TARGET_X32_P: New Macro. TARGET_FPMATH_DEFAULT_P: New Macro. TARGET_FLOAT_RETURNS_IN_80387_P: New Macro. * config/i386/i386.c (ix86_option_override_internal): New parameters. opts and opts_set. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_isa_flags to access opts->x_ix86_isa_flags. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_stringop_alg to access opts->x_ix86_stringop_alg. Change ix86_pmode to access opts->x_ix86_pmode. Change ix86_abi to access opts->x_ix86_abi. Change ix86_cmodel to access opts->x_ix86_cmodel. Change ix86_asm_dialect to access opts->x_ix86_asm_dialect. Change ix86_isa_flags_explicit to access opts->x_ix86_isa_flags_explicit. Change ix86_dump_tunes to access opts->x_ix86_dump_tunes. Change ix86_regparm to access opts->x_ix86_regparm. Change ix86_branch_cost to access opts->x_ix86_branch_cost. Change ix86_preferred_stack_boundary_arg to access opts->x_ix86_preferred_stack_boundary_arg. Change ix86_force_align_arg_pointer to access opts->x_ix86_force_align_arg_pointer. Change ix86_incoming_stack_boundar_arg to access opts->x_ix86_incoming_stack_boundar_arg. Change ix86_fpmath to access opts->x_ix86_fpmath. Change ix86_veclibabi_type to access opts->x_ix86_veclibabi_type. Change ix86_recip_name to access opts->x_ix86_recip_name. Change ix86_stack_protector_guard to access opts->x_ix86_stack_protector_guard. Change ix86_tune_memcpy_strategy to access opts->x_ix86_tune_memcpy_strategy. Change ix86_tune_memset_strategy to access opts->x_ix86_tune_memset_strategy. Change global_options to access opts. Change global_options_set to access opts_set. Change TARGET_64BIT to TARGET_64BIT_P (opts->...) Change TARGET_MMX to TARGET_MMX_P (opts->...) Change TARGET_3DNOW to TARGET_3DNOW_P (opts->...) Change TARGET_3DNOW_A to TARGET_3DNOW_A_P (opts->...) Change TARGET_SSE to TARGET_SSE_P (opts->...) Change TARGET_SSE2 to TARGET_SSE2_P (opts->...) Change TARGET_SSE3 to TARGET_SSE3_P (opts->...) Change TARGET_SSSE3 to TARGET_SSSE3_P (opts->...) Change TARGET_SSE4_1 to TARGET_SSE4_1_P (opts->...) Change TARGET_SSE4_2 to TARGET_SSE4_2_P (opts->...) Change TARGET_AVX to TARGET_AVX_P (opts->...) Change TARGET_AVX2 to TARGET_AVX2_P (opts->...) Change TARGET_AVX512F to TARGET_AVX512F_P (opts->...) Change TARGET_AVX512PF to TARGET_AVX512PF_P (opts->...) Change TARGET_AVX512ER to TARGET_AVX512ER_P (opts->...) Change TARGET_AVX512CD to TARGET_AVX512CD_P (opts->...) Change TARGET_FMA to TARGET_FMA_P (opts->...) Change TARGET_SSE4A to TARGET_SSE4A_P (opts->...) Change TARGET_FMA4 to TARGET_FMA4_P (opts->...) Change TARGET_XOP to TARGET_XOP_P (opts->...) Change TARGET_LWP to TARGET_LWP_P (opts->...) Change TARGET_ABM to TARGET_ABM_P (opts->...) Change TARGET_BMI to TARGET_BMI_P (opts->...) Change TARGET_BMI2 to TARGET_BMI2_P (opts->...) Change TARGET_LZCNT to TARGET_LZCNT_P (opts->...) Change TARGET_TBM to TARGET_TBM_P (opts->...) Change TARGET_POPCNT to TARGET_POPCNT_P (opts->...) Change TARGET_SAHF to TARGET_SAHF_P (opts->...) Change TARGET_MOVBE to TARGET_MOVBE_P (opts->...) Change TARGET_CRC32 to TARGET_CRC32_P (opts->...) Change TARGET_AES to TARGET_AES_P (opts->...) Change TARGET_PCLMUL to TARGET_PCLMUL_P (opts->...) Change TARGET_CMPXCHG16B to TARGET_CMPXCHG16B_P (opts->...) Change TARGET_FSGSBASE to TARGET_FSGSBASE_P (opts->...) Change TARGET_RDRND to TARGET_RDRND_P (opts->...) Change TARGET_F16C to TARGET_F16C_P (opts->...) Change TARGET_RTM to TARGET_RTM_P (opts->...) Change TARGET_HLE to TARGET_HLE_P (opts->...) Change TARGET_RDSEED to TARGET_RDSEED_P (opts->...) Change TARGET_PRFCHW to TARGET_PRFCHW_P (opts->...) Change TARGET_ADX to TARGET_ADX_P (opts->...) Change TARGET_FXSR to TARGET_FXSR_P (opts->...) Change TARGET_XSAVE to TARGET_XSAVE_P (opts->...) Change TARGET_XSAVEOPT to TARGET_XSAVEOPT_P (opts->...) Change TARGET_LP64 to TARGET_LP64_P (opts->...) Change TARGET_X32 to TARGET_X32_P (opts->...) Change TARGET_FPMATH_DEFAULT to TARGET_FPMATH_DEFAULT_P (opts->...) Change TARGET_FLOAT_RETURNS_IN_80387 to TARGET_FLOAT_RETURNS_IN_80387_P (opts->...) (ix86_function_specific_save): New parameter. Use opts-> fields to replace global fields. (ix86_function_specific_restore): Ditto. (ix86_valid_target_attribute_inner_p): New parameters. Fix recursive call. Fix call to ix86_handle_option and set_option. (ix86_valid_target_attribute_tree): New parameters. Change global_options to access opts. Change global_options_set to access opts_set. Fix call to ix86_valid_target_attribute_inner_p. Change ix86_tune_string to access opts->x_ix86_tune_string. Change ix86_arch_string to access opts->x_ix86_arch_string. Change ix86_fpmath to access opts->x_ix86_fpmath Fix call to ix86_option_override_internal. Fix call to ix86_add_new_builtins. Fix calls to build_optimization_node and build_target_option_node. (ix86_valid_target_attribute_p): Remove access to global_options. Use new gcc_options structure func_options. Fix call to ix86_valid_target_attribute_tree. Fix call to build_optimization_node. (get_builtin_code_for_version): Fix call to ix86_valid_target_attribute_tree. PR target/57756 * gcc.target/i386/pr57756.c: New test. * gcc.target/i386/pr57756_2.c: New test. From-SVN: r203634
2013-10-15 23:43:21 +02:00
function-specific options to the @code{struct gcc_options} structure.
@end deftypefn
@deftypefn {Target Hook} void TARGET_OPTION_PRINT (FILE *@var{file}, int @var{indent}, struct cl_target_option *@var{ptr})
This hook is called to print any additional target-specific
information in the @code{struct cl_target_option} structure for
function-specific options.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_OPTION_PRAGMA_PARSE (tree @var{args}, tree @var{pop_target})
This target hook parses the options for @code{#pragma GCC target}, which
sets the target-specific options for functions that occur later in the
input stream. The options accepted should be the same as those handled by the
@code{TARGET_OPTION_VALID_ATTRIBUTE_P} hook.
@end deftypefn
@deftypefn {Target Hook} void TARGET_OPTION_OVERRIDE (void)
Sometimes certain combinations of command options do not make sense on
a particular target machine. You can override the hook
@code{TARGET_OPTION_OVERRIDE} to take account of this. This hooks is called
once just after all the command options have been parsed.
Don't use this hook to turn on various extra optimizations for
target.def (target_option.optimization): New hook. * target.def (target_option.optimization): New hook. * doc/tm.texi.in (OPTIMIZATION_OPTIONS): Change to TARGET_OPTION_OPTIMIZATION hook. * doc/tm.texi: Regenerate. * hooks.c (hook_void_int_int): New. * hooks.h (hook_void_int_int): Declare. * opts.c: Don't include tm_p.h. (decode_options): Use targetm.target_option.optimization instead of OPTIMIZATION_OPTIONS. * system.h (OPTIMIZATION_OPTIONS): Poison. * config/arm/arm-protos.h (arm_optimization_options): Remove. * config/arm/arm.c (TARGET_OPTION_OPTIMIZATION): Define. (arm_optimization_options): Rename to arm_option_optimization. Make static. * config/arm/arm.h (OPTIMIZATION_OPTIONS): Remove. * config/cris/cris.c (TARGET_OPTION_OPTIMIZATION): Define. (cris_option_optimization): New. * config/cris/cris.h (OPTIMIZATION_OPTIONS): Remove. * config/crx/crx.c (TARGET_OPTION_OPTIMIZATION): Define. (crx_option_optimization): New. * config/crx/crx.h (OPTIMIZATION_OPTIONS): Remove. * config/frv/frv-protos.h (frv_optimization_options): Remove. * config/frv/frv.c (TARGET_OPTION_OPTIMIZATION): Define. (frv_optimization_options): Rename to frv_option_optimization. Make static. * config/frv/frv.h (OPTIMIZATION_OPTIONS): Remove. * config/h8300/h8300.c (h8300_option_optimization): New. (TARGET_OPTION_OPTIMIZATION): Define. * config/h8300/h8300.h (OPTIMIZATION_OPTIONS): Remove. * config/i386/i386-protos.h (optimization_options): Remove. * config/i386/i386.c (optimization_options): Rename to ix86_option_optimization. Make static. (TARGET_OPTION_OPTIMIZATION): Define. * config/i386/i386.h (OPTIMIZATION_OPTIONS): Remove. * config/ia64/ia64-protos.h (ia64_optimization_options): Remove. * config/ia64/ia64.c (TARGET_OPTION_OPTIMIZATION): Define. (ia64_optimization_options): Rename to ia64_option_optimization. Make static. Call SUBTARGET_OPTIMIZATION_OPTIONS. * config/ia64/ia64.h (OPTIMIZATION_OPTIONS): Remove. Remove commented-out definition. * config/ia64/vms.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define instead of OPTIMIZATION_OPTIONS. * config/m32r/m32r.c (TARGET_OPTION_OPTIMIZATION): Define. (m32r_option_optimization): New. * config/m32r/m32r.h (OPTIMIZATION_OPTIONS): Remove. * config/m68hc11/m68hc11-protos.h (m68hc11_optimization_options): Remove. * config/mcore/mcore.c (TARGET_OPTION_OPTIMIZATION): Define. (mcore_option_optimization): New. * config/mcore/mcore.h (OPTIMIZATION_OPTIONS): Remove. * config/mep/mep-protos.h (mep_optimization_options): Remove. * config/mep/mep.c (TARGET_OPTION_OPTIMIZATION): Define. (mep_optimization_options): Rename to mep_option_optimization. Make static. Take unused level and size parameters. * config/mep/mep.h (OPTIMIZATION_OPTIONS): Remove. * config/mmix/mmix.c (TARGET_OPTION_OPTIMIZATION): Define. (mmix_option_optimization): New. * config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove. * config/pdp11/pdp11.c (TARGET_OPTION_OPTIMIZATION): Define. (pdp11_option_optimization): New. * config/pdp11/pdp11.h (OPTIMIZATION_OPTIONS): Remove. * config/rs6000/rs6000-protos.h (optimization_options): Remove. * config/rs6000/rs6000.c (TARGET_OPTION_OPTIMIZATION): Define. (optimization_options): Rename to rs6000_option_optimization. Make static. * config/rs6000/rs6000.h (OPTIMIZATION_OPTIONS): Remove. * config/rx/rx-protos.h (rx_set_optimization_options): Remove. * config/rx/rx.c (rx_set_optimization_options): Rename to rx_option_optimization. Make static. Take unused level and size parameters. (TARGET_OPTION_OPTIMIZATION): Define. * config/rx/rx.h (OPTIMIZATION_OPTIONS): Remove. * config/s390/s390-protos.h (optimization_options): Remove. * config/s390/s390.c (optimization_options): Rename to s390_option_optimization. Make static. Don't mark size parameter unused. (TARGET_OPTION_OPTIMIZATION): Define. * config/s390/s390.h (OPTIMIZATION_OPTIONS): Remove. * config/sh/sh-protos.h (sh_optimization_options): Remove. * config/sh/sh.c (TARGET_OPTION_OPTIMIZATION): Define. (sh_optimization_options): Rename to sh_option_optimization. Make static. Don't mark parameters unused. * config/sh/sh.h (OPTIMIZATION_OPTIONS): Remove. * config/spu/spu-protos.h (spu_optimization_options): Remove. * config/spu/spu.c (TARGET_OPTION_OPTIMIZATION): Define. (spu_optimization_options): Rename to spu_option_optimization. Make static. * config/spu/spu.h (OPTIMIZATION_OPTIONS): Remove. * config/v850/v850.c (TARGET_OPTION_OPTIMIZATION): Define. (v850_option_optimization): New. * config/v850/v850.h (OPTIMIZATION_OPTIONS): Remove. * config/xtensa/xtensa.c (TARGET_OPTION_OPTIMIZATION): Define. (xtensa_option_optimization): New. * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Remove. From-SVN: r164335
2010-09-16 14:04:29 +02:00
@option{-O}. That is what @code{TARGET_OPTION_OPTIMIZATION} is for.
If you need to do something whenever the optimization level is
changed via the optimize attribute or pragma, see
@code{TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE}
@end deftypefn
Function Multiversioning ======================== Sriraman Tallam, tmsriram@google.com Overview of the patch which adds support to specify function versions. This is only enabled for target i386. Example: int foo (); /* Default version */ int foo () __attribute__ ((target("avx,popcnt")));/*Specialized for avx and popcnt */ int foo () __attribute__ ((target("arch=core2,ssse3")));/*Specialized for core2 and ssse3*/ int main () { int (*p)() = &foo; return foo () + (*p)(); } int foo () { return 0; } int __attribute__ ((target("avx,popcnt"))) foo () { return 0; } int __attribute__ ((target("arch=core2,ssse3"))) foo () { return 0; } The above example has foo defined 3 times, but all 3 definitions of foo are different versions of the same function. The call to foo in main, directly and via a pointer, are calls to the multi-versioned function foo which is dispatched to the right foo at run-time. Front-end changes: The front-end changes are calls at appropriate places to target hooks that determine the following: * Determine if two function decls with the same signature are versions. * Determine the assembler name of a function version. * Generate the dispatcher function for a set of function versions. * Compare versions to see if one has a higher priority over the other. All the implementation happens in the target-specific config/i386/i386.c. What does the patch do? * Tracking decls that correspond to function versions of function name, say "foo": When the front-end sees more than one decl for "foo", it calls a target hook to determine if they are versions. To prevent duplicate definition errors with other versions of "foo", "decls_match" function in cp/decl.c is made to return false when 2 decls have are deemed versions by the target. This will make all function versions of "foo" to be added to the overload list of "foo". * Change the assembler names of the function versions. For i386, the target changes the assembler names of the function versions by suffixing the sorted list of args to "target" to the function name of "foo". For example, the assembler name of "void foo () __attribute__ ((target ("sse4")))" will become _Z3foov.sse4. The target hook mangle_decl_assembler_name is used for this. * Overload resolution: Function "build_over_call" in cp/call.c sees a call to function "foo", which is multi-versioned. The overload resolution happens in function "joust" in "cp/call.c". Here, the call to "foo" has all possible versions of "foo" as candidates. All the candidates of "foo" are stored in the cgraph side data structure. Each version of foo is chained in a doubly-linked list with the default function as the first element. This allows any pass to access all the semantically identical versions. A call to a multi-versioned function will be replaced by a call to a dispatcher function, determined by a target hook, to execute the right function version at run-time. Optimization to directly call a version when possible: Also, in joust, where overload resolution happens, a multiversioned function resolution is made to return the most specialized version. This is the version that will be checked for dispatching first and is determined by the target. Now, if the caller can inline this function version then a direct call is made to this function version rather than go through the dispatcher. When a direct call cannot be made, a call to the dispatcher function is created. * Creating the dispatcher body. The dispatcher body, called the resolver is made only when there is a call to a multiversioned function dispatcher or the address of a function is taken. This is generated during cgraph_analyze_function. This is done by another target hook. * Dispatch ordering. The order in which the function versions are checked during dispatch is based on a priority value assigned for the ISA that is catered. More specialized versions are checked for dispatching first. This is to mitigate the ambiguity that can arise when more than one function version is valid for execution on a particular platform. This is not a perfect solution, and in future the user should be allowed to assign a dispatching priority value to each version. Function MV in the Intel compiler: The intel compiler supports function multiversioning and the syntax is similar to the patch proposed here. Here is an example of how to generate multiple function versions with the intel compiler. /* Create a stub function to specify the various versions of function that will be created, using declspec attribute cpu_dispatch. */ __declspec (cpu_dispatch (core_i7_sse4_2, atom, generic)) void foo () {}; /* Bodies of each function version. */ /* Intel Corei7 processor + SSE4.2 version. */ __declspec (cpu_specific(core_i7_sse4_2)) void foo () { printf ("corei7 + sse4.2"); } /* Atom processor. */ __declspec (cpu_specific(atom)) void foo () { printf ("atom"); } /* The generic or the default version. */ __declspec (cpu_specific(generic)) void foo () { printf ("This is generic"); } A new function version is generated by defining a new function with the same signature but with a different cpu_specific declspec attribute string. The set of cpu_specific strings that are allowed is the following: "core_2nd_gen_avx" "core_aes_pclmulqdq" "core_i7_sse4_2" "core_2_duo_sse4_1" "core_2_duo_ssse3" "atom" "pentium_4_sse3" "pentium_4" "pentium_m" "pentium_iii" "generic" Comparison with the GCC MV implementation in this patch: * Version creation syntax: The implementation in this patch also has a similar syntax to specify function versions. The first stub function is not needed. Here is the code to generate the function versions with this patch: /* Intel Corei7 processor + SSE4.2 version. */ __attribute__ ((target ("arch=corei7, sse4.2"))) void foo () { printf ("corei7 + sse4.2"); } /* Atom processor. */ __attribute__ ((target ("arch=atom"))) void foo () { printf ("atom"); } void foo () { } The target attribute can have one of the following arch names: "amd" "intel" "atom" "core2" "corei7" "nehalem" "westmere" "sandybridge" "amdfam10h" "barcelona" "shanghai" "istanbul" "amdfam15h" "bdver1" "bdver2" and any number of the following ISA names: "cmov" "mmx" "popcnt" "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" * doc/tm.texi.in (TARGET_OPTION_FUNCTION_VERSIONS): New hook description. * (TARGET_COMPARE_VERSION_PRIORITY): New hook description. * (TARGET_GET_FUNCTION_VERSIONS_DISPATCHER): New hook description. * (TARGET_GENERATE_VERSION_DISPATCHER_BODY): New hook description. * doc/tm.texi: Regenerate. * target.def (compare_version_priority): New target hook. * (generate_version_dispatcher_body): New target hook. * (get_function_versions_dispatcher): New target hook. * (function_versions): New target hook. * cgraph.c (cgraph_fnver_htab): New htab. (cgraph_fn_ver_htab_hash): New function. (cgraph_fn_ver_htab_eq): New function. (version_info_node): New pointer. (insert_new_cgraph_node_version): New function. (get_cgraph_node_version): New function. (delete_function_version): New function. (record_function_versions): New function. * cgraph.h (cgraph_node): New bitfield dispatcher_function. (cgraph_function_version_info): New struct. (get_cgraph_node_version): New function. (insert_new_cgraph_node_version): New function. (record_function_versions): New function. (delete_function_version): New function. (init_lowered_empty_function): Expose function. * tree.h (DECL_FUNCTION_VERSIONED): New macro. (tree_function_decl): New bit-field versioned_function. * cgraphunit.c (cgraph_analyze_function): Generate body of multiversion function dispatcher. (cgraph_analyze_functions): Analyze dispatcher function. (init_lowered_empty_function): Make non-static. New parameter in_ssa. (assemble_thunk): Add parameter to call to init_lowered_empty_function. * config/i386/i386.c (add_condition_to_bb): New function. (get_builtin_code_for_version): New function. (ix86_compare_version_priority): New function. (feature_compare): New function. (dispatch_function_versions): New function. (ix86_function_versions): New function. (attr_strcmp): New function. (ix86_mangle_function_version_assembler_name): New function. (ix86_mangle_decl_assembler_name): New function. (make_name): New function. (make_dispatcher_decl): New function. (is_function_default_version): New function. (ix86_get_function_versions_dispatcher): New function. (make_attribute): New function. (make_resolver_func): New function. (ix86_generate_version_dispatcher_body): New function. (fold_builtin_cpu): Return integer for cpu builtins. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): New macro. (TARGET_COMPARE_VERSION_PRIORITY): New macro. (TARGET_GENERATE_VERSION_DISPATCHER_BODY): New macro. (TARGET_GET_FUNCTION_VERSIONS_DISPATCHER): New macro. (TARGET_OPTION_FUNCTION_VERSIONS): New macro. * class.c (add_method): Change assembler names of function versions. (mark_versions_used): New static function. (resolve_address_of_overloaded_function): Create dispatcher decl and return address of dispatcher instead. * decl.c (decls_match): Make decls unmatched for versioned functions. (duplicate_decls): Remove ambiguity for versioned functions. Delete versioned function data for merged decls. * decl2.c (check_classfn): Check attributes of versioned functions for match. * call.c (get_function_version_dispatcher): New function. (mark_versions_used): New static function. (build_over_call): Make calls to multiversioned functions to call the dispatcher. (joust): For calls to multi-versioned functions, make the most specialized function version win. * testsuite/g++.dg/mv1.C: New test. * testsuite/g++.dg/mv2.C: New test. * testsuite/g++.dg/mv3.C: New test. * testsuite/g++.dg/mv4.C: New test. * testsuite/g++.dg/mv5.C: New test. * testsuite/g++.dg/mv6.C: New test. From-SVN: r193204
2012-11-06 03:35:17 +01:00
@deftypefn {Target Hook} bool TARGET_OPTION_FUNCTION_VERSIONS (tree @var{decl1}, tree @var{decl2})
This target hook returns @code{true} if @var{DECL1} and @var{DECL2} are
versions of the same function. @var{DECL1} and @var{DECL2} are function
versions if and only if they have the same function signature and
different target specific attributes, that is, they are compiled for
different target machines.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CAN_INLINE_P (tree @var{caller}, tree @var{callee})
This target hook returns @code{false} if the @var{caller} function
cannot inline @var{callee}, based on target specific information. By
default, inlining is not allowed if the callee function has function
specific target options and the caller does not use the same options.
@end deftypefn
targhooks.h (default_emutls_var_fields, [...]): Declare. * targhooks.h (default_emutls_var_fields, default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. From-SVN: r134729
2008-04-27 17:35:19 +02:00
@node Emulated TLS
@section Emulating TLS
@cindex Emulated TLS
For targets whose psABI does not provide Thread Local Storage via
specific relocations and instruction sequences, an emulation layer is
used. A set of target hooks allows this emulation layer to be
configured for the requirements of a particular target. For instance
the psABI may in fact specify TLS support in terms of an emulation
targhooks.h (default_emutls_var_fields, [...]): Declare. * targhooks.h (default_emutls_var_fields, default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. From-SVN: r134729
2008-04-27 17:35:19 +02:00
layer.
The emulation layer works by creating a control object for every TLS
object. To access the TLS object, a lookup function is provided
which, when given the address of the control object, will return the
address of the current thread's instance of the TLS object.
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_GET_ADDRESS
Contains the name of the helper function that uses a TLS control
object to locate a TLS instance. The default causes libgcc's
emulated TLS helper function to be used.
@end deftypevr
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_REGISTER_COMMON
Contains the name of the helper function that should be used at
program startup to register TLS objects that are implicitly
initialized to zero. If this is @code{NULL}, all TLS objects will
have explicit initializers. The default causes libgcc's emulated TLS
registration function to be used.
@end deftypevr
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_VAR_SECTION
Contains the name of the section in which TLS control variables should
be placed. The default of @code{NULL} allows these to be placed in
any section.
@end deftypevr
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_TMPL_SECTION
Contains the name of the section in which TLS initializers should be
placed. The default of @code{NULL} allows these to be placed in any
section.
@end deftypevr
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_VAR_PREFIX
Contains the prefix to be prepended to TLS control variable names.
The default of @code{NULL} uses a target-specific prefix.
@end deftypevr
@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_TMPL_PREFIX
Contains the prefix to be prepended to TLS initializer objects. The
default of @code{NULL} uses a target-specific prefix.
@end deftypevr
@deftypefn {Target Hook} tree TARGET_EMUTLS_VAR_FIELDS (tree @var{type}, tree *@var{name})
Specifies a function that generates the FIELD_DECLs for a TLS control
object type. @var{type} is the RECORD_TYPE the fields are for and
@var{name} should be filled with the structure tag, if the default of
@code{__emutls_object} is unsuitable. The default creates a type suitable
for libgcc's emulated TLS function.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_EMUTLS_VAR_INIT (tree @var{var}, tree @var{decl}, tree @var{tmpl_addr})
Specifies a function that generates the CONSTRUCTOR to initialize a
TLS control object. @var{var} is the TLS control object, @var{decl}
is the TLS object and @var{tmpl_addr} is the address of the
initializer. The default initializes libgcc's emulated TLS control object.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypevr {Target Hook} bool TARGET_EMUTLS_VAR_ALIGN_FIXED
targhooks.h (default_emutls_var_fields, [...]): Declare. * targhooks.h (default_emutls_var_fields, default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. From-SVN: r134729
2008-04-27 17:35:19 +02:00
Specifies whether the alignment of TLS control variable objects is
fixed and should not be increased as some backends may do to optimize
single objects. The default is false.
@end deftypevr
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypevr {Target Hook} bool TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
targhooks.h (default_emutls_var_fields, [...]): Declare. * targhooks.h (default_emutls_var_fields, default_emutls_var_init): Declare. * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL. * target.h (struct gcc_target): Add struct emutls member. * target-def.h (TARGET_EMUTLS_GET_ADDRESS, TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION, TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX, TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS, TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS, TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New. (TARGET_INITIALIZER): Add TARGET_EMUTLS. * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS, BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure. * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can emit debug information. * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL. * varasm.c: Include targhooks.h. (emutls_object_section, emutls_tmpl_section): New. (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove. (EMUTLS_SEPARATOR): New. (prefix_name): New. (get_emutls_object_name): New. (default_emutls_var_fields): New, broken out of ... (get_emutls_object_type): ... here. Adjust to use target hooks. (get_emutls_init_templ_addr): Adjust to use target hooks. (emutls_decl): Adjust to use target hooks. (emutls_finish): Likewise. (default_emutls_var_init): New, broken out of ... (assemble_variable): ... here. Adjust to use target hooks. * output.h (enum section_category): Add SECCAT_EMUTLS_VAR, SECCAT_EMUTLS_TMPL. * c-common.c (handle_section_attribute): Prevent overriding sections for emulated tls with special sections. * config/i386/i386.c (x86_64_elf_select_section): Add SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL. (x86_64_elf_unique_section): Likewise. * config/vxworks.c: Include tree.h. (vxworks_emutls_var_fields, vxworks_emutls_var_init): New. (vxworks_override_options): Set TLS scheme. * gcc/doc/tm.texi (Emulated TLS): New node. gcc/testsuite/ * gcc.dg/tls/section-2.c: New. * gcc.dg/tls/emutls-1.c: New. * lib/target-supports.exp (check_effective_target_tls_native): Exclude vxworks. From-SVN: r134729
2008-04-27 17:35:19 +02:00
Specifies whether a DWARF @code{DW_OP_form_tls_address} location descriptor
may be used to describe emulated TLS control objects.
@end deftypevr
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
@node MIPS Coprocessors
@section Defining coprocessor specifics for MIPS targets.
@cindex MIPS coprocessor-definition macros
The MIPS specification allows MIPS implementations to have as many as 4
coprocessors, each with as many as 32 private registers. GCC supports
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
accessing these registers and transferring values between the registers
and memory using asm-ized variables. For example:
@smallexample
register unsigned int cp0count asm ("c0r1");
unsigned int d;
d = cp0count + 3;
@end smallexample
(``c0r1'' is the default name of register 1 in coprocessor 0; alternate
names may be added as described below, or the default names may be
overridden entirely in @code{SUBTARGET_CONDITIONAL_REGISTER_USAGE}.)
Coprocessor registers are assumed to be epilogue-used; sets to them will
be preserved even if it does not appear that the register is used again
later in the function.
Another note: according to the MIPS spec, coprocessor 1 (if present) is
the FPU@. One accesses COP1 registers through standard mips
mips.c (mips_class_max_nregs, [...]): New functions. 2002-04-24 Matt Hiller <hiller@redhat.com> * mips.c (mips_class_max_nregs, mips_register_move_cost): New functions. * mips.h (CLASS_MAX_NREGS, REGISTER_MOVE_COST): Redefine as calls of the corresponding functions. * mips-protos.h (mips_class_max_nregs, mips_register_move_cost): New prototypes. 2002-04-24 Matt Hiller <hiller@redhat.com> * config/mips/mips.h (mips_sw_reg_names): Declare as extern. (ALL_COP_ADDITIONAL_REGISTER_NAMES): New macro. (FIRST_PSEUDO_REGISTER): Redefine considering coprocessor registers, adjust comment accordingly. (FIXED_REGISTERS, CALL_USED_REGISTERS, CALL_REALLY_USED_REGISTERS, reg_class, REG_CLASS_NAMES, REG_CLASS_CONTENTS, REGISTER_NAMES, DEBUG_REGISTER_NAMES, REG_ALLOC_ORDER): Adjust to include entries for coprocessor registers. (ADDITIONAL_REGISTER_NAMES): Include ALL_COP_ADDITIONAL_REGISTER_NAMES. (COP0_REG_FIRST, COP0_REG_LAST, COP0_REG_NUM, COP2_REG_FIRST, COP2_REG_LAST, COP2_REG_NUM, COP3_REG_FIRST, COP3_REG_LAST, COP3_REG_NUM, COP0_REG_P, COP2_REG_P, COP3_REG_P, ALL_COP_REG_P, COPNUM_AS_CHAR_FROM_REGNUM, COP_REG_CLASS_P): New macros. (mips_char_to_class): Adjust comment to include coprocessor constraint letters. * config/mips/mips.c (coprocessor_operand, coprocessor2_operand): New functions. (mips_reg_names, mips_regno_to_class): Include coprocessor information. (mips_sw_reg_names): Ditto, make non-static. (mips_move_1word): Handle moves to and from coprocessor registers. (mips_move_2words): Handle moves to and from coprocessor registers. (mips_class_max_nregs, mips_register_move_cost): Handle coprocessor register classes. (override_options): Initialize mips_char_to_class and mips_hard_regno_mode_ok properly for coprocessor registers. * config/mips/mips.md (movdi_internal, movdi_internal2, movsi_internal1, movsi_internal2): Add constraint-sets for coprocessor registers. * testsuite/gcc.c-torture/mipscop-1.c: New testcase. * testsuite/gcc.c-torture/mipscop-1.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-2.c: New testcase. * testsuite/gcc.c-torture/mipscop-2.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-3.c: New testcase. * testsuite/gcc.c-torture/mipscop-3.x: Disable above if target isn't mips. * testsuite/gcc.c-torture/mipscop-4.c: New testcase. * testsuite/gcc.c-torture/mipscop-4.x: Disable above if target isn't mips. * doc/tm.texi: Document feature. From-SVN: r52765
2002-04-25 21:31:45 +02:00
floating-point support; they are not included in this mechanism.
@node PCH Target
@section Parameters for Precompiled Header Validity Checking
@cindex parameters, precompiled headers
@deftypefn {Target Hook} {void *} TARGET_GET_PCH_VALIDITY (size_t *@var{sz})
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
This hook returns a pointer to the data needed by
@code{TARGET_PCH_VALID_P} and sets
@samp{*@var{sz}} to the size of the data in bytes.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_PCH_VALID_P (const void *@var{data}, size_t @var{sz})
This hook checks whether the options used to create a PCH file are
compatible with the current settings. It returns @code{NULL}
if so and a suitable error message if not. Error messages will
be presented to the user and must be localized using @samp{_(@var{msg})}.
@var{data} is the data that was returned by @code{TARGET_GET_PCH_VALIDITY}
when the PCH file was created and @var{sz} is the size of that data in bytes.
It's safe to assume that the data was created by the same version of the
compiler, so no format checking is needed.
The default definition of @code{default_pch_valid_p} should be
suitable for most targets.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_CHECK_PCH_TARGET_FLAGS (int @var{pch_flags})
If this hook is nonnull, the default implementation of
@code{TARGET_PCH_VALID_P} will use it to check for compatible values
of @code{target_flags}. @var{pch_flags} specifies the value that
@code{target_flags} had when the PCH file was created. The return
value is the same as for @code{TARGET_PCH_VALID_P}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_PREPARE_PCH_SAVE (void)
Called before writing out a PCH file. If the target has some
garbage-collected data that needs to be in a particular state on PCH loads,
it can use this hook to enforce that state. Very few targets need
to do anything here.
@end deftypefn
@node C++ ABI
@section C++ ABI parameters
@cindex parameters, c++ abi
@deftypefn {Target Hook} tree TARGET_CXX_GUARD_TYPE (void)
Define this hook to override the integer type used for guard variables.
These are used to implement one-time construction of static objects. The
default is long_long_integer_type_node.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_GUARD_MASK_BIT (void)
This hook determines how guard variables are used. It should return
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@code{false} (the default) if the first byte should be used. A return value of
@code{true} indicates that only the least significant bit should be used.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_CXX_GET_COOKIE_SIZE (tree @var{type})
This hook returns the size of the cookie to use when allocating an array
whose elements have the indicated @var{type}. Assumes that it is already
known that a cookie is needed. The default is
@code{max(sizeof (size_t), alignof(type))}, as defined in section 2.7 of the
IA64/Generic C++ ABI@.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_COOKIE_HAS_SIZE (void)
This hook should return @code{true} if the element size should be stored in
array cookies. The default is to return @code{false}.
@end deftypefn
re PR other/44034 (target hooks are hard to maintain) gcc: PR other/44034 * target.def, doc/tm.texi.in, genhooks.c: New files. * target.h: Instead of defining individual hook members, define DEFHOOKPOD / DEFHOOK / DEFHOOK_UNDOC / HOOKSTRUCT and include target.def. * target-def.h: Instead of defining individual hook initializers, include target-hooks-def.h. * df-scan.c, haifa-sched.c, sel-sched.c: Rename targetm members: targetm.live_on_entry -> targetm.extra_live_on_entry targetm.sched.md_finish ->targetm.sched.finish targetm.sched.md_init -> targetm.sched.init targetm.sched.md_init_global -> targetm.sched.init_global targetm.asm_out.unwind_label -> targetm.asm_out.emit_unwind_label targetm.asm_out.except_table_label -> targetm.asm_out.emit_except_table_label targetm.asm_out.visibility -> targetm.asm_out.assemble_visibility targetm.target_help -> targetm.help targetm.vectorize.builtin_support_vector_misalignment -> targetm.vectorize.support_vector_misalignment targetm.file_start_app_off -> targetm.asm_file_start_app_off targetm.file_start_file_directive -> targetm.asm_file_start_file_directive * dwarf2out.c, opts.c, tree-vect-data-refs.c, except.c: Likewise. * varasm.c, config/alpha/alpha.c, config/cris/cris.c: Likewise. * gcc/config/spu/spu.c, config/ia64/ia64.c: Rename target macros: TARGET_VECTOR_ALIGNMENT_REACHABLE -> TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE TARGET_SUPPORT_VECTOR_MISALIGNMENT -> TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT TARGET_UNWIND_EMIT -> TARGET_ASM_UNWIND_EMIT * config/rs6000/rs6000.c, config/arm/arm.c: Likewise. * Makefile.in (TARGET_H): Depend on target.def. (TARGET_DEF_H): Depend on target-hooks-def.h. (target-hooks-def.h, tm.texi, s-target-hooks-def-h): New rules. (s-tm-texi, build/genhooks.o, build/genhooks): Likewise. * doc/tm.texi: Regenerate. gcc/c-family: * c-common.c: Rename targetm member: targetm.enum_va_list -> targetm.enum_va_list_p gcc/po: * EXCLUDES: Add genhooks.c. Index: gcc/doc/tm.texi From-SVN: r161547
2010-06-29 20:22:00 +02:00
@deftypefn {Target Hook} int TARGET_CXX_IMPORT_EXPORT_CLASS (tree @var{type}, int @var{import_export})
If defined by a backend this hook allows the decision made to export
class @var{type} to be overruled. Upon entry @var{import_export}
will contain 1 if the class is going to be exported, @minus{}1 if it is going
to be imported and 0 otherwise. This function should return the
modified value and perform any other actions necessary to support the
backend's targeted operating system.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_CDTOR_RETURNS_THIS (void)
This hook should return @code{true} if constructors and destructors return
the address of the object created/destroyed. The default is to return
@code{false}.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_KEY_METHOD_MAY_BE_INLINE (void)
This hook returns true if the key method for a class (i.e., the method
which, if defined in the current translation unit, causes the virtual
table to be emitted) may be an inline function. Under the standard
Itanium C++ ABI the key method may be an inline function so long as
the function is not declared inline in the class definition. Under
some variants of the ABI, an inline function can never be the key
method. The default is to return @code{true}.
@end deftypefn
@deftypefn {Target Hook} void TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY (tree @var{decl})
re PR other/44034 (target hooks are hard to maintain) gcc: PR other/44034 * target.def, doc/tm.texi.in, genhooks.c: New files. * target.h: Instead of defining individual hook members, define DEFHOOKPOD / DEFHOOK / DEFHOOK_UNDOC / HOOKSTRUCT and include target.def. * target-def.h: Instead of defining individual hook initializers, include target-hooks-def.h. * df-scan.c, haifa-sched.c, sel-sched.c: Rename targetm members: targetm.live_on_entry -> targetm.extra_live_on_entry targetm.sched.md_finish ->targetm.sched.finish targetm.sched.md_init -> targetm.sched.init targetm.sched.md_init_global -> targetm.sched.init_global targetm.asm_out.unwind_label -> targetm.asm_out.emit_unwind_label targetm.asm_out.except_table_label -> targetm.asm_out.emit_except_table_label targetm.asm_out.visibility -> targetm.asm_out.assemble_visibility targetm.target_help -> targetm.help targetm.vectorize.builtin_support_vector_misalignment -> targetm.vectorize.support_vector_misalignment targetm.file_start_app_off -> targetm.asm_file_start_app_off targetm.file_start_file_directive -> targetm.asm_file_start_file_directive * dwarf2out.c, opts.c, tree-vect-data-refs.c, except.c: Likewise. * varasm.c, config/alpha/alpha.c, config/cris/cris.c: Likewise. * gcc/config/spu/spu.c, config/ia64/ia64.c: Rename target macros: TARGET_VECTOR_ALIGNMENT_REACHABLE -> TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE TARGET_SUPPORT_VECTOR_MISALIGNMENT -> TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT TARGET_UNWIND_EMIT -> TARGET_ASM_UNWIND_EMIT * config/rs6000/rs6000.c, config/arm/arm.c: Likewise. * Makefile.in (TARGET_H): Depend on target.def. (TARGET_DEF_H): Depend on target-hooks-def.h. (target-hooks-def.h, tm.texi, s-target-hooks-def-h): New rules. (s-tm-texi, build/genhooks.o, build/genhooks): Likewise. * doc/tm.texi: Regenerate. gcc/c-family: * c-common.c: Rename targetm member: targetm.enum_va_list -> targetm.enum_va_list_p gcc/po: * EXCLUDES: Add genhooks.c. Index: gcc/doc/tm.texi From-SVN: r161547
2010-06-29 20:22:00 +02:00
@var{decl} is a virtual table, virtual table table, typeinfo object, or other similar implicit class data object that will be emitted with external linkage in this translation unit. No ELF visibility has been explicitly specified. If the target needs to specify a visibility other than that of the containing class, use this hook to set @code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT (void)
This hook returns true (the default) if virtual tables and other
similar implicit class data objects are always COMDAT if they have
external linkage. If this hook returns false, then class data for
classes whose virtual table will be emitted in only one translation
unit will not be COMDAT.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void)
This hook returns true (the default) if the RTTI information for
the basic types which is defined in the C++ runtime should always
be COMDAT, false if it should not be COMDAT.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void)
This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI)
should be used to register static destructors when @option{-fuse-cxa-atexit}
is in effect. The default is to return false to use @code{__cxa_atexit}.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT (void)
This hook returns true if the target @code{atexit} function can be used
in the same manner as @code{__cxa_atexit} to register C++ static
destructors. This requires that @code{atexit}-registered functions in
shared libraries are run in the correct order when the libraries are
unloaded. The default is to return false.
@end deftypefn
re PR target/21275 (gcc 4.0.0 crash with mingw when using stdout in global var) PR middle-end/21275 PR middle-end/21766 * target.h (struct gcc_target): Add valid_dllimport_attribute_p target hook. (struct cxx): Add adjust_class_at_definition target hook. * target-def.h: (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): New define, defaulting to hook_bool_tree_true. Add to TARGET_INITIALIZER (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): New define, defaulting to hook_void_tree. Add to TARGET_CXX. * tree.h (struct decl_with_vis): Rename non_addr_const_p field to dllimport_flag. (DECL_NON_ADDR_CONSTANT_P): Replace with DECL_DLLIMPORT_P macro. * tree.c (merge_dllimport_decl_attributes): Check DECL_DLLIMPORT_P instead of attribute. Check for dllexport override. Warn if inconsistent dll linkage. Don't lose old dllimport if decl has had address referenced. Tweak lookup of dllimport atribute. (handle_dll_attribute): Check targetm.valid_dllimport_attribute_p for target specific rules. Don't add dllimport attribute if DECL_DECLARED_INLINE_P. Set DECL_DLLIMPORT_P when adding dllimport attribute. (staticp): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P. * varasm.c (initializer_constant_valid_p): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P PR target/21801 PR target/23589 * config.gcc (i[34567]86-*-cygwin*): Add winnt-cxx.o to 'cxx_target_objs', winnt-stubs,o to 'extra_objs'. (i[34567]86-*-mingw32*): Likewise. * doc/tm.texi (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Document. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Document. * config/i386/winnt.c (i386_pe_dllimport_p): Factor out C++-specific code. Change return value to bool. (i386_pe_dllimport_p): Likewise. (associated_type): Simplify and make language-independent (i386_pe_encode_section_info): Replace override of ambiguous dllimport symbol refs with a gcc_assert. (i386_pe_valid_dllimport_attribute_p): Define. * config/i386/winnt-cxx.c: New file. Define C++ versions of i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. * config/i386/winnt-stubs.c: New file. Define stub versions of lang-specific functions. * config/i386/i386-protos.h: Declare winnt-[cxx|stubs].c functions i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. (i386_pe_valid_dllimport_attribute_p): Declare. * config/i386/cygming.h (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Define. (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Define. * config/i386/t-cygming: Add rules for winnt-cxx.o, winnt-stubs.o. PR target/19704 * config/i386/i386.c (ix86_function_ok_for_sibcall): Replace test for dllimport attribute with test of DECL_DLLIMPORT_P. cp PR target/21801 PR target/23589 * class.c (finish_struct_1): Call targetm.cxx.adjust_class_at_definition. testsuite * gcc.dg/dll-2.c: Add tests for warnings. * gcc.dg/dll-3.c: Likewise. * gcc.dg/dll-4.c: Likewise. * g++.dg/ext/dllimport1.C: Adjust tests for warnings. * g++.dg/ext/dllimport2.C: Likewise. * g++.dg/ext/dllimport3.C: Likewise. * g++.dg/ext/dllimport7.C: Likewise. * g++.dg/ext/dllimport8.C: Likewise. * g++.dg/ext/dllimport9.C: Likewise. From-SVN: r105332
2005-10-12 22:54:50 +02:00
@deftypefn {Target Hook} void TARGET_CXX_ADJUST_CLASS_AT_DEFINITION (tree @var{type})
re PR other/44034 (target hooks are hard to maintain) gcc: PR other/44034 * target.def, doc/tm.texi.in, genhooks.c: New files. * target.h: Instead of defining individual hook members, define DEFHOOKPOD / DEFHOOK / DEFHOOK_UNDOC / HOOKSTRUCT and include target.def. * target-def.h: Instead of defining individual hook initializers, include target-hooks-def.h. * df-scan.c, haifa-sched.c, sel-sched.c: Rename targetm members: targetm.live_on_entry -> targetm.extra_live_on_entry targetm.sched.md_finish ->targetm.sched.finish targetm.sched.md_init -> targetm.sched.init targetm.sched.md_init_global -> targetm.sched.init_global targetm.asm_out.unwind_label -> targetm.asm_out.emit_unwind_label targetm.asm_out.except_table_label -> targetm.asm_out.emit_except_table_label targetm.asm_out.visibility -> targetm.asm_out.assemble_visibility targetm.target_help -> targetm.help targetm.vectorize.builtin_support_vector_misalignment -> targetm.vectorize.support_vector_misalignment targetm.file_start_app_off -> targetm.asm_file_start_app_off targetm.file_start_file_directive -> targetm.asm_file_start_file_directive * dwarf2out.c, opts.c, tree-vect-data-refs.c, except.c: Likewise. * varasm.c, config/alpha/alpha.c, config/cris/cris.c: Likewise. * gcc/config/spu/spu.c, config/ia64/ia64.c: Rename target macros: TARGET_VECTOR_ALIGNMENT_REACHABLE -> TARGET_VECTORIZE_VECTOR_ALIGNMENT_REACHABLE TARGET_SUPPORT_VECTOR_MISALIGNMENT -> TARGET_VECTORIZE_SUPPORT_VECTOR_MISALIGNMENT TARGET_UNWIND_EMIT -> TARGET_ASM_UNWIND_EMIT * config/rs6000/rs6000.c, config/arm/arm.c: Likewise. * Makefile.in (TARGET_H): Depend on target.def. (TARGET_DEF_H): Depend on target-hooks-def.h. (target-hooks-def.h, tm.texi, s-target-hooks-def-h): New rules. (s-tm-texi, build/genhooks.o, build/genhooks): Likewise. * doc/tm.texi: Regenerate. gcc/c-family: * c-common.c: Rename targetm member: targetm.enum_va_list -> targetm.enum_va_list_p gcc/po: * EXCLUDES: Add genhooks.c. Index: gcc/doc/tm.texi From-SVN: r161547
2010-06-29 20:22:00 +02:00
@var{type} is a C++ class (i.e., RECORD_TYPE or UNION_TYPE) that has just been defined. Use this hook to make adjustments to the class (eg, tweak visibility or perform any other required target modifications).
re PR target/21275 (gcc 4.0.0 crash with mingw when using stdout in global var) PR middle-end/21275 PR middle-end/21766 * target.h (struct gcc_target): Add valid_dllimport_attribute_p target hook. (struct cxx): Add adjust_class_at_definition target hook. * target-def.h: (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): New define, defaulting to hook_bool_tree_true. Add to TARGET_INITIALIZER (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): New define, defaulting to hook_void_tree. Add to TARGET_CXX. * tree.h (struct decl_with_vis): Rename non_addr_const_p field to dllimport_flag. (DECL_NON_ADDR_CONSTANT_P): Replace with DECL_DLLIMPORT_P macro. * tree.c (merge_dllimport_decl_attributes): Check DECL_DLLIMPORT_P instead of attribute. Check for dllexport override. Warn if inconsistent dll linkage. Don't lose old dllimport if decl has had address referenced. Tweak lookup of dllimport atribute. (handle_dll_attribute): Check targetm.valid_dllimport_attribute_p for target specific rules. Don't add dllimport attribute if DECL_DECLARED_INLINE_P. Set DECL_DLLIMPORT_P when adding dllimport attribute. (staticp): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P. * varasm.c (initializer_constant_valid_p): Replace DECL_NON_ADDR_CONSTANT_P with DECL_DLLIMPORT_P PR target/21801 PR target/23589 * config.gcc (i[34567]86-*-cygwin*): Add winnt-cxx.o to 'cxx_target_objs', winnt-stubs,o to 'extra_objs'. (i[34567]86-*-mingw32*): Likewise. * doc/tm.texi (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Document. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Document. * config/i386/winnt.c (i386_pe_dllimport_p): Factor out C++-specific code. Change return value to bool. (i386_pe_dllimport_p): Likewise. (associated_type): Simplify and make language-independent (i386_pe_encode_section_info): Replace override of ambiguous dllimport symbol refs with a gcc_assert. (i386_pe_valid_dllimport_attribute_p): Define. * config/i386/winnt-cxx.c: New file. Define C++ versions of i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. * config/i386/winnt-stubs.c: New file. Define stub versions of lang-specific functions. * config/i386/i386-protos.h: Declare winnt-[cxx|stubs].c functions i386_pe_type_dllimport_p, i386_pe_type_dllexport_p, i386_pe_adjust_class_at_definition. (i386_pe_valid_dllimport_attribute_p): Declare. * config/i386/cygming.h (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Define. (TARGET_CXX_ADJUST_CLASS_AT_DEFINITION): Define. * config/i386/t-cygming: Add rules for winnt-cxx.o, winnt-stubs.o. PR target/19704 * config/i386/i386.c (ix86_function_ok_for_sibcall): Replace test for dllimport attribute with test of DECL_DLLIMPORT_P. cp PR target/21801 PR target/23589 * class.c (finish_struct_1): Call targetm.cxx.adjust_class_at_definition. testsuite * gcc.dg/dll-2.c: Add tests for warnings. * gcc.dg/dll-3.c: Likewise. * gcc.dg/dll-4.c: Likewise. * g++.dg/ext/dllimport1.C: Adjust tests for warnings. * g++.dg/ext/dllimport2.C: Likewise. * g++.dg/ext/dllimport3.C: Likewise. * g++.dg/ext/dllimport7.C: Likewise. * g++.dg/ext/dllimport8.C: Likewise. * g++.dg/ext/dllimport9.C: Likewise. From-SVN: r105332
2005-10-12 22:54:50 +02:00
@end deftypefn
@deftypefn {Target Hook} tree TARGET_CXX_DECL_MANGLING_CONTEXT (const_tree @var{decl})
Return target-specific mangling context of @var{decl} or @code{NULL_TREE}.
@end deftypefn
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
@node Named Address Spaces
@section Adding support for named address spaces
@cindex named address spaces
The draft technical report of the ISO/IEC JTC1 S22 WG14 N1275
standards committee, @cite{Programming Languages - C - Extensions to
support embedded processors}, specifies a syntax for embedded
processors to specify alternate address spaces. You can configure a
GCC port to support section 5.1 of the draft report to add support for
address spaces other than the default address space. These address
spaces are new keywords that are similar to the @code{volatile} and
@code{const} type attributes.
Pointers to named address spaces can have a different size than
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
pointers to the generic address space.
For example, the SPU port uses the @code{__ea} address space to refer
to memory in the host processor, rather than memory local to the SPU
processor. Access to memory in the @code{__ea} address space involves
issuing DMA operations to move data between the host processor and the
local processor memory address space. Pointers in the @code{__ea}
address space are either 32 bits or 64 bits based on the
@option{-mea32} or @option{-mea64} switches (native SPU pointers are
always 32 bits).
Internally, address spaces are represented as a small integer in the
range 0 to 15 with address space 0 being reserved for the generic
address space.
To register a named address space qualifier keyword with the C front end,
the target may call the @code{c_register_addr_space} routine. For example,
the SPU port uses the following to declare @code{__ea} as the keyword for
named address space #1:
tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. * c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is defined, add the named address space keywords. (c_addr_space_name): New function. (complete_array_type): Preserve named address space. (handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15, RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE. (ADDR_SPACE_KEYWORD): New macro. (c_addr_space_name): Add prototype. * c-tree.h (struct c_declspecs): Add address_space member. (declspecs_add_addrspace): Add prototype. * c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces. * c-parser.c (c_parse_init): Add assertion. (typedef enum c_id_kind): Add C_ID_ADDRSPACE. (c_lex_one_token): Handle address space keywords. (c_token_starts_typename): Likewise. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_postfix_expression_after_paren_type): Diagnose compound literal within function qualified with named address space. * c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named address space qualifiers. (shadow_tag_warned): Warn about useless address space qualifiers. (quals_from_declspecs): Handle address space qualifiers. (grokdeclarator): Likewise. (build_null_declspecs): Likewise. (declspecs_add_addrspace): New function. * c-typeck.c (addr_space_superset): New function. (qualify_type): Handle named address spaces. (composite_type): Likewise. (common_pointer_type): Likewise. (comp_target_types): Likewise. (build_conditional_expr): Likewise. (handle_warn_cast_qual): Likewise. (build_c_cast): Likewise. (convert_for_assignment): Likewise. (build_binary_op): Likewise. (pointer_diff): Handle named address spaces. Use intermediate integer type of sufficient size if required. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153574
2009-10-26 22:58:06 +01:00
@smallexample
#define ADDR_SPACE_EA 1
c_register_addr_space ("__ea", ADDR_SPACE_EA);
tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_KEYWORDS): Document. * c-common.c (c_common_reswords): If TARGET_ADDR_SPACE_KEYWORDS is defined, add the named address space keywords. (c_addr_space_name): New function. (complete_array_type): Preserve named address space. (handle_mode_attribute): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * c-common.h (enum rid): Add RID_ADDR_SPACE_0 .. RID_ADDR_SPACE_15, RID_FIRST_ADDR_SPACE and RID_LAST_ADDR_SPACE. (ADDR_SPACE_KEYWORD): New macro. (c_addr_space_name): Add prototype. * c-tree.h (struct c_declspecs): Add address_space member. (declspecs_add_addrspace): Add prototype. * c-pretty-print.c (pp_c_type_qualifier_list): Handle address spaces. * c-parser.c (c_parse_init): Add assertion. (typedef enum c_id_kind): Add C_ID_ADDRSPACE. (c_lex_one_token): Handle address space keywords. (c_token_starts_typename): Likewise. (c_token_starts_declspecs): Likewise. (c_parser_declspecs): Likewise. (c_parser_postfix_expression_after_paren_type): Diagnose compound literal within function qualified with named address space. * c-decl.c (diagnose_mismatched_decls): Diagnose conflicting named address space qualifiers. (shadow_tag_warned): Warn about useless address space qualifiers. (quals_from_declspecs): Handle address space qualifiers. (grokdeclarator): Likewise. (build_null_declspecs): Likewise. (declspecs_add_addrspace): New function. * c-typeck.c (addr_space_superset): New function. (qualify_type): Handle named address spaces. (composite_type): Likewise. (common_pointer_type): Likewise. (comp_target_types): Likewise. (build_conditional_expr): Likewise. (handle_warn_cast_qual): Likewise. (build_c_cast): Likewise. (convert_for_assignment): Likewise. (build_binary_op): Likewise. (pointer_diff): Handle named address spaces. Use intermediate integer type of sufficient size if required. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153574
2009-10-26 22:58:06 +01:00
@end smallexample
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_ADDR_SPACE_POINTER_MODE (addr_space_t @var{address_space})
tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. * target.h (struct target_def): Add pointer_mode, address_mode, and valid_pointer_mode to addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. (TARGET_ADDR_SPACE_HOOKS): Add them. * targhooks.c (target_default_pointer_address_modes_p): New function. * target.h (target_default_pointer_address_modes_p): Add prototype. * targhooks.c (default_addr_space_pointer_mode): New function. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * targhooks.h (default_addr_space_pointer_mode): Add prototype. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * output.h (default_valid_pointer_mode): Move to ... * targhooks.h (default_valid_pointer_mode): ... here. * varasm.c (default_valid_pointer_mode): Move to ... * targhooks.c (default_valid_pointer_mode): ... here. * varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * fold-const.c (fit_double_type): Use int_or_pointer_precision. * tree.c (integer_pow2p): Likewise. (tree_log2): Likewise. (tree_floor_log2): Likewise. (signed_or_unsigned_type_for): Support pointer type of different size. (int_or_pointer_precision): New function. * tree.h (int_or_pointer_precision): Add prototype. * stor-layout.c (layout_type): Set TYPE_PRECISION for offset types. * varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of incoming pointer type instead of POINTER_SIZE. * tree.c (build_pointer_type): Use appropriate pointer mode instead of ptr_mode. (build_reference_type): Likewise. * expr.c (store_expr): Likewise. (expand_expr_addr_expr): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * auto-inc-dec.c: Include "target.h". (try_merge): Use appropriate address mode instead of Pmode. (find_inc): Likewise. * combine.c (find_split_point): Likewise. * cselib.c (cselib_record_sets): Likewise. * dse.c (replace_inc_dec): Likewise. (canon_address): Likewise. * var-tracking.c (replace_expr_with_values): Likewise. (count_uses): Likewise. (add_uses): Likewise. (add_stores): Likewise. * emit-rtl.c: Include "target.h". (adjust_address_1): Use appropriate address mode instead of Pmode. (offset_address): Likewise. * explow.c (break_out_memory_refs): Likewise. (memory_address_addr_space): Likewise. (promote_mode): Likewise. * expr.c (move_by_pieces): Likewise. (emit_block_move_via_loop): Likewise. (store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (expand_assignment): Likewise. (store_constructor): Likewise. (expand_expr_addr_expr): Likewise. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * regcprop.c (kill_autoinc_value): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_reloads): Likewise. (find_reloads_address): Likewise. (find_reloads_address_1): Likewise. * sched-deps.c: Include "target.h". (sched_analyze_1): Use appropriate address mode instead of Pmode. (sched_analyze_2): Likewise. * sel-sched-dump.c: Include "target.h". (debug_mem_addr_value): Use appropriate address mode instead of Pmode. * stor-layout.c (layout_type): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. (multiplier_allowed_in_address_p): Likewise. (get_address_cost): Likewise. * varasm.c (make_decl_rtl): Likewise. * expr.c (expand_assignment): Always convert offsets to appropriate address mode. (store_expr): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. * reload.h (form_sum): Add MODE argument. * reload.c (form_sum): Add MODE argument, use it instead of Pmode. Update recursive calls. (subst_indexed_address): Update calls to form_sum. * tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument. * tree-ssa-address.c: Include "target.h". (templates): Replace by ... (mem_addr_template_list): ... this new vector. (TEMPL_IDX): Handle address space numbers. (gen_addr_rtx): Add address mode argument, use it instead of Pmode. (addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space instead of global cache. Update call to gen_addr_rtx. (valid_mem_ref_p): Update call to addr_for_mem_ref. * expr.c (expand_expr_real_1): Update call to addr_for_mem_ref. * rtl.h (convert_memory_address_addr_space): Add prototype. (convert_memory_address): Define as macro. * explow.c (convert_memory_address): Rename to ... (convert_memory_address_addr_space): ... this. Add ADDRSPACE argument. Use appropriate pointer and address modes instead of ptr_mode / Pmode. Update recursive calls. (memory_address_addr_space): Call convert_memory_address_addr_space. * expmed.c (make_tree): Likewise. * expr.c (expand_assignment): Likewise. (expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument. (expand_expr_addr_expr): Likewise. Also, update call. * alias.c (find_base_value): Guard pointer size optimizations. (find_base_term): Likewise. * rtlanal.c (nonzero_bits1): Likewise. (num_sign_bit_copies1): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. * Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency. (emit-rtl.o): Likewise. (auto-inc-dec.o): Likewise. (sched-deps.o): Likewise. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153573
2009-10-26 22:57:10 +01:00
Define this to return the machine mode to use for pointers to
@var{address_space} if the target supports named address spaces.
The default version of this hook returns @code{ptr_mode} for the
generic address space only.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} machine_mode TARGET_ADDR_SPACE_ADDRESS_MODE (addr_space_t @var{address_space})
tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. * target.h (struct target_def): Add pointer_mode, address_mode, and valid_pointer_mode to addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. (TARGET_ADDR_SPACE_HOOKS): Add them. * targhooks.c (target_default_pointer_address_modes_p): New function. * target.h (target_default_pointer_address_modes_p): Add prototype. * targhooks.c (default_addr_space_pointer_mode): New function. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * targhooks.h (default_addr_space_pointer_mode): Add prototype. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * output.h (default_valid_pointer_mode): Move to ... * targhooks.h (default_valid_pointer_mode): ... here. * varasm.c (default_valid_pointer_mode): Move to ... * targhooks.c (default_valid_pointer_mode): ... here. * varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * fold-const.c (fit_double_type): Use int_or_pointer_precision. * tree.c (integer_pow2p): Likewise. (tree_log2): Likewise. (tree_floor_log2): Likewise. (signed_or_unsigned_type_for): Support pointer type of different size. (int_or_pointer_precision): New function. * tree.h (int_or_pointer_precision): Add prototype. * stor-layout.c (layout_type): Set TYPE_PRECISION for offset types. * varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of incoming pointer type instead of POINTER_SIZE. * tree.c (build_pointer_type): Use appropriate pointer mode instead of ptr_mode. (build_reference_type): Likewise. * expr.c (store_expr): Likewise. (expand_expr_addr_expr): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * auto-inc-dec.c: Include "target.h". (try_merge): Use appropriate address mode instead of Pmode. (find_inc): Likewise. * combine.c (find_split_point): Likewise. * cselib.c (cselib_record_sets): Likewise. * dse.c (replace_inc_dec): Likewise. (canon_address): Likewise. * var-tracking.c (replace_expr_with_values): Likewise. (count_uses): Likewise. (add_uses): Likewise. (add_stores): Likewise. * emit-rtl.c: Include "target.h". (adjust_address_1): Use appropriate address mode instead of Pmode. (offset_address): Likewise. * explow.c (break_out_memory_refs): Likewise. (memory_address_addr_space): Likewise. (promote_mode): Likewise. * expr.c (move_by_pieces): Likewise. (emit_block_move_via_loop): Likewise. (store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (expand_assignment): Likewise. (store_constructor): Likewise. (expand_expr_addr_expr): Likewise. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * regcprop.c (kill_autoinc_value): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_reloads): Likewise. (find_reloads_address): Likewise. (find_reloads_address_1): Likewise. * sched-deps.c: Include "target.h". (sched_analyze_1): Use appropriate address mode instead of Pmode. (sched_analyze_2): Likewise. * sel-sched-dump.c: Include "target.h". (debug_mem_addr_value): Use appropriate address mode instead of Pmode. * stor-layout.c (layout_type): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. (multiplier_allowed_in_address_p): Likewise. (get_address_cost): Likewise. * varasm.c (make_decl_rtl): Likewise. * expr.c (expand_assignment): Always convert offsets to appropriate address mode. (store_expr): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. * reload.h (form_sum): Add MODE argument. * reload.c (form_sum): Add MODE argument, use it instead of Pmode. Update recursive calls. (subst_indexed_address): Update calls to form_sum. * tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument. * tree-ssa-address.c: Include "target.h". (templates): Replace by ... (mem_addr_template_list): ... this new vector. (TEMPL_IDX): Handle address space numbers. (gen_addr_rtx): Add address mode argument, use it instead of Pmode. (addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space instead of global cache. Update call to gen_addr_rtx. (valid_mem_ref_p): Update call to addr_for_mem_ref. * expr.c (expand_expr_real_1): Update call to addr_for_mem_ref. * rtl.h (convert_memory_address_addr_space): Add prototype. (convert_memory_address): Define as macro. * explow.c (convert_memory_address): Rename to ... (convert_memory_address_addr_space): ... this. Add ADDRSPACE argument. Use appropriate pointer and address modes instead of ptr_mode / Pmode. Update recursive calls. (memory_address_addr_space): Call convert_memory_address_addr_space. * expmed.c (make_tree): Likewise. * expr.c (expand_assignment): Likewise. (expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument. (expand_expr_addr_expr): Likewise. Also, update call. * alias.c (find_base_value): Guard pointer size optimizations. (find_base_term): Likewise. * rtlanal.c (nonzero_bits1): Likewise. (num_sign_bit_copies1): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. * Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency. (emit-rtl.o): Likewise. (auto-inc-dec.o): Likewise. (sched-deps.o): Likewise. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153573
2009-10-26 22:57:10 +01:00
Define this to return the machine mode to use for addresses in
@var{address_space} if the target supports named address spaces.
The default version of this hook returns @code{Pmode} for the
generic address space only.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_VALID_POINTER_MODE (machine_mode @var{mode}, addr_space_t @var{as})
tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. * target.h (struct target_def): Add pointer_mode, address_mode, and valid_pointer_mode to addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. (TARGET_ADDR_SPACE_HOOKS): Add them. * targhooks.c (target_default_pointer_address_modes_p): New function. * target.h (target_default_pointer_address_modes_p): Add prototype. * targhooks.c (default_addr_space_pointer_mode): New function. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * targhooks.h (default_addr_space_pointer_mode): Add prototype. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * output.h (default_valid_pointer_mode): Move to ... * targhooks.h (default_valid_pointer_mode): ... here. * varasm.c (default_valid_pointer_mode): Move to ... * targhooks.c (default_valid_pointer_mode): ... here. * varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * fold-const.c (fit_double_type): Use int_or_pointer_precision. * tree.c (integer_pow2p): Likewise. (tree_log2): Likewise. (tree_floor_log2): Likewise. (signed_or_unsigned_type_for): Support pointer type of different size. (int_or_pointer_precision): New function. * tree.h (int_or_pointer_precision): Add prototype. * stor-layout.c (layout_type): Set TYPE_PRECISION for offset types. * varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of incoming pointer type instead of POINTER_SIZE. * tree.c (build_pointer_type): Use appropriate pointer mode instead of ptr_mode. (build_reference_type): Likewise. * expr.c (store_expr): Likewise. (expand_expr_addr_expr): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * auto-inc-dec.c: Include "target.h". (try_merge): Use appropriate address mode instead of Pmode. (find_inc): Likewise. * combine.c (find_split_point): Likewise. * cselib.c (cselib_record_sets): Likewise. * dse.c (replace_inc_dec): Likewise. (canon_address): Likewise. * var-tracking.c (replace_expr_with_values): Likewise. (count_uses): Likewise. (add_uses): Likewise. (add_stores): Likewise. * emit-rtl.c: Include "target.h". (adjust_address_1): Use appropriate address mode instead of Pmode. (offset_address): Likewise. * explow.c (break_out_memory_refs): Likewise. (memory_address_addr_space): Likewise. (promote_mode): Likewise. * expr.c (move_by_pieces): Likewise. (emit_block_move_via_loop): Likewise. (store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (expand_assignment): Likewise. (store_constructor): Likewise. (expand_expr_addr_expr): Likewise. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * regcprop.c (kill_autoinc_value): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_reloads): Likewise. (find_reloads_address): Likewise. (find_reloads_address_1): Likewise. * sched-deps.c: Include "target.h". (sched_analyze_1): Use appropriate address mode instead of Pmode. (sched_analyze_2): Likewise. * sel-sched-dump.c: Include "target.h". (debug_mem_addr_value): Use appropriate address mode instead of Pmode. * stor-layout.c (layout_type): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. (multiplier_allowed_in_address_p): Likewise. (get_address_cost): Likewise. * varasm.c (make_decl_rtl): Likewise. * expr.c (expand_assignment): Always convert offsets to appropriate address mode. (store_expr): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. * reload.h (form_sum): Add MODE argument. * reload.c (form_sum): Add MODE argument, use it instead of Pmode. Update recursive calls. (subst_indexed_address): Update calls to form_sum. * tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument. * tree-ssa-address.c: Include "target.h". (templates): Replace by ... (mem_addr_template_list): ... this new vector. (TEMPL_IDX): Handle address space numbers. (gen_addr_rtx): Add address mode argument, use it instead of Pmode. (addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space instead of global cache. Update call to gen_addr_rtx. (valid_mem_ref_p): Update call to addr_for_mem_ref. * expr.c (expand_expr_real_1): Update call to addr_for_mem_ref. * rtl.h (convert_memory_address_addr_space): Add prototype. (convert_memory_address): Define as macro. * explow.c (convert_memory_address): Rename to ... (convert_memory_address_addr_space): ... this. Add ADDRSPACE argument. Use appropriate pointer and address modes instead of ptr_mode / Pmode. Update recursive calls. (memory_address_addr_space): Call convert_memory_address_addr_space. * expmed.c (make_tree): Likewise. * expr.c (expand_assignment): Likewise. (expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument. (expand_expr_addr_expr): Likewise. Also, update call. * alias.c (find_base_value): Guard pointer size optimizations. (find_base_term): Likewise. * rtlanal.c (nonzero_bits1): Likewise. (num_sign_bit_copies1): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. * Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency. (emit-rtl.o): Likewise. (auto-inc-dec.o): Likewise. (sched-deps.o): Likewise. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153573
2009-10-26 22:57:10 +01:00
Define this to return nonzero if the port can handle pointers
with machine mode @var{mode} to address space @var{as}. This target
hook is the same as the @code{TARGET_VALID_POINTER_MODE} target hook,
except that it includes explicit named address space support. The default
version of this hook returns true for the modes returned by either the
@code{TARGET_ADDR_SPACE_POINTER_MODE} or @code{TARGET_ADDR_SPACE_ADDRESS_MODE}
target hooks for the given address space.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P (machine_mode @var{mode}, rtx @var{exp}, bool @var{strict}, addr_space_t @var{as})
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
Define this to return true if @var{exp} is a valid address for mode
@var{mode} in the named address space @var{as}. The @var{strict}
parameter says whether strict addressing is in effect after reload has
finished. This target hook is the same as the
@code{TARGET_LEGITIMATE_ADDRESS_P} target hook, except that it includes
explicit named address space support.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS (rtx @var{x}, rtx @var{oldx}, machine_mode @var{mode}, addr_space_t @var{as})
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
Define this to modify an invalid address @var{x} to be a valid address
with mode @var{mode} in the named address space @var{as}. This target
hook is the same as the @code{TARGET_LEGITIMIZE_ADDRESS} target hook,
except that it includes explicit named address space support.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t @var{subset}, addr_space_t @var{superset})
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
Define this to return whether the @var{subset} named address space is
contained within the @var{superset} named address space. Pointers to
a named address space that is a subset of another named address space
will be converted automatically without a cast if used together in
arithmetic operations. Pointers to a superset address space can be
converted to pointers to a subset address space via explicit casts.
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} rtx TARGET_ADDR_SPACE_CONVERT (rtx @var{op}, tree @var{from_type}, tree @var{to_type})
extend.texi (Named Address Spaces): New section. 2009-10-26 Ben Elliston <bje@au.ibm.com> Michael Meissner <meissner@linux.vnet.ibm.com> Ulrich Weigand <uweigand@de.ibm.com> * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. Co-Authored-By: Michael Meissner <meissner@linux.vnet.ibm.com> Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com> From-SVN: r153572
2009-10-26 22:55:59 +01:00
Define this to convert the pointer expression represented by the RTL
@var{op} with type @var{from_type} that points to a named address
space to a new pointer expression with type @var{to_type} that points
to a different named address space. When this hook it called, it is
guaranteed that one of the two address spaces is a subset of the other,
as determined by the @code{TARGET_ADDR_SPACE_SUBSET_P} target hook.
@end deftypefn
1996-09-25 01:21:45 +02:00
@node Misc
@section Miscellaneous Parameters
@cindex parameters, miscellaneous
@c prevent bad page break with this line
Here are several miscellaneous parameters.
genpreds.c: Add capability to generate predicate bodies as well as function prototypes. * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. From-SVN: r85855
2004-08-12 09:49:00 +02:00
@defmac HAS_LONG_COND_BRANCH
Define this boolean macro to indicate whether or not your architecture
has conditional branches that can span all of memory. It is used in
conjunction with an optimization that partitions hot and cold basic
blocks into separate sections of the executable. If this macro is
set to false, gcc will convert any conditional branches that attempt
to cross between sections into unconditional branches or indirect jumps.
@end defmac
@defmac HAS_LONG_UNCOND_BRANCH
Define this boolean macro to indicate whether or not your architecture
has unconditional branches that can span all of memory. It is used in
conjunction with an optimization that partitions hot and cold basic
blocks into separate sections of the executable. If this macro is
set to false, gcc will convert any unconditional branches that attempt
to cross between sections into indirect jumps.
@end defmac
@defmac CASE_VECTOR_MODE
1996-09-25 01:21:45 +02:00
An alias for a machine mode name. This is the machine mode that
elements of a jump-table should have.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac CASE_VECTOR_SHORTEN_MODE (@var{min_offset}, @var{max_offset}, @var{body})
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
Optional: return the preferred mode for an @code{addr_diff_vec}
when the minimum and maximum offset are known. If you define this,
it enables extra code in branch shortening to deal with @code{addr_diff_vec}.
To make this work, you also have to define @code{INSN_ALIGN} and
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
make the alignment for @code{addr_diff_vec} explicit.
The @var{body} argument is provided so that the offset_unsigned and scale
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
flags can be updated.
@end defmac
rtl.h (addr_diff_vec_flags): New typedef. * rtl.h (addr_diff_vec_flags): New typedef. (union rtunion_def): New member rt_addr_diff_vec_flags. (ADDR_DIFF_VEC_FLAGS): New macro. * sh.c (output_branch): Fix offset overflow problems. * final.c (shorten_branches): Implement CASE_VECTOR_SHORTEN_MODE. (final_scan_insn): New argument BODY for ASM_OUTPUT_ADDR_DIFF_ELT. * rtl.def (ADDR_DIFF_VEC): Three new fields (min, max and flags). * stmt.c (expand_end_case): Supply new arguments to gen_rtx_ADDR_DIFF_VEC. * 1750a.h (ASM_OUTPUT_ADDR_DIFF_ELT): New argument BODY. * alpha.h, arc.h, clipper.h, convex.h : Likewise. * dsp16xx.h, elxsi.h, fx80.h, gmicro.h, h8300.h : Likewise. * i370.h, i386.h, i860.h, i960.h, m32r.h, m68k.h, m88k.h : Likewise. * mips.h, mn10200.h, mn10300.h, ns32k.h, pa.h, pyr.h : Likewise. * rs6000.h, sh.h, sparc.h, spur.h, tahoe.h, v850.h : Likewise. * vax.h, we32k.h, alpha/vms.h, arm/aof.h, arm/aout.h : Likewise. * i386/386bsd.h, i386/freebsd-elf.h : Likewise. * i386/freebsd.h, i386/linux.h : Likewise. * i386/netbsd.h, i386/osfrose.h, i386/ptx4-i.h, i386/sco5.h : Likewise. * i386/sysv4.h, m68k/3b1.h, m68k/dpx2.h, m68k/hp320.h : Likewise. * m68k/mot3300.h, m68k/sgs.h : Likewise. * m68k/tower-as.h, ns32k/encore.h, sparc/pbd.h : Likewise. * sh.h (INSN_ALIGN, INSN_LENGTH_ALIGNMENT): Define. (CASE_VECTOR_SHORTEN_MODE): Define. (short_cbranch_p, align_length, addr_diff_vec_adjust): Don't declare. (med_branch_p, braf_branch_p): Don't declare. (mdep_reorg_phase, barrier_align): Declare. (ADJUST_INSN_LENGTH): Remove alignment handling. * sh.c (uid_align, uid_align_max): Deleted. (max_uid_before_fixup_addr_diff_vecs, branch_offset): Deleted. (short_cbranch_p, med_branch_p, braf_branch_p, align_length): Deleted. (cache_align_p, fixup_aligns, addr_diff_vec_adjust): Deleted. (output_far_jump): Don't use braf_branch_p. (output_branchy_insn): Don't use branch_offset. (find_barrier): Remove checks for max_uid_before_fixup_addr_diff_vecs. Remove paired barrier stuff. Don't use cache_align_p. Take alignment insns into account. (fixup_addr_diff_vecs): Reduce to only fixing up the base label of the addr_diff_vec. (barrier_align, branch_dest): New function. (machine_dependent_reorg, split_branches): Remove infrastructure for branch shortening that is now provided in the backend. * sh.md (short_cbranch_p, med_branch_p, med_cbranch_p): New attributes. (braf_branch_p, braf_cbranch_p): Likewise. (attribute length): Use new attributes. (casesi_worker): Get mode and unsignednedd from ADDR_DIFF_VEC. (addr_diff_vec_adjust): Delete. (align_2): Now a define_expand. (align_log): Now length 0. From-SVN: r18433
1998-03-06 15:54:07 +01:00
@defmac CASE_VECTOR_PC_RELATIVE
Define this macro to be a C expression to indicate when jump-tables
should contain relative addresses. You need not define this macro if
jump-tables never contain relative addresses, or jump-tables should
contain relative addresses only when @option{-fPIC} or @option{-fPIC}
is in effect.
@end defmac
1996-09-25 01:21:45 +02:00
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {unsigned int} TARGET_CASE_VALUES_THRESHOLD (void)
This function return the smallest number of different values for which it
1996-09-25 01:21:45 +02:00
is best to use a jump-table instead of a tree of conditional branches.
The default is four for machines with a @code{casesi} instruction and
five otherwise. This is best for most machines.
@end deftypefn
1996-09-25 01:21:45 +02:00
@defmac WORD_REGISTER_OPERATIONS
1996-09-25 01:21:45 +02:00
Define this macro if operations between registers with integral mode
smaller than a word are always performed on the entire register.
Most RISC machines have this property and most CISC machines do not.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac LOAD_EXTEND_OP (@var{mem_mode})
1996-09-25 01:21:45 +02:00
Define this macro to be a C expression indicating when insns that read
memory in @var{mem_mode}, an integral mode narrower than a word, set the
bits outside of @var{mem_mode} to be either the sign-extension or the
1996-09-25 01:21:45 +02:00
zero-extension of the data read. Return @code{SIGN_EXTEND} for values
of @var{mem_mode} for which the
1996-09-25 01:21:45 +02:00
insn sign-extends, @code{ZERO_EXTEND} for which it zero-extends, and
@code{UNKNOWN} for other modes.
1996-09-25 01:21:45 +02:00
This macro is not called with @var{mem_mode} non-integral or with a width
1996-09-25 01:21:45 +02:00
greater than or equal to @code{BITS_PER_WORD}, so you may return any
value in this case. Do not define this macro if it would always return
@code{UNKNOWN}. On machines where this macro is defined, you will normally
1996-09-25 01:21:45 +02:00
define it as the constant @code{SIGN_EXTEND} or @code{ZERO_EXTEND}.
You may return a non-@code{UNKNOWN} value even if for some hard registers
the sign extension is not performed, if for the @code{REGNO_REG_CLASS}
of these hard registers @code{CANNOT_CHANGE_MODE_CLASS} returns nonzero
when the @var{from} mode is @var{mem_mode} and the @var{to} mode is any
integral mode larger than this but not larger than @code{word_mode}.
You must return @code{UNKNOWN} if for some hard registers that allow this
mode, @code{CANNOT_CHANGE_MODE_CLASS} says that they cannot change to
@code{word_mode}, but that they can change to another integral mode that
is larger then @var{mem_mode} but still smaller than @code{word_mode}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SHORT_IMMEDIATES_SIGN_EXTEND
Define this macro if loading short immediate values into registers sign
extends.
@end defmac
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned int} TARGET_MIN_DIVISIONS_FOR_RECIP_MUL (machine_mode @var{mode})
re PR tree-optimization/23109 (compiler generates wrong code leading to spurious division by zero with -funsafe-math-optimizations (instead of -ftrapping-math)) gcc: 2006-01-11 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/23109 PR tree-optimization/23948 PR tree-optimization/24123 * Makefile.in (tree-ssa-math-opts.o): Adjust dependencies. * tree-cfg.c (single_noncomplex_succ): New. * tree-flow.h (single_noncomplex_succ): Declare it. * tree-ssa-math-opts.c (enum place_reciprocal): Remove. * tree-ssa-math-opts.c (enum place_reciprocal): Remove. (struct occurrence, occ_head, occ_pool, is_divide_by, compute_merit, insert_bb, register_division_in, insert_reciprocals, replace_reciprocal, free_bb): New. (execute_cse_reciprocals_1): Rewritten. (execute_cse_reciprocals): Adjust calls to execute_cse_reciprocals_1. Do not commit any edge insertion. Always compute dominators and create the allocation pool. * target-def.h (TARGET_MIN_DIVISIONS_FOR_RECIP_MUL): New. * target.h (struct gcc_target): Add min_divistions_for_recip_mul. * targhooks.c (default_min_divistions_for_recip_mul): New. * targhooks.h (default_min_divistions_for_recip_mul): New prototype. * passes.c (init_optimization_passes): Run recip after tree loop optimizations. * doc/tm.texi (Misc): Document TARGET_MIN_DIVISIONS_FOR_RECIP_MUL. gcc/testsuite: 2006-01-11 Paolo Bonzini <bonzini@gnu.org> PR tree-optimization/23109 PR tree-optimization/23948 PR tree-optimization/24123 * gcc.dg/tree-ssa/recip-3.c, gcc.dg/tree-ssa/recip-4.c, gcc.dg/tree-ssa/recip-5.c, gcc.dg/tree-ssa/recip-6.c, gcc.dg/tree-ssa/recip-7.c, gcc.dg/tree-ssa/pr23109.c, g++.dg/tree-ssa/pr23948.C: New testcases. * gcc.dg/tree-ssa/recip-2.c, gcc.dg/tree-ssa/pr23234.c: Provide three divisions in order to do the optimization. From-SVN: r109578
2006-01-11 14:02:18 +01:00
When @option{-ffast-math} is in effect, GCC tries to optimize
divisions by the same divisor, by turning them into multiplications by
the reciprocal. This target hook specifies the minimum number of divisions
that should be there for GCC to perform the optimization for a variable
of mode @var{mode}. The default implementation returns 3 if the machine
has an instruction for the division, and 2 if it does not.
@end deftypefn
@defmac MOVE_MAX
1996-09-25 01:21:45 +02:00
The maximum number of bytes that a single instruction can move quickly
between memory and registers or between two memory locations.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MAX_MOVE_MAX
1996-09-25 01:21:45 +02:00
The maximum number of bytes that a single instruction can move quickly
between memory and registers or between two memory locations. If this
is undefined, the default is @code{MOVE_MAX}. Otherwise, it is the
constant value that is the largest value that @code{MOVE_MAX} can have
at run-time.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac SHIFT_COUNT_TRUNCATED
1996-09-25 01:21:45 +02:00
A C expression that is nonzero if on this machine the number of bits
actually used for the count of a shift operation is equal to the number
of bits needed to represent the size of the object being shifted. When
this macro is nonzero, the compiler will assume that it is safe to omit
1996-09-25 01:21:45 +02:00
a sign-extend, zero-extend, and certain bitwise `and' instructions that
truncates the count of a shift operation. On machines that have
instructions that act on bit-fields at variable positions, which may
1996-09-25 01:21:45 +02:00
include `bit test' instructions, a nonzero @code{SHIFT_COUNT_TRUNCATED}
also enables deletion of truncations of the values that serve as
arguments to bit-field instructions.
1996-09-25 01:21:45 +02:00
If both types of instructions truncate the count (for shifts) and
position (for bit-field operations), or if no variable-position bit-field
1996-09-25 01:21:45 +02:00
instructions exist, you should define this macro.
However, on some machines, such as the 80386 and the 680x0, truncation
only applies to shift operations and not the (real or pretended)
bit-field operations. Define @code{SHIFT_COUNT_TRUNCATED} to be zero on
1996-09-25 01:21:45 +02:00
such machines. Instead, add patterns to the @file{md} file that include
the implied truncation of the shift instructions.
You need not define this macro if it would always have the value of zero.
@end defmac
1996-09-25 01:21:45 +02:00
@anchor{TARGET_SHIFT_TRUNCATION_MASK}
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned HOST_WIDE_INT} TARGET_SHIFT_TRUNCATION_MASK (machine_mode @var{mode})
This function describes how the standard shift patterns for @var{mode}
deal with shifts by negative amounts or by more than the width of the mode.
@xref{shift patterns}.
On many machines, the shift patterns will apply a mask @var{m} to the
shift count, meaning that a fixed-width shift of @var{x} by @var{y} is
equivalent to an arbitrary-width shift of @var{x} by @var{y & m}. If
this is true for mode @var{mode}, the function should return @var{m},
otherwise it should return 0. A return value of 0 indicates that no
particular behavior is guaranteed.
Note that, unlike @code{SHIFT_COUNT_TRUNCATED}, this function does
@emph{not} apply to general shift rtxes; it applies only to instructions
that are generated by the named shift patterns.
The default implementation of this function returns
@code{GET_MODE_BITSIZE (@var{mode}) - 1} if @code{SHIFT_COUNT_TRUNCATED}
and 0 otherwise. This definition is always safe, but if
@code{SHIFT_COUNT_TRUNCATED} is false, and some shift patterns
nevertheless truncate the shift count, you may get better code
by overriding it.
@end deftypefn
@defmac TRULY_NOOP_TRUNCATION (@var{outprec}, @var{inprec})
1996-09-25 01:21:45 +02:00
A C expression which is nonzero if on this machine it is safe to
``convert'' an integer of @var{inprec} bits to one of @var{outprec}
bits (where @var{outprec} is smaller than @var{inprec}) by merely
operating on it as if it had only @var{outprec} bits.
On many machines, this expression can be 1.
@c rearranged this, removed the phrase "it is reported that". this was
@c to fix an overfull hbox. --mew 10feb93
When @code{TRULY_NOOP_TRUNCATION} returns 1 for a pair of sizes for
modes for which @code{MODES_TIEABLE_P} is 0, suboptimal code can result.
If this is the case, making @code{TRULY_NOOP_TRUNCATION} return 0 in
such cases may improve things.
@end defmac
1996-09-25 01:21:45 +02:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} int TARGET_MODE_REP_EXTENDED (machine_mode @var{mode}, machine_mode @var{rep_mode})
The representation of an integral mode can be such that the values
are always extended to a wider integral mode. Return
@code{SIGN_EXTEND} if values of @var{mode} are represented in
sign-extended form to @var{rep_mode}. Return @code{UNKNOWN}
otherwise. (Currently, none of the targets use zero-extended
representation this way so unlike @code{LOAD_EXTEND_OP},
@code{TARGET_MODE_REP_EXTENDED} is expected to return either
@code{SIGN_EXTEND} or @code{UNKNOWN}. Also no target extends
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@var{mode} to @var{rep_mode} so that @var{rep_mode} is not the next
widest integral mode and currently we take advantage of this fact.)
Similarly to @code{LOAD_EXTEND_OP} you may return a non-@code{UNKNOWN}
value even if the extension is not performed on certain hard registers
as long as for the @code{REGNO_REG_CLASS} of these hard registers
@code{CANNOT_CHANGE_MODE_CLASS} returns nonzero.
Note that @code{TARGET_MODE_REP_EXTENDED} and @code{LOAD_EXTEND_OP}
describe two related properties. If you define
@code{TARGET_MODE_REP_EXTENDED (mode, word_mode)} you probably also want
to define @code{LOAD_EXTEND_OP (mode)} to return the same type of
extension.
In order to enforce the representation of @code{mode},
@code{TRULY_NOOP_TRUNCATION} should return false when truncating to
@code{mode}.
@end deftypefn
@defmac STORE_FLAG_VALUE
1996-09-25 01:21:45 +02:00
A C expression describing the value returned by a comparison operator
with an integral mode and stored by a store-flag instruction
(@samp{cstore@var{mode}4}) when the condition is true. This description must
apply to @emph{all} the @samp{cstore@var{mode}4} patterns and all the
1996-09-25 01:21:45 +02:00
comparison operators whose results have a @code{MODE_INT} mode.
A value of 1 or @minus{}1 means that the instruction implementing the
comparison operator returns exactly 1 or @minus{}1 when the comparison is true
1996-09-25 01:21:45 +02:00
and 0 when the comparison is false. Otherwise, the value indicates
which bits of the result are guaranteed to be 1 when the comparison is
true. This value is interpreted in the mode of the comparison
operation, which is given by the mode of the first operand in the
@samp{cstore@var{mode}4} pattern. Either the low bit or the sign bit of
1996-09-25 01:21:45 +02:00
@code{STORE_FLAG_VALUE} be on. Presently, only those bits are used by
the compiler.
If @code{STORE_FLAG_VALUE} is neither 1 or @minus{}1, the compiler will
1996-09-25 01:21:45 +02:00
generate code that depends only on the specified bits. It can also
replace comparison operators with equivalent operations if they cause
the required bits to be set, even if the remaining bits are undefined.
For example, on a machine whose comparison operators return an
@code{SImode} value and where @code{STORE_FLAG_VALUE} is defined as
@samp{0x80000000}, saying that just the sign bit is relevant, the
expression
@smallexample
(ne:SI (and:SI @var{x} (const_int @var{power-of-2})) (const_int 0))
@end smallexample
@noindent
can be converted to
@smallexample
(ashift:SI @var{x} (const_int @var{n}))
@end smallexample
@noindent
where @var{n} is the appropriate shift count to move the bit being
tested into the sign bit.
There is no way to describe a machine that always sets the low-order bit
for a true value, but does not guarantee the value of any other bits,
but we do not know of any machine that has such an instruction. If you
are trying to port GCC to such a machine, include an instruction to
1996-09-25 01:21:45 +02:00
perform a logical-and of the result with 1 in the pattern for the
comparison operators and let us know at @email{gcc@@gcc.gnu.org}.
1996-09-25 01:21:45 +02:00
Often, a machine will have multiple instructions that obtain a value
from a comparison (or the condition codes). Here are rules to guide the
choice of value for @code{STORE_FLAG_VALUE}, and hence the instructions
to be used:
@itemize @bullet
@item
Use the shortest sequence that yields a valid definition for
@code{STORE_FLAG_VALUE}. It is more efficient for the compiler to
``normalize'' the value (convert it to, e.g., 1 or 0) than for the
comparison operators to do so because there may be opportunities to
combine the normalization with other operations.
@item
For equal-length sequences, use a value of 1 or @minus{}1, with @minus{}1 being
1996-09-25 01:21:45 +02:00
slightly preferred on machines with expensive jumps and 1 preferred on
other machines.
@item
As a second choice, choose a value of @samp{0x80000001} if instructions
exist that set both the sign and low-order bits but do not define the
others.
@item
Otherwise, use a value of @samp{0x80000000}.
@end itemize
Many machines can produce both the value chosen for
@code{STORE_FLAG_VALUE} and its negation in the same number of
instructions. On those machines, you should also define a pattern for
those cases, e.g., one matching
@smallexample
(set @var{A} (neg:@var{m} (ne:@var{m} @var{B} @var{C})))
@end smallexample
Some machines can also perform @code{and} or @code{plus} operations on
condition code values with less instructions than the corresponding
@samp{cstore@var{mode}4} insn followed by @code{and} or @code{plus}. On those
1996-09-25 01:21:45 +02:00
machines, define the appropriate patterns. Use the names @code{incscc}
and @code{decscc}, respectively, for the patterns which perform
@code{plus} or @code{minus} operations on condition code values. See
@file{rs6000.md} for some examples. The GNU Superoptimizer can be used to
1996-09-25 01:21:45 +02:00
find such instruction sequences on other machines.
If this macro is not defined, the default value, 1, is used. You need
not define @code{STORE_FLAG_VALUE} if the machine has no store-flag
instructions, or if the value generated by these instructions is 1.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FLOAT_STORE_FLAG_VALUE (@var{mode})
A C expression that gives a nonzero @code{REAL_VALUE_TYPE} value that is
1996-09-25 01:21:45 +02:00
returned when comparison operators with floating-point results are true.
Define this macro on machines that have comparison operations that return
1996-09-25 01:21:45 +02:00
floating-point values. If there are no such operations, do not define
this macro.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac VECTOR_STORE_FLAG_VALUE (@var{mode})
A C expression that gives a rtx representing the nonzero true element
for vector comparisons. The returned rtx should be valid for the inner
mode of @var{mode} which is guaranteed to be a vector mode. Define
this macro on machines that have vector comparison operations that
return a vector result. If there are no such operations, do not define
this macro. Typically, this macro is defined as @code{const1_rtx} or
@code{constm1_rtx}. This macro may return @code{NULL_RTX} to prevent
the compiler optimizing such vector comparison operations for the
given mode.
@end defmac
@defmac CLZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
@defmacx CTZ_DEFINED_VALUE_AT_ZERO (@var{mode}, @var{value})
A C expression that indicates whether the architecture defines a value
for @code{clz} or @code{ctz} with a zero operand.
A result of @code{0} indicates the value is undefined.
If the value is defined for only the RTL expression, the macro should
evaluate to @code{1}; if the value applies also to the corresponding optab
entry (which is normally the case if it expands directly into
the corresponding RTL), then the macro should evaluate to @code{2}.
In the cases where the value is defined, @var{value} should be set to
this value.
If this macro is not defined, the value of @code{clz} or
@code{ctz} at zero is assumed to be undefined.
This macro must be defined if the target's expansion for @code{ffs}
relies on a particular value to get correct results. Otherwise it
is not necessary, though it may be used to optimize some corner cases, and
to provide a default expansion for the @code{ffs} optab.
Note that regardless of this macro the ``definedness'' of @code{clz}
and @code{ctz} at zero do @emph{not} extend to the builtin functions
visible to the user. Thus one may be free to adjust the value at will
to match the target expansion of these operations without fear of
breaking the API@.
@end defmac
@defmac Pmode
1996-09-25 01:21:45 +02:00
An alias for the machine mode for pointers. On most machines, define
this to be the integer mode corresponding to the width of a hardware
pointer; @code{SImode} on 32-bit machine or @code{DImode} on 64-bit machines.
On some machines you must define this to be one of the partial integer
modes, such as @code{PSImode}.
The width of @code{Pmode} must be at least as large as the value of
@code{POINTER_SIZE}. If it is not equal, you must define the macro
@code{POINTERS_EXTEND_UNSIGNED} to specify how pointers are extended
to @code{Pmode}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac FUNCTION_MODE
1996-09-25 01:21:45 +02:00
An alias for the machine mode used for memory references to functions
being called, in @code{call} RTL expressions. On most CISC machines,
where an instruction can begin at any byte address, this should be
@code{QImode}. On most RISC machines, where all instructions have fixed
size and alignment, this should be a mode with the same size and alignment
as the machine instruction words - typically @code{SImode} or @code{HImode}.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac STDC_0_IN_SYSTEM_HEADERS
In normal operation, the preprocessor expands @code{__STDC__} to the
constant 1, to signify that GCC conforms to ISO Standard C@. On some
hosts, like Solaris, the system compiler uses a different convention,
where @code{__STDC__} is normally 0, but is 1 if the user specifies
strict conformance to the C Standard.
Defining @code{STDC_0_IN_SYSTEM_HEADERS} makes GNU CPP follows the host
convention when processing system header files, but when processing user
files @code{__STDC__} will always expand to 1.
@end defmac
gcc: * config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu): Use glibc-c.o in c_target_objs and cxx_target_objs. Use t-glibc in tmake_file. Set target_has_targetcm. (tilegx-*-linux*, tilepro-*-linux*): Append to c_target_objs and cxx_target_objs rather than overriding previous value. * config/glibc-c.c, config/t-glibc: New. * doc/tm.texi.in (TARGET_C_PREINCLUDE): New @hook. * doc/tm.texi: Regenerate. * hooks.c (hook_constcharptr_void_null): New. * hooks.h (hook_constcharptr_void_null): Declare. gcc/c-family: * c-common.h (pch_cpp_save_state): Declare. * c-target.def (c_preinclude): New hook. * c-opts.c (done_preinclude): New. (push_command_line_include): Handle default preincluded header. (cb_file_change): Call pch_cpp_save_state when calling push_command_line_include. * c-pch.c (pch_ready_to_save_cpp_state, pch_cpp_state_saved) (pch_cpp_save_state): New. (pch_init): Call pch_cpp_save_state conditionally, instead of calling cpp_save_state. gcc/testsuite: * gcc.dg/c99-predef-1.c: New test. * gcc.dg/cpp/cmdlne-dU-1.c, gcc.dg/cpp/cmdlne-dU-2.c, gcc.dg/cpp/cmdlne-dU-3.c, gcc.dg/cpp/cmdlne-dU-4.c, gcc.dg/cpp/cmdlne-dU-5.c, gcc.dg/cpp/cmdlne-dU-6.c, gcc.dg/cpp/cmdlne-dU-7.c, gcc.dg/cpp/cmdlne-dU-8.c, gcc.dg/cpp/cmdlne-dU-9.c, gcc.dg/cpp/cmdlne-dU-10.c, gcc.dg/cpp/cmdlne-dU-11.c, gcc.dg/cpp/cmdlne-dU-12.c, gcc.dg/cpp/cmdlne-dU-13.c, gcc.dg/cpp/cmdlne-dU-14.c, gcc.dg/cpp/cmdlne-dU-15.c, gcc.dg/cpp/cmdlne-dU-16.c, gcc.dg/cpp/cmdlne-dU-17.c, gcc.dg/cpp/cmdlne-dU-18.c, gcc.dg/cpp/cmdlne-dU-19.c, gcc.dg/cpp/cmdlne-dU-20.c, gcc.dg/cpp/cmdlne-dU-21.c, gcc.dg/cpp/cmdlne-dU-22.c, gcc.dg/cpp/mi5.c, gcc.dg/cpp/multiline.c: Add -nostdinc to dg-options. libcpp: * files.c (struct _cpp_file): Add implicit_preinclude. (pch_open_file): Allow a previously opened implicitly included file. (_cpp_find_file): Add implicit_preinclude argument. Free file and do not call open_file_failed if implicit_preinclude. Store implicit_preinclude value. (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date): Update calls to _cpp_find_file. (_cpp_stack_include): Handle IT_DEFAULT. (cpp_push_default_include): New. * include/cpplib.h (cpp_push_default_include): Declare. * init.c (cpp_read_main_file): Update call to _cpp_find_file. * internal.h (enum include_type): Add IT_DEFAULT. (_cpp_find_file): Update prototype. From-SVN: r192715
2012-10-23 16:55:55 +02:00
@deftypefn {C Target Hook} {const char *} TARGET_C_PREINCLUDE (void)
Define this hook to return the name of a header file to be included at the start of all compilations, as if it had been included with @code{#include <@var{file}>}. If this hook returns @code{NULL}, or is not defined, or the header is not found, or if the user specifies @option{-ffreestanding} or @option{-nostdinc}, no header is included.
This hook can be used together with a header provided by the system C library to implement ISO C requirements for certain macros to be predefined that describe properties of the whole implementation rather than just the compiler.
@end deftypefn
@deftypefn {C Target Hook} bool TARGET_CXX_IMPLICIT_EXTERN_C (const char*@var{})
Define this hook to add target-specific C++ implicit extern C functions. If this function returns true for the name of a file-scope function, that function implicitly gets extern "C" linkage rather than whatever language linkage the declaration would normally have. An example of such function is WinMain on Win32 targets.
@end deftypefn
@defmac NO_IMPLICIT_EXTERN_C
Define this macro if the system header files support C++ as well as C@.
1996-09-25 01:21:45 +02:00
This macro inhibits the usual method of using system header files in
C++, which is to pretend that the file's contents are enclosed in
@samp{extern "C" @{@dots{}@}}.
@end defmac
1996-09-25 01:21:45 +02:00
@findex #pragma
@findex pragma
@defmac REGISTER_TARGET_PRAGMAS ()
Define this macro if you want to implement any target-specific pragmas.
If defined, it is a C expression which makes a series of calls to
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
@code{c_register_pragma} or @code{c_register_pragma_with_expansion}
for each pragma. The macro may also do any
setup required for the pragmas.
The primary reason to define this macro is to provide compatibility with
other compilers for the same target. In general, we discourage
definition of target-specific pragmas for GCC@.
1996-09-25 01:21:45 +02:00
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
If the pragma can be implemented by attributes then you should consider
Table-driven attributes. * c-decl.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/arm/pe.c, config/avr/avr.c, config/avr/avr.h, config/d30v/d30v.h, config/fr30/fr30.h, config/h8300/h8300.c, config/i386/cygwin.h, config/i386/winnt.c, config/m32r/m32r.c, config/mcore/mcore.c, config/sh/sh.c, config/stormy16/stormy16.h, config/v850/v850.c, doc/c-tree.texi, doc/tm.texi, ggc-common.c, integrate.c, print-tree.c, tree.c, tree.h: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * tree.h (struct tree_decl): Change machine_attributes to attributes. * doc/c-tree.texi: Document that all attributes are now attached to decls and types. * c-common.c (add_attribute, attrtab, attrtab_idx, default_valid_lang_attribute, valid_lang_attribute): Remove. (attribute_tables, attributes_initialized, c_common_attribute_table, default_lang_attribute_table): New variables. (handle_packed_attribute, handle_nocommon_attribute, handle_common_attribute, handle_noreturn_attribute, handle_unused_attribute, handle_const_attribute, handle_transparent_union_attribute, handle_constructor_attribute, handle_destructor_attribute, handle_mode_attribute, handle_section_attribute, handle_aligned_attribute, handle_weak_attribute, handle_alias_attribute, handle_no_instrument_function_attribute, handle_no_check_memory_usage_attribute, handle_malloc_attribute, handle_no_limit_stack_attribute, handle_pure_attribute): New functions. (init_attributes, decl_attributes): Rewrite to implement table-driven attributes. * c-common.h (enum attribute_flags): Move to tree.h. * c-format.c (decl_handle_format_attribute, decl_handle_format_arg_attribute): Rename to handle_format_attribute and handle_format_arg_attribute. Update for table-driven attributes. * c-common.h (decl_handle_format_attribute, decl_handle_format_arg_attribute): Remove prototypes. (handle_format_attribute, handle_format_arg_attribute): Add prototypes. * c-decl.c (grokdeclarator): Handle attributes nested inside declarators. * c-parse.in (setattrs, maybe_setattrs): Remove. (maybe_type_quals_setattrs): Rename to maybe_type_quals_attrs. Update to handle nested attributes properly. (maybe_resetattrs, after_type_declarator, parm_declarator_nostarttypename, notype_declarator, absdcl1_noea, absdcl1_ea, direct_absdcl1): Update to handle nested attributes properly. (make_pointer_declarator): Update to handle nested attributes properly. * doc/extend.texi: Update documentation of limits of attributes syntax. Warn about problems with attribute semantics in C++. * target.h (struct target): Remove valid_decl_attribute and valid_type_attribute. Add attribute_table and function_attribute_inlinable_p. * target-def.h (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Remove. (TARGET_ATTRIBUTE_TABLE, TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P): Add. (TARGET_INITIALIZER): Update. * integrate.c (FUNCTION_ATTRIBUTE_INLINABLE_P): Remove default definition. (function_attribute_inlinable_p): New function. Check for the presence of any machine attributes before using targetm.function_attribute_inlinable_p. (function_cannot_inline_p): Update. * Makefile.in (integrate.o): Update dependencies. * doc/tm.texi: Update documentation of target attributes and example definition of TARGET_VALID_TYPE_ATTRIBUTE. * tree.c (default_valid_attribute_p, valid_machine_attribute): Remove. (default_target_attribute_table, default_function_attribute_inlinable_p): New. (lookup_attribute): Update comment to clarify handling of multiple attributes with the same name. (merge_attributes, attribute_list_contained): Allow multiple attributes with the same name but different arguments to appear in the same attribute list. * tree.h (default_valid_attribute_p): Remove prototype. (struct attribute_spec): New. (default_target_attribute_table): Declare. (enum attribute_flags): Move from c-common.h. Add ATTR_FLAG_TYPE_IN_PLACE. (default_function_attribute_inlinable_p): Declare. * config/alpha/alpha.c (vms_valid_decl_attribute_p): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (vms_attribute_table): New. * config/arc/arc.c (arc_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arc_attribute_table, arc_handle_interrupt_attribute): New. * config/arm/arm.c (arm_valid_type_attribute_p, arm_valid_decl_attribute_p, arm_pe_valid_decl_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (arm_attribute_table, arm_handle_fndecl_attribute, arm_handle_isr_attribute): New. * config/avr/avr.c (avr_valid_type_attribute, avr_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE, TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (avr_attribute_table, avr_handle_progmem_attribute, avr_handle_fndecl_attribute): New. * config/c4x/c4x.c (c4x_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (c4x_attribute_table, c4x_handle_fntype_attribute): New. * config/h8300/h8300.c (h8300_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (h8300_attribute_table, h8300_handle_fndecl_attribute, h8300_handle_eightbit_data_attribute, h8300_handle_tiny_data_attribute): New. * config/i386/i386-protos.h (ix86_valid_type_attribute_p, i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove prototypes. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New declarations. * config/i386/i386.c (ix86_valid_type_attribute_p: Remove. (TARGET_VALID_TYPE_ATTRIBUTE, TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ix86_attribute_table, ix86_handle_cdecl_attribute, ix86_handle_regparm_attribute): New. * config/i386/winnt.c (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Remove. (ix86_handle_dll_attribute, ix86_handle_shared_attribute): New. * config/ia64/ia64.c (ia64_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ia64_attribute_table): New. * config/m32r/m32r.c (m32r_valid_decl_attribute, interrupt_ident1, interrupt_ident2, model_ident1, model_ident2): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (init_idents): Update. (m32r_attribute_table, m32r_handle_model_attribute): New. * config/m68hc11/m68hc11.c (m68hc11_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (m68hc11_attribute_table, m68hc11_handle_fntype_attribute): New. * config/mcore/mcore.c (mcore_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (mcore_attribute_table, mcore_handle_naked_attribute): New. * config/ns32k/ns32k.c (ns32k_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (ns32k_attribute_table, ns32k_handle_fntype_attribute): New. * config/rs6000/rs6000.c (rs6000_valid_type_attribute_p): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (rs6000_attribute_table, rs6000_handle_longcall_attribute): New. * config/sh/sh.c (sh_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (sh_attribute_table, sh_handle_interrupt_handler_attribute, sh_handle_sp_switch_attribute, sh_handle_trap_exit_attribute): New. * config/stormy16/stormy16.c (stormy16_valid_type_attribute): Remove. (TARGET_VALID_TYPE_ATTRIBUTE): Don't define (TARGET_ATTRIBUTE_TABLE): Define. (stormy16_attribute_table, stormy16_handle_interrupt_attribute): New. * config/v850/v850.c (v850_valid_decl_attribute): Remove. (TARGET_VALID_DECL_ATTRIBUTE): Don't define. (TARGET_ATTRIBUTE_TABLE): Define. (v850_attribute_table, v850_handle_interrupt_attribute, v850_handle_data_area_attribute): New. * config/v850/v850-c.c (mark_current_function_as_interrupt): Return void. Call decl_attributes instead of valid_machine_attribute. cp: Table-driven attributes. * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. * decl2.c (cplus_decl_attributes): Only take one attributes parameter. * cp-tree.c (cplus_decl_attributes): Update prototype. * class.c (finish_struct), decl.c (start_decl, start_function), decl2.c (grokfield), friend.c (do_friend), parse.y (parse_bitfield): Update calls to cplus_decl_attributes. * decl.c (grokdeclarator): Take a pointer to a single ordinary attribute list. * decl.h (grokdeclarator): Update prototype. * decl2.c (grokfield): Take a single ordinary attribute list. * friend.c (do_friend): Likewise. * decl.c (shadow_tag, groktypename, start_decl, start_handler_parms, grokdeclarator, grokparms, start_function, start_method), decl2.c (grokfield, grokbitfield, grokoptypename), parse.y (parse_field, parse_bitfield, component_decl_1), pt.c (process_template_parm, do_decl_instantiation): Pass single ordinary attribute lists around. * decl.c (grokdeclarator): Correct handling of nested attributes. Revert the patch 1998-10-18 Jason Merrill <jason@yorick.cygnus.com> * decl.c (grokdeclarator): Embedded attrs bind to the right, not the left. . * cp-tree.h (cp_valid_lang_attribute): Remove declaration (cp_attribute_table): Declare. * decl.c (valid_lang_attribute): Don't define. (lang_attribute_table): Define. (init_decl_processing): Initialize lang_attribute_table instead of valid_lang_attribute. * tree.c (cp_valid_lang_attribute): Remove. (handle_java_interface_attribute, handle_com_interface_attribute, handle_init_priority_attribute): New functions. (cp_attribute_table): New array. * decl2.c (import_export_class): Don't use targetm.valid_type_attribute. testsuite: Table-driven attributes. * g++.dg/ext/attrib1.C: New test. From-SVN: r45718
2001-09-21 03:27:06 +02:00
defining the target hook @samp{TARGET_INSERT_ATTRIBUTES} as well.
Preprocessor macros that appear on pragma lines are not expanded. All
@samp{#pragma} directives that do not match any registered pragma are
silently ignored, unless the user specifies @option{-Wunknown-pragmas}.
@end defmac
@deftypefun void c_register_pragma (const char *@var{space}, const char *@var{name}, void (*@var{callback}) (struct cpp_reader *))
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
@deftypefunx void c_register_pragma_with_expansion (const char *@var{space}, const char *@var{name}, void (*@var{callback}) (struct cpp_reader *))
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
Each call to @code{c_register_pragma} or
@code{c_register_pragma_with_expansion} establishes one pragma. The
@var{callback} routine will be called when the preprocessor encounters a
pragma of the form
@smallexample
#pragma [@var{space}] @var{name} @dots{}
@end smallexample
@var{space} is the case-sensitive namespace of the pragma, or
@code{NULL} to put the pragma in the global namespace. The callback
routine receives @var{pfile} as its first argument, which can be passed
on to cpplib's functions if necessary. You can lex tokens after the
@var{name} by calling @code{pragma_lex}. Tokens that are not read by the
callback will be silently ignored. The end of the line is indicated by
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
a token of type @code{CPP_EOF}. Macro expansion occurs on the
arguments of pragmas registered with
@code{c_register_pragma_with_expansion} but not on the arguments of
pragmas registered with @code{c_register_pragma}.
Note that the use of @code{pragma_lex} is specific to the C and C++
compilers. It will not work in the Java or Fortran compilers, or any
other language compilers for that matter. Thus if @code{pragma_lex} is going
to be called from target-specific code, it must only be done so when
building the C and C++ compilers. This can be done by defining the
variables @code{c_target_objs} and @code{cxx_target_objs} in the
target entry in the @file{config.gcc} file. These variables should name
the target-specific, language-specific object file which contains the
code that uses @code{pragma_lex}. Note it will also be necessary to add a
rule to the makefile fragment pointed to by @code{tmake_file} that shows
how to build this object file.
@end deftypefun
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
@defmac HANDLE_PRAGMA_PACK_WITH_EXPANSION
tm.texi.in (HANDLE_SYSV_PRAGMA, [...]): Remove. * doc/tm.texi.in (HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_PACK_PUSH_POP): Remove. (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Don't refer to HANDLE_SYSV_PRAGMA. * doc/tm.texi: Regenerate. * system.h (HANDLE_PRAGMA_PACK_PUSH_POP, HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_WEAK): Poison. * config/alpha/elf.h (HANDLE_SYSV_PRAGMA): Don't define. * config/alpha/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/alpha/osf5.h (HANDLE_SYSV_PRAGMA): Don't define. * config/alpha/vms.h (HANDLE_SYSV_PRAGMA): Don't define. * config/arm/arm.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/arm/netbsd.h (HANDLE_SYSV_PRAGMA): Don't define. * config/cris/cris.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/darwin.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/elfos.h (HANDLE_SYSV_PRAGMA): Don't define. * config/freebsd.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/frv/frv.h (HANDLE_SYSV_PRAGMA): Don't define. * config/i386/cygming.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/i386/djgpp.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/i386/i386-interix.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_WEAK): Don't undefine. * config/i386/netware.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/i386/vxworks.h (HANDLE_SYSV_PRAGMA): Don't define. * config/ia64/hpux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/ia64/ia64.h (HANDLE_SYSV_PRAGMA): Don't define. * config/interix.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_WEAK): Don't undefine. * config/linux.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/m32r/linux.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_PACK): Don't undefine. * config/m32r/m32r.h (HANDLE_SYSV_PRAGMA): Don't undefine. * config/mep/mep.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/mips/elf.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/mips/sde.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/mmix/mmix.h (HANDLE_SYSV_PRAGMA): Don't define. * config/netbsd.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/openbsd.h (HANDLE_SYSV_PRAGMA): Don't define. * config/pa/pa-hpux.h (HANDLE_SYSV_PRAGMA): Don't define. (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/rs6000/aix.h (HANDLE_SYSV_PRAGMA): Don't define. * config/rs6000/sysv4.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/rx/rx.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/score/elf.h (HANDLE_SYSV_PRAGMA): Don't define. * config/spu/spu.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. * config/stormy16/stormy16.h (HANDLE_SYSV_PRAGMA): Don't define. * config/xtensa/elf.h (HANDLE_PRAGMA_PACK_PUSH_POP): Don't define. c-family: * c-pragma.c: Remove conditionals on HANDLE_PRAGMA_PACK, HANDLE_PRAGMA_PACK_PUSH_POP, HANDLE_PRAGMA_WEAK and HANDLE_PRAGMA_VISIBILITY. * c-pragma.h (HANDLE_PRAGMA_WEAK, HANDLE_PRAGMA_PACK, HANDLE_PRAGMA_VISIBILITY): Don't define. (HANDLE_SYSV_PRAGMA, HANDLE_PRAGMA_PACK_PUSH_POP): Don't test. cp: * name-lookup.c (handle_namespace_attrs): Don't check HANDLE_PRAGMA_VISIBILITY. * parser.c (cp_parser_namespace_definition): Don't check HANDLE_PRAGMA_VISIBILITY. testsuite: * g++.dg/cpp/_Pragma1.C: Test for all non-Solaris targets. * gcc.dg/cpp/_Pragma6.c: Test for all non-Solaris targets. * gcc.dg/pack-test-1.c: Test for all non-default_packed targets. * gcc.dg/pack-test-2.c: Test for all targets. * gcc.dg/pragma-align.c: Test for all targets. * gcc.dg/pragma-pack-4.c: Do not skip for AVR. * gcc.dg/ucnid-10.c: Test for all targets. From-SVN: r166992
2010-11-21 01:54:14 +01:00
Define this macro if macros should be expanded in the
sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. gcc: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * config/sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion. * config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define. * c-pragma.c (c_register_pragma): Update call to cpp_register_pragma. (c_register_pragma_with_expansion): New function. (init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION. * c-pragma.h (c_register_pragma_with_expansion): New prototype. * doc/extend.texi (Solaris Pragmas): Mention macro expansion for #pragma align. * doc/tm.texi (c_register_pragma_with_expansion, HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document. gcc/testsuite: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> * gcc.dg/pragma-align-2.c: Test macro expansion. * gcc.dg/pragma-pack-2.c: New test. libcpp: 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * internal.h (struct lexer_state): Add in_deferred_pragma. * directives.c (struct pragma_entry): Add allow_expansion. (insert_pragma_entry): Take allow_expansion flag. (register_pragma): Likewise. (cpp_register_pragma): Likewise. (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma. (do_pragma): Honor allow_expansion. (cpp_handle_deferred_pragma): Set in_deferred_pragma. * include/cpplib.h (cpp_register_pragma): Update prototype. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r91117
2004-11-24 00:25:40 +01:00
arguments of @samp{#pragma pack}.
@end defmac
@defmac TARGET_DEFAULT_PACK_STRUCT
If your target requires a structure packing default other than 0 (meaning
the machine default), define this macro to the necessary value (in bytes).
This must be a value that would also be valid to use with
@samp{#pragma pack()} (that is, a small power of two).
@end defmac
@defmac DOLLARS_IN_IDENTIFIERS
Define this macro to control use of the character @samp{$} in
identifier names for the C family of languages. 0 means @samp{$} is
not allowed by default; 1 means it is allowed. 1 is the default;
there is no need to define this macro in that case.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac INSN_SETS_ARE_DELAYED (@var{insn})
1996-09-25 01:21:45 +02:00
Define this macro as a C expression that is nonzero if it is safe for the
delay slot scheduler to place instructions in the delay slot of @var{insn},
even if they appear to use a resource set or clobbered in @var{insn}.
@var{insn} is always a @code{jump_insn} or an @code{insn}; GCC knows that
1996-09-25 01:21:45 +02:00
every @code{call_insn} has this behavior. On machines where some @code{insn}
or @code{jump_insn} is really a function call and hence has this behavior,
you should define this macro.
You need not define this macro if it would always return zero.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac INSN_REFERENCES_ARE_DELAYED (@var{insn})
1996-09-25 01:21:45 +02:00
Define this macro as a C expression that is nonzero if it is safe for the
delay slot scheduler to place instructions in the delay slot of @var{insn},
even if they appear to set or clobber a resource referenced in @var{insn}.
@var{insn} is always a @code{jump_insn} or an @code{insn}. On machines where
some @code{insn} or @code{jump_insn} is really a function call and its operands
are registers whose use is actually in the subroutine it calls, you should
define this macro. Doing so allows the delay slot scheduler to move
instructions which copy arguments into the argument registers into the delay
slot of @var{insn}.
You need not define this macro if it would always return zero.
@end defmac
1996-09-25 01:21:45 +02:00
@defmac MULTIPLE_SYMBOL_SPACES
Define this macro as a C expression that is nonzero if, in some cases,
global symbols from one translation unit may not be bound to undefined
symbols in another translation unit without user intervention. For
instance, under Microsoft Windows symbols must be explicitly imported
from shared libraries (DLLs).
You need not define this macro if it would always evaluate to zero.
@end defmac
1997-08-11 17:56:58 +02:00
@deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{outputs}, tree @var{inputs}, tree @var{clobbers})
This target hook should add to @var{clobbers} @code{STRING_CST} trees for
any hard regs the port wishes to automatically clobber for an asm.
It should return the result of the last @code{tree_cons} used to add a
clobber. The @var{outputs}, @var{inputs} and @var{clobber} lists are the
corresponding parameters to the asm and may be inspected to avoid
clobbering a register that is an input or output of the asm. You can use
@code{tree_overlaps_hard_reg_set}, declared in @file{tree.h}, to test
for overlap with regards to asm-declared registers.
@end deftypefn
@defmac MATH_LIBRARY
Define this macro as a C string constant for the linker argument to link
Makefile.in (gccspec.o, cppspec.o): Update dependencies. * Makefile.in (gccspec.o, cppspec.o): Update dependencies. * common.opt (L, nodefaultlibs, nostdlib, pg, static): New options. * config/avr/avr.h (LIBSTDCXX): Remove initial "-l". * config/freebsd.h (MATH_LIBRARY_PROFILE): Remove initial "-l". * config/i386/djgpp.h (LIBSTDCXX): Remove initial "-l". * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove initial "-l". * config/s390/tpf.h (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l". * cppspec.c: Include opts.h. (lang_specific_driver): Use cl_decoded_option structures. * doc/tm.texi.in (MATH_LIBRARY): Update documentation. * doc/tm.texi: Regenerate. * gcc.c (translate_options): Translate -d to -foutput-class-dir=. (driver_handle_option): Allow driver options needing no special processing. (process_command): Decode options before call to lang_specific_driver. Pass decoded options to lang_specific_driver. * gcc.h (lang_specific_driver): Update prototype. * gccspec.c: Include opts.h. (lang_specific_driver): Use cl_decoded_option structures. * opts-common.c (option_ok_for_language, generate_option, generate_option_input_file): New. (decode_cmdline_option): Use option_ok_for_language. (decode_cmdline_options_to_array): Use generate_option_input_file. (handle_generated_option): Use generate_option. * opts.h (generate_option, generate_option_input_file): Declare. cp: * Make-lang.in (g++spec.o): Update dependencies. * g++spec.c: Include opts.h (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l". (lang_specific_driver): Use cl_decoded_option structures. fortran: * Make-lang.in (gfortranspec.o): Update dependencies. * gfortranspec.c: Include coretypes.h before gcc.h. Include opts.h. (MATH_LIBRARY, FORTRAN_LIBRARY): Remove initial "-l". (ADD_ARG_LIBGFORTRAN, Option, lookup_option): Remove. (g77_xargc): Make unsigned. (g77_xargv): Change to g77_x_decoded_options. (g77_newargc): Make unsigned. (g77_newargv): Change to g77_new_decoded_options. (strings_same, options_same): New. (append_arg): Use cl_decoded_option structures. (append_option): New. (add_arg_libgfortran): New. (lang_specific_driver): Use cl_decoded_option structures. java: * Make-lang.in (jvspec.o): Update dependencies. * jvspec.c: Include opts.h. (PARAM_ARG): Remove. (find_spec_file): Do not add leading -specs=. (lang_specific_driver): Use cl_decoded_option structures. * lang.opt (C, CLASSPATH, D, bootclasspath, classpath, encoding, extdirs, fmain=, s-bc-abi): New options. From-SVN: r163459
2010-08-22 14:19:01 +02:00
in the system math library, minus the initial @samp{"-l"}, or
@samp{""} if the target does not have a
separate math library.
Makefile.in (gccspec.o, cppspec.o): Update dependencies. * Makefile.in (gccspec.o, cppspec.o): Update dependencies. * common.opt (L, nodefaultlibs, nostdlib, pg, static): New options. * config/avr/avr.h (LIBSTDCXX): Remove initial "-l". * config/freebsd.h (MATH_LIBRARY_PROFILE): Remove initial "-l". * config/i386/djgpp.h (LIBSTDCXX): Remove initial "-l". * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove initial "-l". * config/s390/tpf.h (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l". * cppspec.c: Include opts.h. (lang_specific_driver): Use cl_decoded_option structures. * doc/tm.texi.in (MATH_LIBRARY): Update documentation. * doc/tm.texi: Regenerate. * gcc.c (translate_options): Translate -d to -foutput-class-dir=. (driver_handle_option): Allow driver options needing no special processing. (process_command): Decode options before call to lang_specific_driver. Pass decoded options to lang_specific_driver. * gcc.h (lang_specific_driver): Update prototype. * gccspec.c: Include opts.h. (lang_specific_driver): Use cl_decoded_option structures. * opts-common.c (option_ok_for_language, generate_option, generate_option_input_file): New. (decode_cmdline_option): Use option_ok_for_language. (decode_cmdline_options_to_array): Use generate_option_input_file. (handle_generated_option): Use generate_option. * opts.h (generate_option, generate_option_input_file): Declare. cp: * Make-lang.in (g++spec.o): Update dependencies. * g++spec.c: Include opts.h (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l". (lang_specific_driver): Use cl_decoded_option structures. fortran: * Make-lang.in (gfortranspec.o): Update dependencies. * gfortranspec.c: Include coretypes.h before gcc.h. Include opts.h. (MATH_LIBRARY, FORTRAN_LIBRARY): Remove initial "-l". (ADD_ARG_LIBGFORTRAN, Option, lookup_option): Remove. (g77_xargc): Make unsigned. (g77_xargv): Change to g77_x_decoded_options. (g77_newargc): Make unsigned. (g77_newargv): Change to g77_new_decoded_options. (strings_same, options_same): New. (append_arg): Use cl_decoded_option structures. (append_option): New. (add_arg_libgfortran): New. (lang_specific_driver): Use cl_decoded_option structures. java: * Make-lang.in (jvspec.o): Update dependencies. * jvspec.c: Include opts.h. (PARAM_ARG): Remove. (find_spec_file): Do not add leading -specs=. (lang_specific_driver): Use cl_decoded_option structures. * lang.opt (C, CLASSPATH, D, bootclasspath, classpath, encoding, extdirs, fmain=, s-bc-abi): New options. From-SVN: r163459
2010-08-22 14:19:01 +02:00
You need only define this macro if the default of @samp{"m"} is wrong.
@end defmac
@defmac LIBRARY_PATH_ENV
Define this macro as a C string constant for the environment variable that
specifies where the linker should look for libraries.
You need only define this macro if the default of @samp{"LIBRARY_PATH"}
is wrong.
@end defmac
@defmac TARGET_POSIX_IO
Define this macro if the target supports the following POSIX@ file
functions, access, mkdir and file locking with fcntl / F_SETLKW@.
Defining @code{TARGET_POSIX_IO} will enable the test coverage code
to use file locking when exiting a program, which avoids race conditions
if the program has forked. It will also create directories at run-time
for cross-profiling.
@end defmac
@defmac MAX_CONDITIONAL_EXECUTE
A C expression for the maximum number of instructions to execute via
conditional execution instructions instead of a branch. A value of
@code{BRANCH_COST}+1 is the default if the machine does not use cc0, and
1 if it does use cc0.
@end defmac
@defmac IFCVT_MODIFY_TESTS (@var{ce_info}, @var{true_expr}, @var{false_expr})
Used if the target needs to perform machine-dependent modifications on the
conditionals used for turning basic blocks into conditionally executed code.
@var{ce_info} points to a data structure, @code{struct ce_if_block}, which
contains information about the currently processed blocks. @var{true_expr}
and @var{false_expr} are the tests that are used for converting the
then-block and the else-block, respectively. Set either @var{true_expr} or
@var{false_expr} to a null pointer if the tests cannot be converted.
@end defmac
@defmac IFCVT_MODIFY_MULTIPLE_TESTS (@var{ce_info}, @var{bb}, @var{true_expr}, @var{false_expr})
Like @code{IFCVT_MODIFY_TESTS}, but used when converting more complicated
if-statements into conditions combined by @code{and} and @code{or} operations.
@var{bb} contains the basic block that contains the test that is currently
being processed and about to be turned into a condition.
@end defmac
@defmac IFCVT_MODIFY_INSN (@var{ce_info}, @var{pattern}, @var{insn})
A C expression to modify the @var{PATTERN} of an @var{INSN} that is to
be converted to conditional execution format. @var{ce_info} points to
a data structure, @code{struct ce_if_block}, which contains information
about the currently processed blocks.
@end defmac
@defmac IFCVT_MODIFY_FINAL (@var{ce_info})
A C expression to perform any final machine dependent modifications in
converting code to conditional execution. The involved basic blocks
can be found in the @code{struct ce_if_block} structure that is pointed
to by @var{ce_info}.
@end defmac
@defmac IFCVT_MODIFY_CANCEL (@var{ce_info})
A C expression to cancel any machine dependent modifications in
converting code to conditional execution. The involved basic blocks
can be found in the @code{struct ce_if_block} structure that is pointed
to by @var{ce_info}.
@end defmac
@defmac IFCVT_MACHDEP_INIT (@var{ce_info})
A C expression to initialize any machine specific data for if-conversion
of the if-block in the @code{struct ce_if_block} structure that is pointed
to by @var{ce_info}.
@end defmac
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} void TARGET_MACHINE_DEPENDENT_REORG (void)
target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. * target-def.h (TARGET_MACHINE_DEPENDENT_REORG): Define. (TARGET_INITIALIZER): Include it. * target.h (struct gcc_target): Add machine_dependent_reorg field. * toplev.c (rest_of_compilation): Use targetm.machine_dependent_reorg. * config/alpha/alpha-protos.h (alpha_reorg): Remove declaration. * config/alpha/alpha.h (MACHINE_DEPENDENT_REORG): Remove. * config/alpha/alpha.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (alpha_handle_trap_shadows): Remove "first insn" parameter. (alpha_align_insns): Likewise. (alpha_reorg): Likewise. Make static. Update calls to above functions. * config/arm/arm-protos.h (arm_reorg): Remove declaration. * config/arm/arm.h (MACHINE_DEPENDENT_REORG): Remove. * config/arm/arm.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (arm_reorg): Remove parameter. Make static. * config/avr/avr-protos.h (machine_dependent_reorg): Remove. * config/avr/avr.h (MACHINE_DEPENDENT_REORG): Remove. * config/avr/avr.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (avr_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/c4x/c4x-protos.h (c4x_process_after_reload): Remove. * config/c4x/c4x.h (MACHINE_DEPENDENT_REORG): Remove. * config/c4x/c4x.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (c4x_reorg): Renamed from c4x_process_after_reload. Make static. Remove parameter. * config/d30v/d30v-protos.h (d30v_machine_dependent_reorg): Remove. * config/d30v/d30v.h (MACHINE_DEPENDENT_REORG): Remove. * config/d30v/d30v.c (d30v_machine_dependent_reorg): Remove. * config/frv/frv-protos.h (frv_machine_dependent_reorg): Remove. * config/frv/frv.c: Remove orphaned comment. * config/i386/i386-protos.h (x86_machine_dependent_reorg): Remove. * config/i386/i386.h (MACHINE_DEPENDENT_REORG): Remove. * config/i386/i386.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ix86_reorg): Renamed from x86_machine_dependent_reorg. Make static. Remove parameter. * config/ia64/ia64-protos.h (ia64_reorg): Remove declaration. * config/ia64/ia64.h (MACHINE_DEPENDENT_REORG): Remove. * config/ia64/ia64.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (emit_insn_group_barriers): Remove "first insn" parameter. (emit_all_insn_group_barriers): Likewise. (ia64_reorg): Likewise. Make static. Update calls to above functions. (ia64_output_mi_thunk): Update call to emit_all_insn_group_barriers. * config/ip2k/ip2k-protos.h (machine_dependent_reorg): Remove. * config/ip2k/ip2k.h (MACHINE_DEPENDENT_REORG): Remove. * config/ip2k/ip2k.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (ip2k_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. * config/m68hc11/m68hc11-protos.h (m68hc11_reorg): Remove declaration. * config/m68hc11/m68hc11.h (MACHINE_DEPENDENT_REORG): Remove. * config/m68hc11/m68hc11.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (m68hc11_reorg): Make static. Remove parameter. * config/mcore/mcore-protos.h (mcore_dependent_reorg): Remove. * config/mcore/mcore.h (MACHINE_DEPENDENT_REORG): Remove. * config/mcore/mcore.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (conditionalize_optimization): Remove parameter. (mcore_reorg): Renamed from mcore_dependent_reorg. Remove parameter. Make static. Update call to conditionalize_optimization. * config/mips/mips-protos.h (machine_dependent_reorg): Remove. * config/mips/mips.h (MACHINE_DEPENDENT_REORG): Remove. * config/mips/mips.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mips_reorg): Renamed from machine_dependent_reorg. Remove parameter. Make static. * config/mmix/mmix-protos.h (mmix_machine_dependent_reorg): Remove. * config/mmix/mmix.h (MACHINE_DEPENDENT_REORG): Remove. * config/mmix/mmix.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (mmix_reorg): Renamed from mmix_machine_dependent_reorg. Make static. Remove parameter. * config/pa/pa-protos.h (pa_reorg): Remove declaration. * config/pa/pa.h (MACHINE_DEPENDENT_REORG): Remove. * config/pa/pa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (pa_combine_instructions): Remove "first insn" parameter. (remove_useless_addtr_insns): Likewise. (pa_reorg): Likewise. Make static. Update calls to above functions. * config/rs6000/rs6000.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/s390/s390-protos.h (s390_machine_dependent_reorg): Remove. * config/s390/s390.h (MACHINE_DEPENDENT_REORG): Remove. * config/s390/s390.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (s390_reorg): Renamed from s390_machine_dependent_reorg. Make static. Remove parameter. * config/sh/sh-protos.h (machine_dependent_reorg): Remove. * config/sh/sh.h (MACHINE_DEPENDENT_REORG): Remove. * config/sh/sh.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (sh_reorg): Renamed from machine_dependent_reorg. Make static. Remove parameter. (sh_output_mi_thunk): Call sh_reorg directly. * config/sh/sh.md: Update comment. * config/stormy16/stormy16.h (MACHINE_DEPENDENT_REORG): Remove commented-out definition. * config/v850/v850-protos.h (v850_reorg): Remove declaration. * config/v850/v850.h (MACHINE_DEPENDENT_REORG): Remove. * config/v850/v850.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (v850_reorg): Make static. Remove parameter. * config/xtensa/xtensa-protos.h (xtensa_reorg): Remove declaration. * config/xtensa/xtensa.h (MACHINE_DEPENDENT_REORG): Remove. * config/xtensa/xtensa.c (TARGET_MACHINE_DEPENDENT_REORG): Define. (xtensa_reorg): Make static. Remove parameter. * doc/tm.texi (MACHINE_DEPENDENT_REORG): Remove. (TARGET_MACHINE_DEPENDENT_REORG): Document. From-SVN: r66800
2003-05-14 09:29:54 +02:00
If non-null, this hook performs a target-specific pass over the
instruction stream. The compiler will run it at all optimization levels,
just before the point at which it normally does delayed-branch scheduling.
The exact purpose of the hook varies from target to target. Some use
it to do transformations that are necessary for correctness, such as
laying out in-function constant pools or avoiding hardware hazards.
Others use it as an opportunity to do some machine-dependent optimizations.
You need not implement the hook if it has nothing to do. The default
definition is null.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} void TARGET_INIT_BUILTINS (void)
target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target-def.h (TARGET_INIT_BUILTINS): New macro. (TARGET_EXPAND_BUILTIN): New macro. (TARGET_INITIALIZER): Add them. * builtins.c: Include target.h. (expand_builtin): Use targetm.expand_builtin. (default_init_builtins): New function. (default_expand_builtin): New function. * expr.h (default_init_builtins): Declare. (default_expand_builtin): Declare. * c-common.c (c_common_nodes_and_builtins): Use targetm.init_builtins. * defaults.h (MD_INIT_BUILTINS): Remove. * Makefile.in (builtins.o): Depend on target.h. * config/arm/arm.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/arm/arm.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (c4x_init_builtins): Make endlink arg a local. (c4x_print_operand): Fix typos in adjust_address usages. * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl. * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/i386/i386.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins. (ix86_init_builtins): Call new function only if TARGET_MMX. * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare. * config/i386/i386.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * doc/tm.texi: Document these changes. From-SVN: r43888
2001-07-10 08:18:36 +02:00
Define this hook if you have any machine-specific built-in functions
that need to be defined. It should be a function that performs the
necessary setup.
Machine specific built-in functions can be useful to expand special machine
instructions that would otherwise not normally be generated because
they have no equivalent in the source language (for example, SIMD vector
instructions or prefetch instructions).
To create a built-in function, call the function
@code{lang_hooks.builtin_function}
which is defined by the language front end. You can use any type nodes set
up by @code{build_common_tree_nodes};
haifa-sched.c: Convert to target hooks. * haifa-sched.c: Convert to target hooks. Macros replaced are ISSUE_RATE, ADJUST_COST, ADJUST_PRIORITY, MD_SCHED_INIT, MD_SCHED_REORDER, MD_SCHED_REORDER2, MD_SCHED_VARIABLE_ISSUE, MD_SCHED_FINISH, and HAVE_cycle_display. * target-def.h (TARGET_SCHED_ADJUST_COST, TARGET_SCHED_ADJUST_PRIORITY, TARGET_SCHED_ISSUE_RATE, TARGET_SCHED_VARIABLE_ISSUE, TARGET_SCHED_INIT, TARGET_SCHED_FINISH, TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2, TARGET_SCHED_CYCLE_DISPLAY): New hook #defines to be overridden. (TARGET_SCHED): Bring them all together. (TARGET_INITIALIZER): Update. * target.h: Don't forward declare struct rtx_def. Use 'rtx' instead of 'struct rtx_def *' throughout. (struct sched): New set of hooks for the scheduler. * Makefile.in (haifa-sched.o): Depend on target.h. * doc/tm.texi: Document the new scheduler hooks, together in their own section, instead of scattered around. Fix a bunch of underfull/overfull hboxes. * a29k.h, alpha.h, arm.h, c4x.h, convex.h, d30v.h, i386.h, ia64.h, m32r.h, m88k.h, mips.h, pa.h, rs6000.h, s390.h, sh.h, sparc.h: Don't define any of the old scheduler macros. * a29k.c, alpha.c, arm.c, c4x.c, convex.c, d30v.c, i386.c, ia64.c, m32r.c, m88k.c, mips.c, pa.c, rs6000.c, s390.c, sh.c, sparc.c: Create hook functions from code extracted from corresponding target header, or make existing hooks static, as appropriate. Set the appropriate entries in targetm. * alpha-protos.h, arm-protos.h, c4x-protos.h, d30v-protos.h, i386-protos.h, ia64-protos.h, m32r-protos.h, pa-protos.h, rs6000-protos.h, s390-protos.h, sparc-protos.h: Remove prototypes for functions which are now static. * d30v.h, d30v.c, m32r.h, m32r.c: Remove #ifdef HAIFA and related gunk; the Haifa scheduler is now the only choice. From-SVN: r45009
2001-08-18 22:25:54 +02:00
only language front ends that use those two functions will call
target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target-def.h (TARGET_INIT_BUILTINS): New macro. (TARGET_EXPAND_BUILTIN): New macro. (TARGET_INITIALIZER): Add them. * builtins.c: Include target.h. (expand_builtin): Use targetm.expand_builtin. (default_init_builtins): New function. (default_expand_builtin): New function. * expr.h (default_init_builtins): Declare. (default_expand_builtin): Declare. * c-common.c (c_common_nodes_and_builtins): Use targetm.init_builtins. * defaults.h (MD_INIT_BUILTINS): Remove. * Makefile.in (builtins.o): Depend on target.h. * config/arm/arm.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/arm/arm.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (c4x_init_builtins): Make endlink arg a local. (c4x_print_operand): Fix typos in adjust_address usages. * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl. * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/i386/i386.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins. (ix86_init_builtins): Call new function only if TARGET_MMX. * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare. * config/i386/i386.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * doc/tm.texi: Document these changes. From-SVN: r43888
2001-07-10 08:18:36 +02:00
@samp{TARGET_INIT_BUILTINS}.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} tree TARGET_BUILTIN_DECL (unsigned @var{code}, bool @var{initialize_p})
Define this hook if you have any machine-specific built-in functions
that need to be defined. It should be a function that returns the
builtin function declaration for the builtin function code @var{code}.
If there is no such builtin and it cannot be initialized at this time
if @var{initialize_p} is true the function should return @code{NULL_TREE}.
If @var{code} is out of range the function should return
@code{error_mark_node}.
@end deftypefn
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} rtx TARGET_EXPAND_BUILTIN (tree @var{exp}, rtx @var{target}, rtx @var{subtarget}, machine_mode @var{mode}, int @var{ignore})
Expand a call to a machine specific built-in function that was set up by
target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target.h (struct gcc_target): New fields init_builtins and expand_builtin. * target-def.h (TARGET_INIT_BUILTINS): New macro. (TARGET_EXPAND_BUILTIN): New macro. (TARGET_INITIALIZER): Add them. * builtins.c: Include target.h. (expand_builtin): Use targetm.expand_builtin. (default_init_builtins): New function. (default_expand_builtin): New function. * expr.h (default_init_builtins): Declare. (default_expand_builtin): Declare. * c-common.c (c_common_nodes_and_builtins): Use targetm.init_builtins. * defaults.h (MD_INIT_BUILTINS): Remove. * Makefile.in (builtins.o): Depend on target.h. * config/arm/arm.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/arm/arm.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/c4x/c4x.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (c4x_init_builtins): Make endlink arg a local. (c4x_print_operand): Fix typos in adjust_address usages. * config/c4x/c4x-protos.h (c4x_init_builtins): Update decl. * config/c4x/c4x.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/i386/i386.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. (ix86_init_mmx_sse_builtins): New function, was ix86_init_builtins. (ix86_init_builtins): Call new function only if TARGET_MMX. * config/i386/i386-protos.h (ix86_init_mmx_sse_builtins): Declare. * config/i386/i386.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * config/ia64/ia64.c (TARGET_INIT_BUILTINS): Define. (TARGET_EXPAND_BUILTIN): Define. * config/ia64/ia64.h (MD_INIT_BUILTINS): Remove. (MD_EXPAND_BUILTIN): Remove. * doc/tm.texi: Document these changes. From-SVN: r43888
2001-07-10 08:18:36 +02:00
@samp{TARGET_INIT_BUILTINS}. @var{exp} is the expression for the
function call; the result should go to @var{target} if that is
convenient, and have mode @var{mode} if that is convenient.
@var{subtarget} may be used as the target for computing one of
@var{exp}'s operands. @var{ignore} is nonzero if the value is to be
ignored. This function should return the result of the call to the
built-in function.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (unsigned int @var{loc}, tree @var{fndecl}, void *@var{arglist})
Select a replacement for a machine specific built-in function that
was set up by @samp{TARGET_INIT_BUILTINS}. This is done
@emph{before} regular type checking, and so allows the target to
implement a crude form of function overloading. @var{fndecl} is the
declaration of the built-in function. @var{arglist} is the list of
arguments passed to the built-in function. The result is a
complete expression that implements the operation, usually
another @code{CALL_EXPR}.
@var{arglist} really has type @samp{VEC(tree,gc)*}
@end deftypefn
@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{fndecl}, int @var{n_args}, tree *@var{argp}, bool @var{ignore})
Fold a call to a machine specific built-in function that was set up by
@samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the
built-in function. @var{n_args} is the number of arguments passed to
the function; the arguments themselves are pointed to by @var{argp}.
The result is another tree, valid for both GIMPLE and GENERIC,
containing a simplified expression for the call's result. If
@var{ignore} is true the value will be ignored.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_GIMPLE_FOLD_BUILTIN (gimple_stmt_iterator *@var{gsi})
Fold a call to a machine specific built-in function that was set up
by @samp{TARGET_INIT_BUILTINS}. @var{gsi} points to the gimple
statement holding the function call. Returns true if any change
was made to the GIMPLE stream.
@end deftypefn
Function Multiversioning ======================== Sriraman Tallam, tmsriram@google.com Overview of the patch which adds support to specify function versions. This is only enabled for target i386. Example: int foo (); /* Default version */ int foo () __attribute__ ((target("avx,popcnt")));/*Specialized for avx and popcnt */ int foo () __attribute__ ((target("arch=core2,ssse3")));/*Specialized for core2 and ssse3*/ int main () { int (*p)() = &foo; return foo () + (*p)(); } int foo () { return 0; } int __attribute__ ((target("avx,popcnt"))) foo () { return 0; } int __attribute__ ((target("arch=core2,ssse3"))) foo () { return 0; } The above example has foo defined 3 times, but all 3 definitions of foo are different versions of the same function. The call to foo in main, directly and via a pointer, are calls to the multi-versioned function foo which is dispatched to the right foo at run-time. Front-end changes: The front-end changes are calls at appropriate places to target hooks that determine the following: * Determine if two function decls with the same signature are versions. * Determine the assembler name of a function version. * Generate the dispatcher function for a set of function versions. * Compare versions to see if one has a higher priority over the other. All the implementation happens in the target-specific config/i386/i386.c. What does the patch do? * Tracking decls that correspond to function versions of function name, say "foo": When the front-end sees more than one decl for "foo", it calls a target hook to determine if they are versions. To prevent duplicate definition errors with other versions of "foo", "decls_match" function in cp/decl.c is made to return false when 2 decls have are deemed versions by the target. This will make all function versions of "foo" to be added to the overload list of "foo". * Change the assembler names of the function versions. For i386, the target changes the assembler names of the function versions by suffixing the sorted list of args to "target" to the function name of "foo". For example, the assembler name of "void foo () __attribute__ ((target ("sse4")))" will become _Z3foov.sse4. The target hook mangle_decl_assembler_name is used for this. * Overload resolution: Function "build_over_call" in cp/call.c sees a call to function "foo", which is multi-versioned. The overload resolution happens in function "joust" in "cp/call.c". Here, the call to "foo" has all possible versions of "foo" as candidates. All the candidates of "foo" are stored in the cgraph side data structure. Each version of foo is chained in a doubly-linked list with the default function as the first element. This allows any pass to access all the semantically identical versions. A call to a multi-versioned function will be replaced by a call to a dispatcher function, determined by a target hook, to execute the right function version at run-time. Optimization to directly call a version when possible: Also, in joust, where overload resolution happens, a multiversioned function resolution is made to return the most specialized version. This is the version that will be checked for dispatching first and is determined by the target. Now, if the caller can inline this function version then a direct call is made to this function version rather than go through the dispatcher. When a direct call cannot be made, a call to the dispatcher function is created. * Creating the dispatcher body. The dispatcher body, called the resolver is made only when there is a call to a multiversioned function dispatcher or the address of a function is taken. This is generated during cgraph_analyze_function. This is done by another target hook. * Dispatch ordering. The order in which the function versions are checked during dispatch is based on a priority value assigned for the ISA that is catered. More specialized versions are checked for dispatching first. This is to mitigate the ambiguity that can arise when more than one function version is valid for execution on a particular platform. This is not a perfect solution, and in future the user should be allowed to assign a dispatching priority value to each version. Function MV in the Intel compiler: The intel compiler supports function multiversioning and the syntax is similar to the patch proposed here. Here is an example of how to generate multiple function versions with the intel compiler. /* Create a stub function to specify the various versions of function that will be created, using declspec attribute cpu_dispatch. */ __declspec (cpu_dispatch (core_i7_sse4_2, atom, generic)) void foo () {}; /* Bodies of each function version. */ /* Intel Corei7 processor + SSE4.2 version. */ __declspec (cpu_specific(core_i7_sse4_2)) void foo () { printf ("corei7 + sse4.2"); } /* Atom processor. */ __declspec (cpu_specific(atom)) void foo () { printf ("atom"); } /* The generic or the default version. */ __declspec (cpu_specific(generic)) void foo () { printf ("This is generic"); } A new function version is generated by defining a new function with the same signature but with a different cpu_specific declspec attribute string. The set of cpu_specific strings that are allowed is the following: "core_2nd_gen_avx" "core_aes_pclmulqdq" "core_i7_sse4_2" "core_2_duo_sse4_1" "core_2_duo_ssse3" "atom" "pentium_4_sse3" "pentium_4" "pentium_m" "pentium_iii" "generic" Comparison with the GCC MV implementation in this patch: * Version creation syntax: The implementation in this patch also has a similar syntax to specify function versions. The first stub function is not needed. Here is the code to generate the function versions with this patch: /* Intel Corei7 processor + SSE4.2 version. */ __attribute__ ((target ("arch=corei7, sse4.2"))) void foo () { printf ("corei7 + sse4.2"); } /* Atom processor. */ __attribute__ ((target ("arch=atom"))) void foo () { printf ("atom"); } void foo () { } The target attribute can have one of the following arch names: "amd" "intel" "atom" "core2" "corei7" "nehalem" "westmere" "sandybridge" "amdfam10h" "barcelona" "shanghai" "istanbul" "amdfam15h" "bdver1" "bdver2" and any number of the following ISA names: "cmov" "mmx" "popcnt" "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" * doc/tm.texi.in (TARGET_OPTION_FUNCTION_VERSIONS): New hook description. * (TARGET_COMPARE_VERSION_PRIORITY): New hook description. * (TARGET_GET_FUNCTION_VERSIONS_DISPATCHER): New hook description. * (TARGET_GENERATE_VERSION_DISPATCHER_BODY): New hook description. * doc/tm.texi: Regenerate. * target.def (compare_version_priority): New target hook. * (generate_version_dispatcher_body): New target hook. * (get_function_versions_dispatcher): New target hook. * (function_versions): New target hook. * cgraph.c (cgraph_fnver_htab): New htab. (cgraph_fn_ver_htab_hash): New function. (cgraph_fn_ver_htab_eq): New function. (version_info_node): New pointer. (insert_new_cgraph_node_version): New function. (get_cgraph_node_version): New function. (delete_function_version): New function. (record_function_versions): New function. * cgraph.h (cgraph_node): New bitfield dispatcher_function. (cgraph_function_version_info): New struct. (get_cgraph_node_version): New function. (insert_new_cgraph_node_version): New function. (record_function_versions): New function. (delete_function_version): New function. (init_lowered_empty_function): Expose function. * tree.h (DECL_FUNCTION_VERSIONED): New macro. (tree_function_decl): New bit-field versioned_function. * cgraphunit.c (cgraph_analyze_function): Generate body of multiversion function dispatcher. (cgraph_analyze_functions): Analyze dispatcher function. (init_lowered_empty_function): Make non-static. New parameter in_ssa. (assemble_thunk): Add parameter to call to init_lowered_empty_function. * config/i386/i386.c (add_condition_to_bb): New function. (get_builtin_code_for_version): New function. (ix86_compare_version_priority): New function. (feature_compare): New function. (dispatch_function_versions): New function. (ix86_function_versions): New function. (attr_strcmp): New function. (ix86_mangle_function_version_assembler_name): New function. (ix86_mangle_decl_assembler_name): New function. (make_name): New function. (make_dispatcher_decl): New function. (is_function_default_version): New function. (ix86_get_function_versions_dispatcher): New function. (make_attribute): New function. (make_resolver_func): New function. (ix86_generate_version_dispatcher_body): New function. (fold_builtin_cpu): Return integer for cpu builtins. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): New macro. (TARGET_COMPARE_VERSION_PRIORITY): New macro. (TARGET_GENERATE_VERSION_DISPATCHER_BODY): New macro. (TARGET_GET_FUNCTION_VERSIONS_DISPATCHER): New macro. (TARGET_OPTION_FUNCTION_VERSIONS): New macro. * class.c (add_method): Change assembler names of function versions. (mark_versions_used): New static function. (resolve_address_of_overloaded_function): Create dispatcher decl and return address of dispatcher instead. * decl.c (decls_match): Make decls unmatched for versioned functions. (duplicate_decls): Remove ambiguity for versioned functions. Delete versioned function data for merged decls. * decl2.c (check_classfn): Check attributes of versioned functions for match. * call.c (get_function_version_dispatcher): New function. (mark_versions_used): New static function. (build_over_call): Make calls to multiversioned functions to call the dispatcher. (joust): For calls to multi-versioned functions, make the most specialized function version win. * testsuite/g++.dg/mv1.C: New test. * testsuite/g++.dg/mv2.C: New test. * testsuite/g++.dg/mv3.C: New test. * testsuite/g++.dg/mv4.C: New test. * testsuite/g++.dg/mv5.C: New test. * testsuite/g++.dg/mv6.C: New test. From-SVN: r193204
2012-11-06 03:35:17 +01:00
@deftypefn {Target Hook} int TARGET_COMPARE_VERSION_PRIORITY (tree @var{decl1}, tree @var{decl2})
This hook is used to compare the target attributes in two functions to
determine which function's features get higher priority. This is used
during function multi-versioning to figure out the order in which two
versions must be dispatched. A function version with a higher priority
is checked for dispatching earlier. @var{decl1} and @var{decl2} are
the two function decls that will be compared.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_GET_FUNCTION_VERSIONS_DISPATCHER (void *@var{decl})
This hook is used to get the dispatcher function for a set of function
versions. The dispatcher function is called to invoke the right function
version at run-time. @var{decl} is one version from a set of semantically
identical versions.
@end deftypefn
@deftypefn {Target Hook} tree TARGET_GENERATE_VERSION_DISPATCHER_BODY (void *@var{arg})
This hook is used to generate the dispatcher logic to invoke the right
function version at run-time for a given set of function versions.
@var{arg} points to the callgraph node of the dispatcher function whose
body must be generated.
@end deftypefn
2014-05-06 18:25:05 +02:00
@deftypefn {Target Hook} bool TARGET_CAN_USE_DOLOOP_P (const widest_int @var{&iterations}, const widest_int @var{&iterations_max}, unsigned int @var{loop_depth}, bool @var{entered_at_top})
target.def (can_use_doloop_p): New hook. gcc/ * target.def (can_use_doloop_p): New hook. * doc/tm.texi.in (TARGET_CAN_USE_DOLOOP_P): Add. * doc/tm.texi: Regenerate. * doc/md.texi (doloop_begin, doloop_end): Update documentation. * hooks.h (hook_bool_dint_dint_uint_true): Declare. * hooks.c (hook_bool_dint_dint_uint_true): New function. * targhooks.h (can_use_doloop_if_innermost): Declare. * targhooks.c (can_use_doloop_if_innermost): New function. * target.h: Include double-int.h. * loop-doloop.c (doloop_optimize): Call targetm.can_use_doloop_p. Remove iteration count, maximum iteration count, loop depth and enter-at-top inputs from doloop_begin and doloop_end. * config/arc/arc.md (doloop_begin, doloop_end): Update for new interface. * config/arc/arc.c (arc_can_use_doloop_p): New function. (TARGET_CAN_USE_DOLOOP_P): Define. * config/arm/thumb2.md (doloop_end): Update for new interface. * config/arm/arm.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/bfin/bfin.md (doloop_end): Update for new interface. * config/bfin/bfin.c (bfin_can_use_doloop_p): New function. (TARGET_CAN_USE_DOLOOP_P): Define. * config/c6x/c6x.md (doloop_end): Update for new interface. * config/ia64/ia64.md (doloop_end): Update for new interface. * config/ia64/ia64.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/mep/mep.md (doloop_begin, doloop_end): Update for new interface. * config/mep/mep.c (mep_emit_doloop): Likewise. (TARGET_CAN_USE_DOLOOP_P): Define. * config/rs6000/rs6000.md (doloop_end): Update for new interface. * config/rs6000/rs6000.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/s390/s390.md (doloop_end): Update for new interface. * config/sh/sh.md (doloop_end): Likewise. * config/spu/spu.md (doloop_end): Likewise. * config/spu/spu.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/tilegx/tilegx.md (doloop_end): Update for new interface. * config/tilegx/tilegx.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/tilepro/tilepro.md (doloop_end): Update for new interface. * config/tilepro/tilepro.c (TARGET_CAN_USE_DOLOOP_P): Define. * config/v850/v850.md (doloop_begin, doloop_end): Update for new interface. * config/v850/v850.c (TARGET_CAN_USE_DOLOOP_P): Define. From-SVN: r204614
2013-11-09 12:42:16 +01:00
Return true if it is possible to use low-overhead loops (@code{doloop_end}
and @code{doloop_begin}) for a particular loop. @var{iterations} gives the
exact number of iterations, or 0 if not known. @var{iterations_max} gives
the maximum number of iterations, or 0 if not known. @var{loop_depth} is
the nesting depth of the loop, with 1 for innermost loops, 2 for loops that
contain innermost loops, and so on. @var{entered_at_top} is true if the
loop is only entered from the top.
This hook is only used if @code{doloop_end} is available. The default
implementation returns true. You can use @code{can_use_doloop_if_innermost}
if the loop must be the innermost, and if there are no other restrictions.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_WITHIN_DOLOOP (const rtx_insn *@var{insn})
Take an instruction in @var{insn} and return NULL if it is valid within a
low-overhead loop, otherwise return a string explaining why doloop
could not be applied.
Many targets use special registers for low-overhead looping. For any
instruction that clobbers these this function should return a string indicating
the reason why the doloop could not be applied.
By default, the RTL loop optimizer does not use a present doloop pattern for
loops containing function calls or branch on table instructions.
@end deftypefn
Use rtx_insn for various target.def hooks gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * target.def (unwind_emit): Strengthen param "insn" from rtx to rtx_insn *. (final_postscan_insn): Likewise. (adjust_cost): Likewise. (adjust_priority): Likewise. (variable_issue): Likewise. (macro_fusion_pair_p): Likewise. (dfa_post_cycle_insn): Likewise. (first_cycle_multipass_dfa_lookahead_guard): Likewise. (first_cycle_multipass_issue): Likewise. (dfa_new_cycle): Likewise. (adjust_cost_2): Likewise for params "insn" and "dep_insn". (speculate_insn): Likewise for param "insn". (gen_spec_check): Likewise for params "insn" and "label". (get_insn_spec_ds): Likewise for param "insn". (get_insn_checked_ds): Likewise. (dispatch_do): Likewise. (dispatch): Likewise. (cannot_copy_insn_p): Likewise. (invalid_within_doloop): Likewise. (legitimate_combined_insn): Likewise. (needed): Likewise. (after): Likewise. * doc/tm.texi: Automatically updated to reflect changes to target.def. * haifa-sched.c (choose_ready): Convert NULL_RTX to NULL when working with insn. (schedule_block): Likewise. (sched_init): Likewise. (sched_speculate_insn): Strengthen param "insn" from rtx to rtx_insn *. (ready_remove_first_dispatch): Convert NULL_RTX to NULL when working with insn. * hooks.c (hook_bool_rtx_true): Rename to... hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. * hooks.h (hook_bool_rtx_true): Rename to... (hook_bool_rtx_insn_true): ...this, and strengthen first param from rtx to rtx_insn *. (hook_bool_rtx_int_false): Rename to... (hook_bool_rtx_insn_int_false): ...this, and strengthen first param from rtx to rtx_insn *. (hook_void_rtx_int): Rename to... (hook_void_rtx_insn_int): ...this, and strengthen first param from rtx to rtx_insn *. (hook_constcharptr_const_rtx_null): Rename to... (hook_constcharptr_const_rtx_insn_null): ...this, and strengthen first param from const_rtx to const rtx_insn *. * sched-deps.c (sched_macro_fuse_insns): Strengthen param "insn" and local "prev" from rtx to rtx_insn *. * sched-int.h (sched_speculate_insn): Strengthen first param from rtx to rtx_insn *. * sel-sched.c (create_speculation_check): Likewise for local "label". * targhooks.c (default_invalid_within_doloop): Strengthen param "insn" from const_rtx to const rtx_insn *. * targhooks.h (default_invalid_within_doloop): Strengthen param from const_rtx to const rtx_insn *. * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Likewise. (alpha_adjust_cost): Likewise for params "insn", "dep_insn". * config/arc/arc.c (arc_sched_adjust_priority): Likewise for param "insn". (arc_invalid_within_doloop): Likewise, with const. * config/arm/arm.c (arm_adjust_cost): Likewise for params "insn", "dep". (arm_cannot_copy_insn_p): Likewise for param "insn". (arm_unwind_emit): Likewise. * config/bfin/bfin.c (bfin_adjust_cost): Likewise for params "insn", "dep_insn". * config/c6x/c6x.c (c6x_dfa_new_cycle): Likewise for param "insn". (c6x_variable_issue): Likewise. Removed now-redundant checked cast. (c6x_adjust_cost): Likewise for params "insn", "dep_insn". * config/epiphany/epiphany-protos.h (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_cost): Likewise for params "insn", "dep_insn". (epiphany_mode_needed): Likewise for param "insn". (epiphany_mode_after): Likewise. * config/i386/i386-protos.h (i386_pe_seh_unwind_emit): Likewise. * config/i386/i386.c (ix86_legitimate_combined_insn): Likewise. (ix86_avx_u128_mode_needed): Likewise. (ix86_i387_mode_needed): Likewise. (ix86_mode_needed): Likewise. (ix86_avx_u128_mode_after): Likewise. (ix86_mode_after): Likewise. (ix86_adjust_cost): Likewise for params "insn", "dep_insn". (ix86_macro_fusion_pair_p): Likewise for params "condgen", "condjmp". (ix86_adjust_priority): Likewise for param "insn". (core2i7_first_cycle_multipass_issue): Likewise for param "insn". (do_dispatch): Likewise. (has_dispatch): Likewise. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Likewise. * config/ia64/ia64.c (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. (ia64_adjust_cost_2): Strengthen params "insn", "dep_insn" from rtx to rtx_insn *. (ia64_variable_issue): Likewise for param "insn". (ia64_first_cycle_multipass_dfa_lookahead_guard): Likewise. (ia64_dfa_new_cycle): Likewise. (ia64_get_insn_spec_ds): Likewise. (ia64_get_insn_checked_ds): Likewise. (ia64_speculate_insn): Likewise. (ia64_gen_spec_check): Likewise for params "insn", "label". (ia64_asm_unwind_emit): Likewise for param "insn". * config/m32r/m32r.c (m32r_adjust_priority): Likewise. * config/m68k/m68k.c (m68k_sched_adjust_cost): Likewise for params "insn", "def_insn". (m68k_sched_variable_issue): Likewise for param "insn". * config/mep/mep.c (mep_adjust_cost): Likewise for params "insn", "def_insn". * config/microblaze/microblaze.c (microblaze_adjust_cost): Likewise for params "insn", "dep". * config/mips/mips.c (mips_adjust_cost): Likewise. (mips_variable_issue): Likewise for param "insn". (mips_final_postscan_insn): Likewise. * config/mn10300/mn10300.c (mn10300_adjust_sched_cost): Likewise for params "insn", "dep". * config/pa/pa.c (pa_adjust_cost): Likewise for params "insn", "dep_insn". (pa_adjust_priority): Likewise for param "insn". * config/picochip/picochip.c (picochip_sched_adjust_cost): Likewise for params "insn", "dep_insn". * config/rs6000/rs6000.c (rs6000_variable_issue_1): Likewise for param "insn". (rs6000_variable_issue): Likewise. (rs6000_adjust_cost): Likewise for params "insn", "dep_insn". (rs6000_debug_adjust_cost): Likewise. (rs6000_adjust_priority): Likewise for param "insn". (rs6000_use_sched_lookahead_guard): Likewise. (get_next_active_insn): Likewise for return type and both params. (redefine_groups): Likewise for params "prev_head_insn", "tail" and locals "insn", "next_insn". (pad_groups): Likewise. * config/s390/s390.c (s390_adjust_priority): Likewise for param "insn". (s390_cannot_copy_insn_p): Likewise. (s390_sched_variable_issue): Likewise for third param, eliminating checked cast. (TARGET_INVALID_WITHIN_DOLOOP): Update to reflect renaming of default hook implementation from hook_constcharptr_const_rtx_null to hook_constcharptr_const_rtx_insn_null. * config/sh/sh.c (sh_cannot_copy_insn_p): Strengthen param "insn" from rtx to rtx_insn *. (sh_adjust_cost): Likewise for params "insn", "dep_insn". (sh_variable_issue): Likewise for param "insn". (sh_dfa_new_cycle): Likewise. (sh_mode_needed): Likewise. (sh_mode_after): Likewise. * config/sparc/sparc.c (supersparc_adjust_cost): Likewise for params "insn", "dep_insn". (hypersparc_adjust_cost): Likewise. (sparc_adjust_cost): Likewise. * config/spu/spu.c (spu_sched_variable_issue): Likewise for third param, eliminated checked cast. (spu_sched_adjust_cost): Likewise for first and third params. * config/tilegx/tilegx.c (tilegx_sched_adjust_cost): Strengthen params "insn" and "dep_insn" from rtx to rtx_insn *. * config/tilepro/tilepro.c (tilepro_sched_adjust_cost): Likewise. From-SVN: r214584
2014-08-27 21:34:13 +02:00
@deftypefn {Target Hook} bool TARGET_LEGITIMATE_COMBINED_INSN (rtx_insn *@var{insn})
Take an instruction in @var{insn} and return @code{false} if the instruction is not appropriate as a combination of two or more instructions. The default is to accept all instructions.
@end deftypefn
@defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2})
Take a branch insn in @var{branch1} and another in @var{branch2}.
Return true if redirecting @var{branch1} to the destination of
@var{branch2} is possible.
On some targets, branches may have a limited range. Optimizing the
filling of delay slots can result in branches being redirected, and this
may in turn cause a branch offset to overflow.
@end defmac
@deftypefn {Target Hook} bool TARGET_CAN_FOLLOW_JUMP (const rtx_insn *@var{follower}, const rtx_insn *@var{followee})
FOLLOWER and FOLLOWEE are JUMP_INSN instructions; return true if FOLLOWER may be modified to follow FOLLOWEE; false, if it can't. For example, on some targets, certain kinds of branches can't be made to follow through a hot/cold partitioning.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypefn {Target Hook} bool TARGET_COMMUTATIVE_P (const_rtx @var{x}, int @var{outer_code})
This target hook returns @code{true} if @var{x} is considered to be commutative.
Usually, this is just COMMUTATIVE_P (@var{x}), but the HP PA doesn't consider
PLUS to be commutative inside a MEM@. @var{outer_code} is the rtx code
of the enclosing rtl, if known, otherwise it is UNKNOWN.
@end deftypefn
@deftypefn {Target Hook} rtx TARGET_ALLOCATE_INITIAL_VALUE (rtx @var{hard_reg})
When the initial value of a hard register has been copied in a pseudo
register, it is often not necessary to actually allocate another register
to this pseudo register, because the original hard register or a stack slot
it has been saved into can be used. @code{TARGET_ALLOCATE_INITIAL_VALUE}
is called at the start of register allocation once for each hard register
that had its initial value copied by using
@code{get_func_hard_reg_initial_val} or @code{get_hard_reg_initial_val}.
Possible values are @code{NULL_RTX}, if you don't want
to do any special allocation, a @code{REG} rtx---that would typically be
the hard register itself, if it is known not to be clobbered---or a
@code{MEM}.
If you are returning a @code{MEM}, this is only a hint for the allocator;
it might decide to use another register anyways.
You may use @code{current_function_is_leaf} or
@code{REG_N_SETS} in the hook to determine if the hard
register in question will not be clobbered.
The default value of this hook is @code{NULL}, which disables any special
allocation.
@end deftypefn
@deftypefn {Target Hook} int TARGET_UNSPEC_MAY_TRAP_P (const_rtx @var{x}, unsigned @var{flags})
This target hook returns nonzero if @var{x}, an @code{unspec} or
@code{unspec_volatile} operation, might cause a trap. Targets can use
this hook to enhance precision of analysis for @code{unspec} and
@code{unspec_volatile} operations. You may call @code{may_trap_p_1}
to analyze inner elements of @var{x} in which case @var{flags} should be
passed along.
@end deftypefn
Add target hook invoked when cfun changes. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> gcc/ Add target hook invoked when cfun changes. * doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document. * target.h (struct gcc_target): Add set_current_function. * target-def.h (TARGET_SET_CURRENT_FUNCTION): Define. (TARGET_INITIALIZER): Add initializer for set_current_function. * tree.h (push_struct_function): New. * tree-inline.h (push_cfun, pop_cfun): Move declarations to... * function.h: Here. (set_cfun): Declare. * tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to... * function.c: Here. (push_function_context_to): Use allocate_struct_function to create null context, not init_dummy_function_start. Use set_cfun. (pop_function_context_from): Use set_cfun. (in_dummy_function): New. (invoke_set_current_function_hook): New. (set_cfun): New. (push_cfun, pop_cfun): Use set_cfun. (push_struct_function): New. (allocate_struct_function): Call invoke_set_current_function_hook before returning. (prepare_function_start): Don't set cfun here. Remove unused argument; fix all callers. (init_dummy_function_start): Fiddle with in_dummy_function. Call push_struct_function. (init_function_start): Set cfun here. (expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun. * omp-low.c (create_omp_child_function): Use push_struct_function and pop_cfun to save/restore state. (expand_omp_parallel): Remove unused saved_cfun variable. * cgraphunit.c (ipa_passes): Use set_cfun. * gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here. * dwarf2out.c (dwarf2out_abstract_function): Likewise. * matrix-reorg.c (transform_allocation_sites): Likewise. (matrix_reorg): Use set_cfun. * gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here. * tree-optimize.c (tree_rest_of_compilation): Remove one redundant assignment to cfun; use set_cfun for the other. * tree-cfg.c (move_sese_region_to_fn): Use set_cfun. (dump_function_to_file): Use push_cfun/pop_cfun here. * c-decl.c (finish_function): Use set_cfun. gcc/ada/ * trans.c (Compilation_unit_to_gnu): Use set_cfun. * utils.c (end_subprog_body): Likewise. gcc/cp/ * decl.c (finish_function): Use set_cfun. * method.c (use_thunk): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Use set_cfun. (gfc_generate_function_code): Likewise. gcc/java/ * decl.c (finish_method): Use set_cfun. gcc/treelang/ * treetree.c (tree_code_create_function_wrapup): Use set_cfun. From-SVN: r128132
2007-09-05 16:24:54 +02:00
@deftypefn {Target Hook} void TARGET_SET_CURRENT_FUNCTION (tree @var{decl})
The compiler invokes this hook whenever it changes its current function
Add target hook invoked when cfun changes. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> gcc/ Add target hook invoked when cfun changes. * doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document. * target.h (struct gcc_target): Add set_current_function. * target-def.h (TARGET_SET_CURRENT_FUNCTION): Define. (TARGET_INITIALIZER): Add initializer for set_current_function. * tree.h (push_struct_function): New. * tree-inline.h (push_cfun, pop_cfun): Move declarations to... * function.h: Here. (set_cfun): Declare. * tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to... * function.c: Here. (push_function_context_to): Use allocate_struct_function to create null context, not init_dummy_function_start. Use set_cfun. (pop_function_context_from): Use set_cfun. (in_dummy_function): New. (invoke_set_current_function_hook): New. (set_cfun): New. (push_cfun, pop_cfun): Use set_cfun. (push_struct_function): New. (allocate_struct_function): Call invoke_set_current_function_hook before returning. (prepare_function_start): Don't set cfun here. Remove unused argument; fix all callers. (init_dummy_function_start): Fiddle with in_dummy_function. Call push_struct_function. (init_function_start): Set cfun here. (expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun. * omp-low.c (create_omp_child_function): Use push_struct_function and pop_cfun to save/restore state. (expand_omp_parallel): Remove unused saved_cfun variable. * cgraphunit.c (ipa_passes): Use set_cfun. * gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here. * dwarf2out.c (dwarf2out_abstract_function): Likewise. * matrix-reorg.c (transform_allocation_sites): Likewise. (matrix_reorg): Use set_cfun. * gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here. * tree-optimize.c (tree_rest_of_compilation): Remove one redundant assignment to cfun; use set_cfun for the other. * tree-cfg.c (move_sese_region_to_fn): Use set_cfun. (dump_function_to_file): Use push_cfun/pop_cfun here. * c-decl.c (finish_function): Use set_cfun. gcc/ada/ * trans.c (Compilation_unit_to_gnu): Use set_cfun. * utils.c (end_subprog_body): Likewise. gcc/cp/ * decl.c (finish_function): Use set_cfun. * method.c (use_thunk): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Use set_cfun. (gfc_generate_function_code): Likewise. gcc/java/ * decl.c (finish_method): Use set_cfun. gcc/treelang/ * treetree.c (tree_code_create_function_wrapup): Use set_cfun. From-SVN: r128132
2007-09-05 16:24:54 +02:00
context (@code{cfun}). You can define this function if
the back end needs to perform any initialization or reset actions on a
per-function basis. For example, it may be used to implement function
attributes that affect register usage or code generation patterns.
The argument @var{decl} is the declaration for the new function context,
and may be null to indicate that the compiler has left a function context
and is returning to processing at the top level.
The default hook function does nothing.
GCC sets @code{cfun} to a dummy function context during initialization of
some parts of the back end. The hook function is not invoked in this
situation; you need not worry about the hook being invoked recursively,
or when the back end is in a partially-initialized state.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@code{cfun} might be @code{NULL} to indicate processing at top level,
outside of any function scope.
Add target hook invoked when cfun changes. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> gcc/ Add target hook invoked when cfun changes. * doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document. * target.h (struct gcc_target): Add set_current_function. * target-def.h (TARGET_SET_CURRENT_FUNCTION): Define. (TARGET_INITIALIZER): Add initializer for set_current_function. * tree.h (push_struct_function): New. * tree-inline.h (push_cfun, pop_cfun): Move declarations to... * function.h: Here. (set_cfun): Declare. * tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to... * function.c: Here. (push_function_context_to): Use allocate_struct_function to create null context, not init_dummy_function_start. Use set_cfun. (pop_function_context_from): Use set_cfun. (in_dummy_function): New. (invoke_set_current_function_hook): New. (set_cfun): New. (push_cfun, pop_cfun): Use set_cfun. (push_struct_function): New. (allocate_struct_function): Call invoke_set_current_function_hook before returning. (prepare_function_start): Don't set cfun here. Remove unused argument; fix all callers. (init_dummy_function_start): Fiddle with in_dummy_function. Call push_struct_function. (init_function_start): Set cfun here. (expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun. * omp-low.c (create_omp_child_function): Use push_struct_function and pop_cfun to save/restore state. (expand_omp_parallel): Remove unused saved_cfun variable. * cgraphunit.c (ipa_passes): Use set_cfun. * gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here. * dwarf2out.c (dwarf2out_abstract_function): Likewise. * matrix-reorg.c (transform_allocation_sites): Likewise. (matrix_reorg): Use set_cfun. * gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here. * tree-optimize.c (tree_rest_of_compilation): Remove one redundant assignment to cfun; use set_cfun for the other. * tree-cfg.c (move_sese_region_to_fn): Use set_cfun. (dump_function_to_file): Use push_cfun/pop_cfun here. * c-decl.c (finish_function): Use set_cfun. gcc/ada/ * trans.c (Compilation_unit_to_gnu): Use set_cfun. * utils.c (end_subprog_body): Likewise. gcc/cp/ * decl.c (finish_function): Use set_cfun. * method.c (use_thunk): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Use set_cfun. (gfc_generate_function_code): Likewise. gcc/java/ * decl.c (finish_method): Use set_cfun. gcc/treelang/ * treetree.c (tree_code_create_function_wrapup): Use set_cfun. From-SVN: r128132
2007-09-05 16:24:54 +02:00
@end deftypefn
@defmac TARGET_OBJECT_SUFFIX
Define this macro to be a C string representing the suffix for object
files on your target machine. If you do not define this macro, GCC will
use @samp{.o} as the suffix for object files.
@end defmac
@defmac TARGET_EXECUTABLE_SUFFIX
Define this macro to be a C string representing the suffix to be
automatically added to executable files on your target machine. If you
do not define this macro, GCC will use the null string as the suffix for
executable files.
@end defmac
@defmac COLLECT_EXPORT_LIST
If defined, @code{collect2} will scan the individual object files
specified on its command line and create an export list for the linker.
Define this macro for systems like AIX, where the linker discards
object files that are not referenced from @code{main} and uses export
lists.
@end defmac
@defmac MODIFY_JNI_METHOD_CALL (@var{mdecl})
Define this macro to a C expression representing a variant of the
method call @var{mdecl}, if Java Native Interface (JNI) methods
must be invoked differently from other methods on your target.
For example, on 32-bit Microsoft Windows, JNI methods must be invoked using
the @code{stdcall} calling convention and this macro is then
defined as this expression:
@smallexample
build_type_attribute_variant (@var{mdecl},
build_tree_list
(get_identifier ("stdcall"),
NULL))
@end smallexample
@end defmac
@deftypefn {Target Hook} bool TARGET_CANNOT_MODIFY_JUMPS_P (void)
This target hook returns @code{true} past the point in which new jump
instructions could be created. On machines that require a register for
every jump such as the SHmedia ISA of SH5, this point would typically be
reload, so this target hook should be defined to a function such as:
@smallexample
static bool
cannot_modify_jumps_past_reload_p ()
@{
return (reload_completed || reload_in_progress);
@}
@end smallexample
@end deftypefn
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
re PR middle-end/44566 (configuration with multiple targets / backends is not supported.) PR other/44566 * coretypes.h [!USED_FOR_TARGET] (reg_class_t): Define. * target.def (struct gcc_target): Replace enum reg_class with reg_class_t in hook argument / return types. * doc/tm.texi.in (TARGET_SECONDARY_RELOAD): Likewise. (TARGET_IRA_COVER_CLASSES, TARGET_MEMORY_MOVE_COST): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Likewise. * targhooks.h (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * targhooks.c (default_branch_target_register_class): Likewise. (default_ira_cover_classes, default_secondary_reload): Likewise. (default_memory_move_cost, default_register_move_cost): Likewise. * reload.c (push_secondary_reload, secondary_reload_class): Likewise. * bt-load.c (branch_target_load_optimize): Likewise. * ira.c (setup_cover_and_important_classes): Likewise. * ira-costs.c (copy_cost): Likewise. * reload1.c (emit_input_reload_insns): Likewise. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_secondary_reload): Likewise. * config/s390/s390.c (s390_secondary_reload): Likewise. * config/i386/i386.c (i386_ira_cover_classes): Likewise. (ix86_secondary_reload, ix86_memory_move_cost): Likewise. (ix86_register_move_cost): Likewise. * config/sh/sh-protos.h (sh_secondary_reload): Likewise. * config/sh/sh.c (sh_target_reg_class, sh_secondary_reload): Likewise. * config/xtensa/xtensa.c (xtensa_secondary_reload): Likewise. * config/xtensa/xtensa-protos.h (xtensa_secondary_reload): Likewise. * config/rs6000/rs6000.c (rs6000_secondary_reload): Likewise. (rs6000_ira_cover_classes): Likewise. * config/picochip/picochip.c (picochip_secondary_reload): Likewise. * config/picochip/picochip-protos.h (picochip_secondary_reload): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * config/mips/mips.c (mips_ira_cover_classes): Likewise. * config/bfin/bfin.c (bfin_secondary_reload): Likewise. * config/ia64/ia64.c (ia64_register_move_cost): Likewise. * doc/tm.texi: Regenerate. From-SVN: r161633
2010-06-30 20:47:43 +02:00
@deftypefn {Target Hook} reg_class_t TARGET_BRANCH_TARGET_REGISTER_CLASS (void)
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
This target hook returns a register class for which branch target register
optimizations should be applied. All registers in this class should be
usable interchangeably. After reload, registers in this class will be
bt-load.c: New file. 2003-06-18 Stephen Clarke <stephen.clarke@superh.com> J"orn Rennecke <joern.rennecke@superh.com> * bt-load.c: New file. * Makefile.in (OBJS): Include bt-load.o (bt-load.o): Add dependencies. * flags.h (flag_branch_target_load_optimize): Declare. (flag_branch_target_load_optimize2): Likewise. * hooks.c (hook_reg_class_void_no_regs): New function. (hook_bool_bool_false): Likewise. * hooks.h (hook_reg_class_void_no_regs, hook_bool_bool_false): Declare. * rtl.h (branch_target_load_optimize): Declare. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (TARGET_INITIALIZER): Include these. * target.h (struct gcc_target): Add branch_target_register_class and branch_target_register_callee_saved members. * toplev.c (enum dump_file_index): Add DFI_branch_target_load (dump_file) Add "tars" entry. (flag_branch_target_load_optimize): New variable. (flag_branch_target_load_optimize2): Likewise. (lang_independent_options): Add entries for new options. (rest_of_compilation): Call branch_target_load_optimize. * doc/tm.texi (TARGET_BRANCH_TARGET_REGISTER_CLASS): Document. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. * doc/invoke.texi: Document -fbranch-target-load-optimize and -fbranch-target-load-optimize2. * rtl.h (epilogue_completed): Declare. * recog.c (epilogue_completed): New variable. * toplev.c (rest_of_compilation): Set it. * flow.c (mark_regs_live_at_end): Use it. * config/ia64/ia64.c (ia64_output_mi_thunk): Set it. * config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise. * config/sh/sh.c (sh_output_mi_thunk): Likewise. * config/sparc/sparc.c (sparc_output_mi_thunk): Likewise. * sh.c (shmedia_space_reserved_for_target_registers): New variable. (sh_target_reg_class): New function. (sh_optimize_target_register_callee_saved): Likwise. (shmedia_target_regs_stack_space): Likewise. (shmedia_reserve_space_for_target_registers_p): Likewise. (shmedia_target_regs_stack_adjust): Likewise. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Override. (TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED): Likewise. (calc_live_regs): If flag_branch_target_load_optimize2 and TARGET_SAVE_ALL_TARGET_REGS is enabled, and we have space reserved for target registers, make sure that we save all target registers. (sh_expand_prologue, sh_expand_epilogue): Take target register optimizations into account. Collapse stack adjustments if that is beneficial. (initial_elimination_offset): Reserve space for target registers if necessary. * sh.h (SAVE_ALL_TR_BIT, TARGET_SAVE_ALL_TARGET_REGS): Define. (OPTIMIZATION_OPTIONS): Enable flag_branch_target_load_optimize. Co-Authored-By: J"orn Rennecke <joern.rennecke@superh.com> From-SVN: r68165
2003-06-18 21:43:55 +02:00
re-allocated and loads will be hoisted out of loops and be subjected
to inter-block scheduling.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_BRANCH_TARGET_REGISTER_CALLEE_SAVED (bool @var{after_prologue_epilogue_gen})
Branch target register optimization will by default exclude callee-saved
registers
that are not already live during the current function; if this target hook
returns true, they will be included. The target code must than make sure
that all target registers in the class returned by
@samp{TARGET_BRANCH_TARGET_REGISTER_CLASS} that might need saving are
saved. @var{after_prologue_epilogue_gen} indicates if prologues and
epilogues have already been generated. Note, even if you only return
true when @var{after_prologue_epilogue_gen} is false, you still are likely
to have to make special provisions in @code{INITIAL_ELIMINATION_OFFSET}
to reserve space for caller-saved target registers.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_HAVE_CONDITIONAL_EXECUTION (void)
This target hook returns true if the target supports conditional execution.
This target hook is required only when the target has several different
modes and they have different conditional execution capability, such as ARM.
@end deftypefn
@deftypefn {Target Hook} unsigned TARGET_LOOP_UNROLL_ADJUST (unsigned @var{nunroll}, struct loop *@var{loop})
This target hook returns a new value for the number of times @var{loop}
should be unrolled. The parameter @var{nunroll} is the number of times
the loop is to be unrolled. The parameter @var{loop} is a pointer to
the loop, which is going to be checked for unrolling. This target hook
is required only when the target has special constraints like maximum
number of memory accesses.
@end deftypefn
@defmac POWI_MAX_MULTS
If defined, this macro is interpreted as a signed integer C expression
that specifies the maximum number of floating point multiplications
that should be emitted when expanding exponentiation by an integer
constant inline. When this value is defined, exponentiation requiring
more than this number of multiplications is implemented by calling the
system library's @code{pow}, @code{powf} or @code{powl} routines.
The default value places no upper bound on the multiplication count.
@end defmac
Add framework support for darwin. * c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. From-SVN: r78875
2004-03-04 01:18:54 +01:00
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
@deftypefn Macro void TARGET_EXTRA_INCLUDES (const char *@var{sysroot}, const char *@var{iprefix}, int @var{stdinc})
Add framework support for darwin. * c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. From-SVN: r78875
2004-03-04 01:18:54 +01:00
This target hook should register any extra include files for the
target. The parameter @var{stdinc} indicates if normal include files
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin) 2004-09-15 Andrew Pinski <pinskia@physics.uc.edu> PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. From-SVN: r87588
2004-09-16 08:49:59 +02:00
are present. The parameter @var{sysroot} is the system root directory.
The parameter @var{iprefix} is the prefix for the gcc directory.
@end deftypefn
@deftypefn Macro void TARGET_EXTRA_PRE_INCLUDES (const char *@var{sysroot}, const char *@var{iprefix}, int @var{stdinc})
This target hook should register any extra include files for the
target before any standard headers. The parameter @var{stdinc}
indicates if normal include files are present. The parameter
@var{sysroot} is the system root directory. The parameter
@var{iprefix} is the prefix for the gcc directory.
Add framework support for darwin. * c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. From-SVN: r78875
2004-03-04 01:18:54 +01:00
@end deftypefn
@deftypefn Macro void TARGET_OPTF (char *@var{path})
This target hook should register special include paths for the target.
The parameter @var{path} is the include to register. On Darwin
systems, this is used for Framework includes, which have semantics
that are different from @option{-I}.
@end deftypefn
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@defmac bool TARGET_USE_LOCAL_THUNK_ALIAS_P (tree @var{fndecl})
This target macro returns @code{true} if it is safe to use a local alias
for a virtual function @var{fndecl} when constructing thunks,
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@code{false} otherwise. By default, the macro returns @code{true} for all
functions, if a target supports aliases (i.e.@: defines
@code{ASM_OUTPUT_DEF}), @code{false} otherwise,
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end defmac
@defmac TARGET_FORMAT_TYPES
If defined, this macro is the name of a global variable containing
target-specific format checking information for the @option{-Wformat}
option. The default is to have no target-specific format checks.
@end defmac
@defmac TARGET_N_FORMAT_TYPES
If defined, this macro is the number of entries in
@code{TARGET_FORMAT_TYPES}.
@end defmac
ms format support for mingw. for gcc: * c-format.c (replace_format_name_to_system_name): New. (cmp_attribs): New. (convert_format_name_to_system_name): New. (decode_format_attr): Add use of convert_format_name_to_system_name. (format_types_orig): Add gnu_ prefix to names. (check_format_info_main): Special treating of \0 escaped names for supporting multi-character format specifiers as I32, I64. (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): Use of user defined attributes. (gnu_target_overrides_format_attributes): New. * c-format.h: Add structure target_ovr_attr to hold system specific formatter names. * config.gcc: Add for x86&x86_64 cygwin and mingw32 targets the msformat-c.o file to c_target_objs and cxx_target_objs. * config/i386/mingw32.h (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New. (TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT): New. (TARGET_N_FORMAT_TYPES): New. * config/i386/msformat-c.c: New. * config/i386/t-cygming: Add build rule for msformat-c.o. * doc/extend.texi: Add new format names gnu_* and ms_* and further details. * doc/tm.texi: (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New. for gcc/testsuite/ * gcc.dg/format/ms_array-1.c: New. * gcc.dg/format/ms_c90-scanf-3.c: New. * gcc.dg/format/ms_c99-strftime-1.c: New. * gcc.dg/format/ms_no-y2k-1.c: New. * gcc.dg/format/ms_attr-1.c: New. * gcc.dg/format/ms_c90-scanf-4.c: New. * gcc.dg/format/ms_c99-strftime-2.c: New. * gcc.dg/format/ms_nonlit-1.c: New. * gcc.dg/format/ms_c90-scanf-5.c: New. * gcc.dg/format/ms_cast-1.c: New. * gcc.dg/format/ms_nonlit-2.c: New. * gcc.dg/format/ms_attr-2.c: New. * gcc.dg/format/ms_c90-strftime-1.c: New. * gcc.dg/format/ms_miss-1.c: New. * gcc.dg/format/ms_nonlit-3.c: New. * gcc.dg/format/ms_attr-3.c: New. * gcc.dg/format/ms_c90-strftime-2.c: New. * gcc.dg/format/ms_miss-2.c: New. * gcc.dg/format/ms_nul-1.c: New. * gcc.dg/format/ms_attr-4.c: New. * gcc.dg/format/ms_c94-printf-1.c: New. * gcc.dg/format/ms_miss-3.c: New. * gcc.dg/format/ms_nul-2.c: New. * gcc.dg/format/ms_attr-7.c: New. * gcc.dg/format/ms_c94-scanf-1.c: New. * gcc.dg/format/ms_miss-4.c: New. * gcc.dg/format/ms_null-1.c: New. * gcc.dg/format/ms_bitfld-1.c: New. * gcc.dg/format/ms_c99-printf-1.c: New. * gcc.dg/format/ms_miss-5.c: New. * gcc.dg/format/ms_plus-1.c: New. * gcc.dg/format/ms_branch-1.c: New. * gcc.dg/format/ms_c99-printf-2.c: New. * gcc.dg/format/ms_miss-6.c: New. * gcc.dg/format/ms_sec-1.c: New. * gcc.dg/format/ms_c90-printf-1.c: New. * gcc.dg/format/ms_c99-printf-3.c: New. * gcc.dg/format/ms_multattr-1.c: New. * gcc.dg/format/ms_unnamed-1.c: New. * gcc.dg/format/ms_c90-printf-2.c: New. * gcc.dg/format/ms_c99-scanf-1.c: New. * gcc.dg/format/ms_multattr-2.c: New. * gcc.dg/format/ms_va-1.c: New. * gcc.dg/format/ms_c90-printf-3.c: New. * gcc.dg/format/ms_c99-scanf-2.c: New. * gcc.dg/format/ms_multattr-3.c: New. * gcc.dg/format/ms_warnll-1.c: New. * gcc.dg/format/ms_c90-scanf-1.c: New. * gcc.dg/format/ms_c99-scanf-3.c: New. * gcc.dg/format/ms_no-exargs-1.c: New. * gcc.dg/format/ms_zero-length-1.c: New. * gcc.dg/format/ms_c90-scanf-2.c: New. * gcc.dg/format/ms_c99-scanf-4.c: New. * gcc.dg/format/ms_no-exargs-2.c: New. * gcc.dg/format/null-1.c: Add gnu style usage for mingw. * gcc.dg/format/miss-1.c: Likewise. * gcc.dg/format/miss-3.c: Likewise. * gcc.dg/format/multattr-2.c: Likewise. * gcc.dg/format/miss-5.c: Likewise. * gcc.dg/format/attr-2.c: Likewise. * gcc.dg/format/attr-4.c: Likewise. * gcc.dg/format/c90-scanf-4.c: Likewise. * gcc.dg/format/c99-printf-3.c: Likewise. * gcc.dg/format/multattr-1.c: Likewise. * gcc.dg/format/miss-4.c: Likewise. * gcc.dg/format/miss-6.c: Likewise. * gcc.dg/format/c90-printf-3.c: Likewise. * gcc.dg/format/attr-1.c: Likewise. * gcc.dg/format/attr-3.c: Likewise. * gcc.dg/format/attr-7.c: Likewise. * gcc.dg/format/format.h: Treat mingw and gnu style. * gcc.dg/format/sys_format.c: New. From-SVN: r133365
2008-03-20 09:24:42 +01:00
@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES
If defined, this macro is the name of a global variable containing
target-specific format overrides for the @option{-Wformat} option. The
default is to have no target-specific format overrides. If defined,
@code{TARGET_FORMAT_TYPES} must be defined, too.
@end defmac
@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT
If defined, this macro specifies the number of entries in
@code{TARGET_OVERRIDES_FORMAT_ATTRIBUTES}.
@end defmac
@defmac TARGET_OVERRIDES_FORMAT_INIT
If defined, this macro specifies the optional initialization
routine for target specific customizations of the system printf
and scanf formatter settings.
@end defmac
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@deftypevr {Target Hook} bool TARGET_RELAXED_ORDERING
Add memory barriers to the double-checked locking used for static initialization. libstdc++: Add memory barriers to the double-checked locking used for static initialization. * libsupc++/guard.cc (__test_and_acquire): Define default. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE, __set_and_release) (_GLIBCXX_GUARD_SET_AND_RELEASE): Likewise. (recursion_push, recursion_pop): New abstraction functions. (__cxa_guard_acquire): Use _GLIBCXX_GUARD_TEST_AND_ACQUIRE. (__cxa_guard_release): Use _GLIBCXX_GUARD_SET_AND_RELEASE. * config/cpu/generic/cxxabi_tweaks.h (_GLIBCXX_GUARD_TEST): Rename from _GLIBCXX_GUARD_ACQUIRE and reverse sense. (_GLIBCXX_GUARD_SET): Rename from _GLIBCXX_GUARD_RELEASE. * config/cpu/arm/cxxabi_tweaks.h: Likewise. * config/cpu/alpha/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER) (_GLIBCXX_WRITE_MEM_BARRIER): Define. * config/cpu/powerpc/atomic_word.h: Likewise. * config/cpu/sparc/atomic_word.h: Likewise. * config/cpu/generic/atomic_word.h: Define them, commented out. * include/bits/atomicity.h: Define defaults. * config/cpu/ia64/atomic_word.h (__test_and_acquire) (__set_and_release): New inlines. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE): Define. (_GLIBCXX_GUARD_SET_AND_RELEASE): Define. * libsupc++/guard.cc (acquire_1): Use __builtin_trap instead of abort(); gcc: * doc/tm.texi (TARGET_RELAXED_ORDERING): Document. * target.h (struct gcc_target): Add relaxed_ordering field. * target-def.h (TARGET_RELAXED_ORDERING): Define default. (TARGET_INITIALIZER): Add it. * config/alpha/alpha.c (TARGET_RELAXED_ORDERING): Define. * config/ia64/ia64.c (TARGET_RELAXED_ORDERING): Define. * config/rs6000/rs6000.c (TARGET_RELAXED_ORDERING): Define. * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define. * cp/decl.c (expand_static_init): Don't use shortcut if targetm.relaxed_ordering. From-SVN: r92659
2004-12-28 05:36:54 +01:00
If set to @code{true}, means that the target's memory model does not
guarantee that loads which do not depend on one another will access
main memory in the order of the instruction stream; if ordering is
important, an explicit memory barrier must be used. This is true of
many recent processors which implement a policy of ``relaxed,''
``weak,'' or ``release'' memory consistency, such as Alpha, PowerPC,
and ia64. The default is @code{false}.
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
@end deftypevr
Add memory barriers to the double-checked locking used for static initialization. libstdc++: Add memory barriers to the double-checked locking used for static initialization. * libsupc++/guard.cc (__test_and_acquire): Define default. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE, __set_and_release) (_GLIBCXX_GUARD_SET_AND_RELEASE): Likewise. (recursion_push, recursion_pop): New abstraction functions. (__cxa_guard_acquire): Use _GLIBCXX_GUARD_TEST_AND_ACQUIRE. (__cxa_guard_release): Use _GLIBCXX_GUARD_SET_AND_RELEASE. * config/cpu/generic/cxxabi_tweaks.h (_GLIBCXX_GUARD_TEST): Rename from _GLIBCXX_GUARD_ACQUIRE and reverse sense. (_GLIBCXX_GUARD_SET): Rename from _GLIBCXX_GUARD_RELEASE. * config/cpu/arm/cxxabi_tweaks.h: Likewise. * config/cpu/alpha/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER) (_GLIBCXX_WRITE_MEM_BARRIER): Define. * config/cpu/powerpc/atomic_word.h: Likewise. * config/cpu/sparc/atomic_word.h: Likewise. * config/cpu/generic/atomic_word.h: Define them, commented out. * include/bits/atomicity.h: Define defaults. * config/cpu/ia64/atomic_word.h (__test_and_acquire) (__set_and_release): New inlines. (_GLIBCXX_GUARD_TEST_AND_ACQUIRE): Define. (_GLIBCXX_GUARD_SET_AND_RELEASE): Define. * libsupc++/guard.cc (acquire_1): Use __builtin_trap instead of abort(); gcc: * doc/tm.texi (TARGET_RELAXED_ORDERING): Document. * target.h (struct gcc_target): Add relaxed_ordering field. * target-def.h (TARGET_RELAXED_ORDERING): Define default. (TARGET_INITIALIZER): Add it. * config/alpha/alpha.c (TARGET_RELAXED_ORDERING): Define. * config/ia64/ia64.c (TARGET_RELAXED_ORDERING): Define. * config/rs6000/rs6000.c (TARGET_RELAXED_ORDERING): Define. * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Define. * cp/decl.c (expand_static_init): Don't use shortcut if targetm.relaxed_ordering. From-SVN: r92659
2004-12-28 05:36:54 +01:00
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN (const_tree @var{typelist}, const_tree @var{funcdecl}, const_tree @var{val})
If defined, this macro returns the diagnostic message when it is
illegal to pass argument @var{val} to function @var{funcdecl}
with prototype @var{typelist}.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_CONVERSION (const_tree @var{fromtype}, const_tree @var{totype})
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
If defined, this macro returns the diagnostic message when it is
invalid to convert from @var{fromtype} to @var{totype}, or @code{NULL}
if validity should be determined by the front end.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_UNARY_OP (int @var{op}, const_tree @var{type})
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
If defined, this macro returns the diagnostic message when it is
invalid to apply operation @var{op} (where unary plus is denoted by
@code{CONVERT_EXPR}) to an operand of type @var{type}, or @code{NULL}
if validity should be determined by the front end.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_BINARY_OP (int @var{op}, const_tree @var{type1}, const_tree @var{type2})
target.h (invalid_conversion, [...]): New hooks. * target.h (invalid_conversion, invalid_unary_op, invalid_binary_op): New hooks. * target-def.h (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP, TARGET_INITIALIZER): Likewise. * hooks.h (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): New. * hooks.c (hook_constcharptr_tree_tree_null, hook_constcharptr_int_tree_null, hook_constcharptr_int_tree_tree_null): Likewise. * gcc/doc/tm.texi (TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Document. * c-convert.c (convert): Use invalid_conversion hook. * c-typeck.c (build_unary_op): Use invalid_unary_op hook. (build_binary_op): Use invalid_binary_op hook. * config/ia64/ia64-modes.def: Define RFmode. * config/ia64/ia64-protos.h (spill_xfmode_operand): Remove. (ia64_expand_movxf_movrf): New. * config/ia64/ia64.md (movxf): Move code to ia64_expand_movxf_movrf. (movrf, movrf_internal): New. * ia64.c (ia64_invalid_conversion, ia64_invalid_unary_op, ia64_invalid_binary_op, TARGET_INVALID_CONVERSION, TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): New. (spill_xfmode_operand): Rename to spill_xfmode_rfmode_operand. Add mode parameter. Make static. (ia64_expand_movxf_movrf): New, moved from ia64.md. Handle RFmode as well as XFmode. (ia64_function_arg, ia64_function_value, ia64_register_move_cost, ia64_scalar_mode_supported_p): Handle RFmode as well as XFmode. (ia64_init_builtins): Set up __fpreg as RFmode. (ia64_mangle_fundamental_type): Mangle __fpreg as u7__fpreg. cp: * cvt.c (ocp_convert): Use invalid_conversion hook. * typeck.c (build_binary_op): Use invalid_binary_op hook. (build_unary_op): Use invalid_unary_op hook. testsuite: * g++.dg/ext/fpreg1.C, gcc.target/ia64/fpreg-1.c, gcc.target/ia64/fpreg-2.c: New tests. From-SVN: r101391
2005-06-28 23:55:24 +02:00
If defined, this macro returns the diagnostic message when it is
invalid to apply operation @var{op} to operands of types @var{type1}
and @var{type2}, or @code{NULL} if validity should be determined by
the front end.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_PARAMETER_TYPE (const_tree @var{type})
If defined, this macro returns the diagnostic message when it is
invalid for functions to include parameters of type @var{type},
or @code{NULL} if validity should be determined by
the front end. This is currently used only by the C and C++ front ends.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} {const char *} TARGET_INVALID_RETURN_TYPE (const_tree @var{type})
If defined, this macro returns the diagnostic message when it is
invalid for functions to have return type @var{type},
or @code{NULL} if validity should be determined by
the front end. This is currently used only by the C and C++ front ends.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} tree TARGET_PROMOTED_TYPE (const_tree @var{type})
If defined, this target hook returns the type to which values of
@var{type} should be promoted when they appear in expressions,
analogous to the integer promotions, or @code{NULL_TREE} to use the
front end's normal promotion rules. This hook is useful when there are
target-specific types with special promotion rules.
This is currently used only by the C and C++ front ends.
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} tree TARGET_CONVERT_TO_TYPE (tree @var{type}, tree @var{expr})
If defined, this hook returns the result of converting @var{expr} to
@var{type}. It should return the converted expression,
or @code{NULL_TREE} to apply the front end's normal conversion rules.
This hook is useful when there are target-specific types with special
conversion rules.
This is currently used only by the C and C++ front ends.
@end deftypefn
@defmac TARGET_USE_JCR_SECTION
This macro determines whether to use the JCR section to register Java
classes. By default, TARGET_USE_JCR_SECTION is defined to 1 if both
SUPPORTS_WEAK and TARGET_HAVE_NAMED_SECTIONS are true, else 0.
@end defmac
@defmac OBJC_JBLEN
This macro determines the size of the objective C jump buffer for the
NeXT runtime. By default, OBJC_JBLEN is defined to an innocuous value.
@end defmac
@defmac LIBGCC2_UNWIND_ATTRIBUTE
Define this macro if any target-specific attributes need to be attached
to the functions in @file{libgcc} that provide low-level support for
call stack unwinding. It is used in declarations in @file{unwind-generic.h}
and the associated definitions of those functions.
@end defmac
[multiple changes] 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * builtins.c (expand_builtin_setjmp_receiver): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (expand_builtin_apply_args_1): Likewise. (expand_builtin_longjmp): Need DRAP for stack alignment. (expand_builtin_apply): Likewise. * caller-save.c (setup_save_areas): Call assign_stack_local_1 instead of assign_stack_local to allow alignment reduction. * calls.c (emit_call_1): Need DRAP for stack alignment if return pops. (expand_call): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * stmt.c (expand_nl_goto_receiver): Likewise. * cfgexpand.c (get_decl_align_unit): Estimate stack variable alignment and store to stack_alignment_estimated and max_used_stack_slot_alignment. (expand_one_var): Likewise. (expand_stack_alignment): New function. (tree_expand_cfg): Initialize max_used_stack_slot_alignment and stack_alignment_estimated fields in rtl_data. Call expand_stack_alignment at end. * defaults.h (INCOMING_STACK_BOUNDARY): New. (MAX_STACK_ALIGNMENT): Likewise. (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise. (SUPPORTS_STACK_ALIGNMENT): Likewise. * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for stack alignment when generating virtual registers. * function.c (assign_stack_local): Renamed to ... (assign_stack_local_1): This. Add a parameter to indicate if it is OK to reduce alignment. (assign_stack_local): Use it. (instantiate_new_reg): Instantiate virtual incoming args rtx to vDRAP if stack realignment and DRAP is needed. (assign_parms): Collect parameter/return type alignment and contribute to stack_alignment_estimated. (locate_and_pad_parm): Likewise. (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * function.h (rtl_data): Add new field drap_reg, max_used_stack_slot_alignment, stack_alignment_estimated, stack_realign_needed, need_drap, stack_realign_processed and stack_realign_finalized. (stack_realign_fp): New macro. (stack_realign_drap): Likewise. * global.c (compute_regsets): Frame pointer is needed when stack is realigned. Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * reload1.c (update_eliminables): Frame pointer is needed when stack is realigned. (init_elim_table): Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * rtl.h (assign_stack_local_1): Declare new funtion. * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New. (TARGET_GET_DRAP_RTX): Likewise. (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and TARGET_GET_DRAP_RTX. * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx. * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace STACK_BOUNDARY with MAX_STACK_ALIGNMENT. 2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com> H.J. Lu <hongjiu.lu@intel.com> * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg, vdrap_reg, stack_realign and drap_reg_saved. (add_cfi): Don't allow redefining CFA when DRAP is used. (reg_save): Handle stack alignment. (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack alignment. Don't generate DWARF information for (set fp sp) when DRAP is used. (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg to INVALID_REGNUM. (int_loc_descriptor): Move prototype forward. Also define if DWARF2_UNWIND_INFO is true. (output_cfa_loc): Handle DW_CFA_expression. (build_cfa_aligned_loc): New. (based_loc_descr): Update assert for stack realign. For local variables, use sp+offset when stack is aligned without drap and fp+offset when stack is aligned with drap. For arguments, use cfa+offset when drap is used to align stack. 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_force_align_arg_pointer_string): Break long line. (ix86_gen_andsp): New. (ix86_user_incoming_stack_boundary): Likewise. (ix86_default_incoming_stack_boundary): Likewise. (ix86_incoming_stack_boundary): Likewise. (ix86_can_eliminate): Likewise. (find_drap_reg): Likewise. (ix86_update_stack_boundary): Likewise. (ix86_get_drap_rtx): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): Likewise. (TARGET_GET_DRAP_RTX): Likewise. (override_options): Overide option value for new options. (ix86_function_ok_for_sibcall): Remove check for force_align_arg_pointer. (ix86_handle_cconv_attribute): Likewise. (ix86_function_regparm): Likewise. (setup_incoming_varargs_64): Don't set stack_alignment_needed here. (ix86_va_start): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (ix86_select_alt_pic_regnum): Check DRAP register. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_compute_frame_layout): Compute frame layout wrt stack realignment. (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx. (ix86_expand_prologue): Decide if stack realignment is needed and generate prologue code accordingly. (ix86_expand_epilogue): Generate epilogue code wrt stack realignment is really needed or not. * config/i386/i386.h (MAIN_STACK_BOUNDARY): New. (ABI_STACK_BOUNDARY): Likewise. (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise. (STACK_REALIGN_DEFAULT): Likewise. (INCOMING_STACK_BOUNDARY): Likewise. (MAX_STACK_ALIGNMENT): Likewise. (ix86_incoming_stack_boundary): Likewise. (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed. (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG. (CAN_ELIMINATE): Defined with ix86_can_eliminate. (machine_function): Remove force_align_arg_pointer. * config/i386/i386.md (BX_REG): New. (R13_REG): Likewise. * config/i386/i386.opt (mforce_drap): New. (mincoming-stack-boundary): Likewise. (mstackrealign): Add Init(-1). * config/i386/i386-protos.h (ix86_can_eliminate): New 2008-07-30 H.J. Lu <hongjiu.lu@intel.com> * doc/extend.texi: Update force_align_arg_pointer. * doc/invoke.texi: Document -mincoming-stack-boundary. Update -mstackrealign. * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro. (INCOMING_STACK_BOUNDARY): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): New target hook. (TARGET_GET_DRAP_RTX): Likewise. From-SVN: r138335
2008-07-30 21:20:43 +02:00
@deftypefn {Target Hook} void TARGET_UPDATE_STACK_BOUNDARY (void)
Define this macro to update the current function stack boundary if
necessary.
@end deftypefn
@deftypefn {Target Hook} rtx TARGET_GET_DRAP_RTX (void)
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
This hook should return an rtx for Dynamic Realign Argument Pointer (DRAP) if a
[multiple changes] 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * builtins.c (expand_builtin_setjmp_receiver): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (expand_builtin_apply_args_1): Likewise. (expand_builtin_longjmp): Need DRAP for stack alignment. (expand_builtin_apply): Likewise. * caller-save.c (setup_save_areas): Call assign_stack_local_1 instead of assign_stack_local to allow alignment reduction. * calls.c (emit_call_1): Need DRAP for stack alignment if return pops. (expand_call): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * stmt.c (expand_nl_goto_receiver): Likewise. * cfgexpand.c (get_decl_align_unit): Estimate stack variable alignment and store to stack_alignment_estimated and max_used_stack_slot_alignment. (expand_one_var): Likewise. (expand_stack_alignment): New function. (tree_expand_cfg): Initialize max_used_stack_slot_alignment and stack_alignment_estimated fields in rtl_data. Call expand_stack_alignment at end. * defaults.h (INCOMING_STACK_BOUNDARY): New. (MAX_STACK_ALIGNMENT): Likewise. (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise. (SUPPORTS_STACK_ALIGNMENT): Likewise. * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for stack alignment when generating virtual registers. * function.c (assign_stack_local): Renamed to ... (assign_stack_local_1): This. Add a parameter to indicate if it is OK to reduce alignment. (assign_stack_local): Use it. (instantiate_new_reg): Instantiate virtual incoming args rtx to vDRAP if stack realignment and DRAP is needed. (assign_parms): Collect parameter/return type alignment and contribute to stack_alignment_estimated. (locate_and_pad_parm): Likewise. (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * function.h (rtl_data): Add new field drap_reg, max_used_stack_slot_alignment, stack_alignment_estimated, stack_realign_needed, need_drap, stack_realign_processed and stack_realign_finalized. (stack_realign_fp): New macro. (stack_realign_drap): Likewise. * global.c (compute_regsets): Frame pointer is needed when stack is realigned. Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * reload1.c (update_eliminables): Frame pointer is needed when stack is realigned. (init_elim_table): Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * rtl.h (assign_stack_local_1): Declare new funtion. * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New. (TARGET_GET_DRAP_RTX): Likewise. (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and TARGET_GET_DRAP_RTX. * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx. * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace STACK_BOUNDARY with MAX_STACK_ALIGNMENT. 2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com> H.J. Lu <hongjiu.lu@intel.com> * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg, vdrap_reg, stack_realign and drap_reg_saved. (add_cfi): Don't allow redefining CFA when DRAP is used. (reg_save): Handle stack alignment. (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack alignment. Don't generate DWARF information for (set fp sp) when DRAP is used. (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg to INVALID_REGNUM. (int_loc_descriptor): Move prototype forward. Also define if DWARF2_UNWIND_INFO is true. (output_cfa_loc): Handle DW_CFA_expression. (build_cfa_aligned_loc): New. (based_loc_descr): Update assert for stack realign. For local variables, use sp+offset when stack is aligned without drap and fp+offset when stack is aligned with drap. For arguments, use cfa+offset when drap is used to align stack. 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_force_align_arg_pointer_string): Break long line. (ix86_gen_andsp): New. (ix86_user_incoming_stack_boundary): Likewise. (ix86_default_incoming_stack_boundary): Likewise. (ix86_incoming_stack_boundary): Likewise. (ix86_can_eliminate): Likewise. (find_drap_reg): Likewise. (ix86_update_stack_boundary): Likewise. (ix86_get_drap_rtx): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): Likewise. (TARGET_GET_DRAP_RTX): Likewise. (override_options): Overide option value for new options. (ix86_function_ok_for_sibcall): Remove check for force_align_arg_pointer. (ix86_handle_cconv_attribute): Likewise. (ix86_function_regparm): Likewise. (setup_incoming_varargs_64): Don't set stack_alignment_needed here. (ix86_va_start): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (ix86_select_alt_pic_regnum): Check DRAP register. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_compute_frame_layout): Compute frame layout wrt stack realignment. (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx. (ix86_expand_prologue): Decide if stack realignment is needed and generate prologue code accordingly. (ix86_expand_epilogue): Generate epilogue code wrt stack realignment is really needed or not. * config/i386/i386.h (MAIN_STACK_BOUNDARY): New. (ABI_STACK_BOUNDARY): Likewise. (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise. (STACK_REALIGN_DEFAULT): Likewise. (INCOMING_STACK_BOUNDARY): Likewise. (MAX_STACK_ALIGNMENT): Likewise. (ix86_incoming_stack_boundary): Likewise. (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed. (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG. (CAN_ELIMINATE): Defined with ix86_can_eliminate. (machine_function): Remove force_align_arg_pointer. * config/i386/i386.md (BX_REG): New. (R13_REG): Likewise. * config/i386/i386.opt (mforce_drap): New. (mincoming-stack-boundary): Likewise. (mstackrealign): Add Init(-1). * config/i386/i386-protos.h (ix86_can_eliminate): New 2008-07-30 H.J. Lu <hongjiu.lu@intel.com> * doc/extend.texi: Update force_align_arg_pointer. * doc/invoke.texi: Document -mincoming-stack-boundary. Update -mstackrealign. * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro. (INCOMING_STACK_BOUNDARY): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): New target hook. (TARGET_GET_DRAP_RTX): Likewise. From-SVN: r138335
2008-07-30 21:20:43 +02:00
different argument pointer register is needed to access the function's
tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. * doc/tm.texi (TARGET_INIT_LIBFUNCS): Put @findex entries in order of appearance. (TARGET_LEGITIMATE_ADDRESS_P): Add return type. Fix markup for strict argument. (TARGET_SCHED_REORDER2): Fix argument types. (TARGET_SCHED_DFA_PRE_CYCLE_INSN): Fix return type. (TARGET_SCHED_DFA_POST_CYCLE_INSN): Likewise. (TARGET_SCHED_DFA_PRE_ADVANCE_CYCLE): Fix name. (TARGET_SCHED_DFA_POST_ADVANCE_CYCLE): Likewise. (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Add argument name. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Remove duplicate documentation. (TARGET_SCHED_INIT_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Likewise. (TARGET_SCHED_CLEAR_SCHED_CONTEXT): Likewise. (TARGET_SCHED_FREE_SCHED_CONTEXT): Likewise. (TARGET_SCHED_SET_SCHED_CONTEXT): Fix typo. (TARGET_SCHED_GEN_SPEC_CHECK): Fix name. (TARGET_ASM_RELOC_RW_MASK): Add return type. (TARGET_MANGLE_DECL_ASSEMBLER_NAME): Fix return type. (TARGET_STRIP_NAME_ENCODING): Fix markup of return type and parameter. (TARGET_ASM_FILE_START): Put @findex before paragraph start. Use prototype. (TARGET_ASM_NAMED_SECTION): Fix argument list. (TARGET_HAVE_NAMED_SECTIONS): Use @deftypevr. (TARGET_HAVE_SWITCHABLE_BSS_SECTIONS): Likewise. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Use @deftypevr. (TARGET_ASM_ASSEMBLE_VISIBILITY): Fix argument types. (TARGET_ASM_MARK_DECL_PRESERVED): Fix argument and markup referring to it. Fix language. (TARGET_HAVE_CTORS_DTORS): Use @deftypevr. (TARGET_ASM_FINAL_POSTSCAN_INSN): Adjust name of first argument. (TARGET_ASM_EMIT_UNWIND_LABEL): Add argument types. (TARGET_ASM_EMIT_EXCEPT_TABLE_LABEL): Add type to argument. (TARGET_UNWIND_EMIT): Remove space between 'FILE *' and '@var{stream}. Remove stray 'and'. (TARGET_ARM_EABI_UNWINDER): Use @deftypevr. (TARGET_ASM_OUTPUT_DWARF_DTPREL): Adjust name of first argument. (TARGET_SET_DEFAULT_TYPE_ATTRIBUTES): Add missing article. (TARGET_OPTION_VALID_ATTRIBUTE_P): Fix name, it was misspelled as TARGET_VALID_OPTION_ATTRIBUTE_P. (TARGET_GET_PCH_VALIDITY): Put 'void *' in braces. Fix description of return value. Rename argument "sz" to "len." (TARGET_CXX_GUARD_MASK_BIT): Add missing article. Clarify meaning of 'true' return value. (TARGET_SHIFT_TRUNCATION_MASK): Fix return type. (TARGET_MODE_REP_EXTENDED): Fix two inconsisent uses of rep_mode versus mode_rep. (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Document. (TARGET_BUILTIN_DECL): Fix name. (TARGET_COMMUTATIVE_P): Fix type of first argument. (TARGET_SET_CURRENT_FUNCTION): Mention possibility of cfun being NULL. (TARGET_BRANCH_TARGET_REGISTER_CLASS): Fix return type. (TARGET_USE_LOCAL_THUNK_ALIAS_P): Document as macro instead of hook. (TARGET_RELAXED_ORDERING): Use @deftypevr. (TARGET_GET_DRAP_RTX): Note that this is a hook. Clarify language. From-SVN: r155972
2010-01-17 09:04:52 +01:00
argument list due to stack realignment. Return @code{NULL} if no DRAP
is needed.
[multiple changes] 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * builtins.c (expand_builtin_setjmp_receiver): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (expand_builtin_apply_args_1): Likewise. (expand_builtin_longjmp): Need DRAP for stack alignment. (expand_builtin_apply): Likewise. * caller-save.c (setup_save_areas): Call assign_stack_local_1 instead of assign_stack_local to allow alignment reduction. * calls.c (emit_call_1): Need DRAP for stack alignment if return pops. (expand_call): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * stmt.c (expand_nl_goto_receiver): Likewise. * cfgexpand.c (get_decl_align_unit): Estimate stack variable alignment and store to stack_alignment_estimated and max_used_stack_slot_alignment. (expand_one_var): Likewise. (expand_stack_alignment): New function. (tree_expand_cfg): Initialize max_used_stack_slot_alignment and stack_alignment_estimated fields in rtl_data. Call expand_stack_alignment at end. * defaults.h (INCOMING_STACK_BOUNDARY): New. (MAX_STACK_ALIGNMENT): Likewise. (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise. (SUPPORTS_STACK_ALIGNMENT): Likewise. * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for stack alignment when generating virtual registers. * function.c (assign_stack_local): Renamed to ... (assign_stack_local_1): This. Add a parameter to indicate if it is OK to reduce alignment. (assign_stack_local): Use it. (instantiate_new_reg): Instantiate virtual incoming args rtx to vDRAP if stack realignment and DRAP is needed. (assign_parms): Collect parameter/return type alignment and contribute to stack_alignment_estimated. (locate_and_pad_parm): Likewise. (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. * function.h (rtl_data): Add new field drap_reg, max_used_stack_slot_alignment, stack_alignment_estimated, stack_realign_needed, need_drap, stack_realign_processed and stack_realign_finalized. (stack_realign_fp): New macro. (stack_realign_drap): Likewise. * global.c (compute_regsets): Frame pointer is needed when stack is realigned. Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * reload1.c (update_eliminables): Frame pointer is needed when stack is realigned. (init_elim_table): Can eliminate frame pointer when stack is realigned and dynamic realigned argument pointer isn't used. * rtl.h (assign_stack_local_1): Declare new funtion. * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New. (TARGET_GET_DRAP_RTX): Likewise. (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and TARGET_GET_DRAP_RTX. * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx. * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace STACK_BOUNDARY with MAX_STACK_ALIGNMENT. 2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com> H.J. Lu <hongjiu.lu@intel.com> * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg, vdrap_reg, stack_realign and drap_reg_saved. (add_cfi): Don't allow redefining CFA when DRAP is used. (reg_save): Handle stack alignment. (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack alignment. Don't generate DWARF information for (set fp sp) when DRAP is used. (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg to INVALID_REGNUM. (int_loc_descriptor): Move prototype forward. Also define if DWARF2_UNWIND_INFO is true. (output_cfa_loc): Handle DW_CFA_expression. (build_cfa_aligned_loc): New. (based_loc_descr): Update assert for stack realign. For local variables, use sp+offset when stack is aligned without drap and fp+offset when stack is aligned with drap. For arguments, use cfa+offset when drap is used to align stack. 2008-07-30 Joey Ye <joey.ye@intel.com> H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.c (ix86_force_align_arg_pointer_string): Break long line. (ix86_gen_andsp): New. (ix86_user_incoming_stack_boundary): Likewise. (ix86_default_incoming_stack_boundary): Likewise. (ix86_incoming_stack_boundary): Likewise. (ix86_can_eliminate): Likewise. (find_drap_reg): Likewise. (ix86_update_stack_boundary): Likewise. (ix86_get_drap_rtx): Likewise. (ix86_finalize_stack_realign_flags): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): Likewise. (TARGET_GET_DRAP_RTX): Likewise. (override_options): Overide option value for new options. (ix86_function_ok_for_sibcall): Remove check for force_align_arg_pointer. (ix86_handle_cconv_attribute): Likewise. (ix86_function_regparm): Likewise. (setup_incoming_varargs_64): Don't set stack_alignment_needed here. (ix86_va_start): Replace virtual_incoming_args_rtx with crtl->args.internal_arg_pointer. (ix86_select_alt_pic_regnum): Check DRAP register. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_compute_frame_layout): Compute frame layout wrt stack realignment. (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx. (ix86_expand_prologue): Decide if stack realignment is needed and generate prologue code accordingly. (ix86_expand_epilogue): Generate epilogue code wrt stack realignment is really needed or not. * config/i386/i386.h (MAIN_STACK_BOUNDARY): New. (ABI_STACK_BOUNDARY): Likewise. (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise. (STACK_REALIGN_DEFAULT): Likewise. (INCOMING_STACK_BOUNDARY): Likewise. (MAX_STACK_ALIGNMENT): Likewise. (ix86_incoming_stack_boundary): Likewise. (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed. (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG. (CAN_ELIMINATE): Defined with ix86_can_eliminate. (machine_function): Remove force_align_arg_pointer. * config/i386/i386.md (BX_REG): New. (R13_REG): Likewise. * config/i386/i386.opt (mforce_drap): New. (mincoming-stack-boundary): Likewise. (mstackrealign): Add Init(-1). * config/i386/i386-protos.h (ix86_can_eliminate): New 2008-07-30 H.J. Lu <hongjiu.lu@intel.com> * doc/extend.texi: Update force_align_arg_pointer. * doc/invoke.texi: Document -mincoming-stack-boundary. Update -mstackrealign. * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro. (INCOMING_STACK_BOUNDARY): Likewise. (TARGET_UPDATE_STACK_BOUNDARY): New target hook. (TARGET_GET_DRAP_RTX): Likewise. From-SVN: r138335
2008-07-30 21:20:43 +02:00
@end deftypefn
tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Fix argument types. (TARGET_SUPPORT_VECTOR_MISALIGNMENT): Fix argument types. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): Fix argument types. (TARGET_SCHED_ALLOC_SCHED_CONTEXT): Put 'void *' in braces. (TARGET_IN_SMALL_DATA_P): Fix argument type. (TARGET_BINDS_LOCAL_P): Fix argument type. (TARGET_ASM_FILE_END): Use prototype. (TARGET_ASM_RECORD_GCC_SWITCHES): Don't put 'int' in braces. (TARGET_DWARF_CALLING_CONVENTION): Fix argument type. (TARGET_COMP_TYPE_ATTRIBUTES): Fix argument types. (TARGET_VALID_DLLIMPORT_ATTRIBUTE_P): Fix argument type. (TARGET_EMUTLS_VAR_ALIGN_FIXED): Don't put 'bool' in braces. (TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS): Likewise. (TARGET_PCH_VALID_P): Put 'const char *' in braces. (TARGET_CHECK_PCH_TARGET_FLAGS): Likewise. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Don't put 'bool' in braces. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Don't put 'rtx' in braces. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_CASE_VALUES_THRESHOLD): Put 'unsigned int' in braces. (TARGET_MACHINE_DEPENDENT_REORG: Use prototype. (TARGET_INIT_BUILTINS): Use prototype. (TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN): Put 'const char *' in braces. Fix parameter types. (TARGET_INVALID_CONVERSION): Fix parameter types. (TARGET_INVALID_UNARY_OP, TARGET_INVALID_BINARY_OP): Likewise. (TARGET_INVALID_PARAMETER_TYPE, TARGET_INVALID_RETURN_TYPE): Likewise. (TARGET_PROMOTED_TYPE): Remove braces around 'tree'. Fix argument type. (TARGET_CONVERT_TO_TYPE): Remove braces around 'tree'. (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): Remove braces around 'bool'. From-SVN: r155957
2010-01-16 03:39:40 +01:00
@deftypefn {Target Hook} bool TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
When optimization is disabled, this hook indicates whether or not
arguments should be allocated to stack slots. Normally, GCC allocates
stacks slots for arguments when not optimizing in order to make
debugging easier. However, when a function is declared with
@code{__attribute__((naked))}, there is no stack frame, and the compiler
cannot safely move arguments from the registers in which they are passed
to the stack. Therefore, this hook should return true in general, but
false for naked functions. The default implementation always returns true.
@end deftypefn
@deftypevr {Target Hook} {unsigned HOST_WIDE_INT} TARGET_CONST_ANCHOR
On some architectures it can take multiple instructions to synthesize
a constant. If there is another constant already in a register that
is close enough in value then it is preferable that the new constant
is computed from this register using immediate addition or
subtraction. We accomplish this through CSE. Besides the value of
the constant we also add a lower and an upper constant anchor to the
available expressions. These are then queried when encountering new
constants. The anchors are computed by rounding the constant up and
down to a multiple of the value of @code{TARGET_CONST_ANCHOR}.
@code{TARGET_CONST_ANCHOR} should be the maximum positive value
accepted by immediate-add plus one. We currently assume that the
value of @code{TARGET_CONST_ANCHOR} is a power of 2. For example, on
MIPS, where add-immediate takes a 16-bit signed value,
@code{TARGET_CONST_ANCHOR} is set to @samp{0x8000}. The default value
is zero, which disables this optimization.
@end deftypevr
@deftypefn {Target Hook} {unsigned HOST_WIDE_INT} TARGET_ASAN_SHADOW_OFFSET (void)
Return the offset bitwise ored into shifted address to get corresponding
Address Sanitizer shadow memory address. NULL if Address Sanitizer is not
supported by the target.
@end deftypefn
ChangeLog entry: * coretypes (MEMMODEL_MASK): New. * builtins.c (get_memmodel): Add val. Call target.memmodel_check and return new variable. (expand_builtin_atomic_exchange): Mask memmodel values. (expand_builtin_atomic_compare_exchange): Ditto. (expand_builtin_atomic_load): Ditto. (expand_builtin_atomic_store): Ditto. (expand_builtin_atomic_clear): Ditto. * doc/extend.texi: Mention port-dependent memory model flags. * config/i386/cpuid.h (bit_HLE): New. * config/i386/driver-i386.c (host_detect_local_cpu): Detect HLE support. * config/i386/i386-protos.h (ix86_generate_hle_prefix): New. * config/i386/i386-c.c (ix86_target_macros_internal): Set HLE defines. (ix86_target_string)<-mhle>: New. (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto. * config/i386/i386.c (ix86_target_string)<OPTION_MASK_ISA_HLE>: New. (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto. (ix86_option_override_internal)<PTA_HLE>: New switch, set it enabled for generic, generic64 and core-avx2. (ix86_print_operand): Generate HLE lock prefixes. (ix86_memmodel_check): New. (TARGET_MEMMODEL_CHECK): Ditto. * config/i386/i386.h (OPTION_ISA_HLE): Ditto. (IX86_HLE_ACQUIRE): Ditto. (IX86_HLE_RELEASE): Ditto. * config/i386/i386.h (ix86_generate_hle_prefix): Ditto. * config/i386/i386.opt (mhle): Ditto. * config/i386/sync.md(atomic_compare_and_swap<mode>): Pass success model to instruction emitter. (atomic_fetch_add<mode>): Ditto. (atomic_exchange<mode>): Ditto. (atomic_add<mode>): Ditto. (atomic_sub<mode>): Ditto. (atomic_<code><mode>): Ditto. (*atomic_compare_and_swap_doubledi_pic): Ditto. (atomic_compare_and_swap_single<mode>): Define and use argument for success model. (atomic_compare_and_swap_double<mode>): Ditto. * configure.ac: Check if assembler support HLE prefixes. * configure: Regenerate. * config.in: Ditto. testsuite/ChangeLog entry: * gcc.target/i386/hle-cmpxchg-acq-1.c: New. * gcc.target/i386/hle-cmpxchg-rel-1.c: Ditto. * gcc.target/i386/hle-add-acq-1.c: Ditto. * gcc.target/i386/hle-add-rel-1.c: Ditto. * gcc.target/i386/hle-and-acq-1.c: Ditto. * gcc.target/i386/hle-and-rel-1.c: Ditto. * gcc.target/i386/hle-or-acq-1.c: Ditto. * gcc.target/i386/hle-or-rel-1.c: Ditto. * gcc.target/i386/hle-sub-acq-1.c: Ditto. * gcc.target/i386/hle-sub-rel-1.c: Ditto. * gcc.target/i386/hle-xadd-acq-1.c: Ditto. * gcc.target/i386/hle-xadd-rel-1.c: Ditto. * gcc.target/i386/hle-xchg-acq-1.c: Ditto. * gcc.target/i386/hle-xchg-rel-1.c: Ditto. * gcc.target/i386/hle-xor-acq-1.c: Ditto. * gcc.target/i386/hle-xor-rel-1.c: Ditto. Co-Authored-By: Andi Kleen <ak@linux.intel.com> From-SVN: r187051
2012-05-02 17:32:01 +02:00
@deftypefn {Target Hook} {unsigned HOST_WIDE_INT} TARGET_MEMMODEL_CHECK (unsigned HOST_WIDE_INT @var{val})
Validate target specific memory model mask bits. When NULL no target specific
memory model bits are allowed.
@end deftypefn
@deftypevr {Target Hook} {unsigned char} TARGET_ATOMIC_TEST_AND_SET_TRUEVAL
This value should be set if the result written by @code{atomic_test_and_set} is not exactly 1, i.e. the @code{bool} @code{true}.
@end deftypevr
@deftypefn {Target Hook} bool TARGET_HAS_IFUNC_P (void)
It returns true if the target supports GNU indirect functions.
The support includes the assembler, linker and dynamic linker.
The default value of this hook is based on target's libc.
@end deftypefn
tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC. gcc: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> Joseph Myers <joseph@codesourcery.com> * tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC. (enum tree_index): Add TI_ATOMICQI_TYPE, TI_ATOMICHI_TYPE, TI_ATOMICSI_TYPE, TI_ATOMICDI_TYPE and TI_ATOMICTI_TYPE. (struct tree_base): Add atomic_flag field. * tree.h (TYPE_ATOMIC): New accessor macro. (TYPE_QUALS, TYPE_QUALS_NO_ADDR_SPACE): Add TYPE_QUAL_ATOMIC. (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): New macro. (atomicQI_type_node, atomicHI_type_node, atomicSI_type_node) (atomicDI_type_node, atomicTI_type_node): New macros for type nodes. * tree.c (set_type_quals): Set TYPE_ATOMIC. (find_atomic_core_type): New function. (build_qualified_type): Adjust alignment for qualified types. (build_atomic_base): New function (build_common_tree_nodes): Build atomicQI_type_node, atomicHI_type_node, atomicSI_type_node, atomicDI_type_node and atomicTI_type_node. * print-tree.c (print_node): Print atomic qualifier. * tree-pretty-print.c (dump_generic_node): Print atomic type attribute. * target.def (atomic_assign_expand_fenv): New hook. * doc/tm.texi.in (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New @hook. * doc/tm.texi: Regenerate. * targhooks.c (default_atomic_assign_expand_fenv): New function. * targhooks.h (default_atomic_assign_expand_fenv): Declare. * sync-builtins.def (__atomic_feraiseexcept): New built-in function. * config/i386/i386-builtin-types.def (VOID_FTYPE_PUSHORT): New function type. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_FNSTENV, IX86_BUILTIN_FLDENV, IX86_BUILTIN_FNSTSW and IX86_BUILTIN_FNCLEX. (bdesc_special_args): Add __builtin_ia32_fnstenv, __builtin_ia32_fldenv, __builtin_ia32_fnstsw and __builtin_ia32_fnclex. (ix86_expand_builtin): Handle the new built-in functions. (ix86_atomic_assign_expand_fenv): New function. (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New macro. * config/i386/i386.md (UNSPECV_FNSTENV, UNSPECV_FLDENV) (UNSPECV_FNSTSW, UNSPECV_FNCLEX): New unspecs. (fnstenv, fldenv, fnstsw, fnclex): New insns. gcc/c-family: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> Joseph Myers <joseph@codesourcery.com> * c-common.h (enum rid): Add RID_ATOMIC. * c-common.c (c_common_reswords): Add _Atomic. (sync_resolve_params): Use TYPE_MAIN_VARIANT on pointer argument. (keyword_is_type_qualifier): Accept RID_ATOMIC. * c-format.c (check_format_types): Check for extra _Atomic qualifiers in format argument. * c-pretty-print.c (pp_c_cv_qualifiers): Handle atomic qualifier. (pp_c_type_qualifier_list): Mention _Atomic in comment. gcc/c: 2013-11-05 Joseph Myers <joseph@codesourcery.com> Andrew MacLeod <amacleod@redhat.com> * c-aux-info.c (gen_type): Handle atomic qualifier. * c-decl.c (validate_proto_after_old_defn): Do not remove atomic qualifiers when compating types. (shadow_tag_warned): Handle atomic_p in declspecs. (quals_from_declspecs): Likewise. (start_decl): Use c_type_promotes_to when promoting argument types. (grokdeclarator): Handle _Atomic. (get_parm_info): Diagnose any qualifier on "void" as only parameter. (store_parm_decls_oldstyle): Do not remove atomic qualifiers when comparing types. Use c_type_promotes_to when promoting argument types. (finish_function): Use c_type_promotes_to when promoting argument types. (build_null_declspecs): Handle atomic_p in declspecs. (declspecs_add_qual): Handle RID_ATOMIC. * c-parser.c (c_token_starts_typename, c_token_is_qualifier) (c_token_starts_declspecs): Handle RID_ATOMIC. (c_parser_declspecs): Handle atomic type specifiers and qualifiers. (c_parser_typeof_specifier): Remove const and _Atomic qualifiers from types of expressions with atomic type. (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue. (c_parser_attribute_any_word): Handle RID_ATOMIC. (c_parser_initializer, c_parser_initelt, c_parser_initval) (c_parser_statement_after_labels, c_parser_switch_statement) (c_parser_for_statement, c_parser_expr_no_commas) (c_parser_conditional_expression, c_parser_binary_expression) (c_parser_cast_expression, c_parser_unary_expression) (c_parser_postfix_expression) (c_parser_postfix_expression_after_primary, c_parser_expression): Use convert_lvalue_to_rvalue. (c_parser_expression_conv, c_parser_expr_list): Document conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue. (c_parser_objc_synchronized_statement): Use convert_lvalue_to_rvalue. (c_parser_objc_selector): Handle RID_ATOMIC. (c_parser_objc_receiver, c_parser_array_notation): Use convert_lvalue_to_rvalue. * c-tree.h (ctsk_typeof): Adjust comment to mention use for _Atomic (type-name). (struct c_declspecs): Add atomic_p field. (convert_lvalue_to_rvalue): Declare. * c-typeck.c (c_type_promotes_to): Promote atomic types to corresponding atomic types. (qualify_type): Don't add _Atomic qualifiers from second argument. (comp_target_types): Do not allow _Atomic mismatches. (type_lists_compatible_p): Do not remove atomic qualifiers when comparing types. (really_atomic_lvalue, convert_lvalue_to_rvalue) (build_atomic_assign): New functions. (build_unary_op): Use build_atomic_assign for atomic increment and decrement. (build_conditional_expr): Do not treat _Atomic void as a qualified version of void. (build_modify_expr): Use build_atomic_assign for atomic LHS. (find_anonymous_field_with_type, convert_to_anonymous_field) (convert_for_assignment): Do not remove atomic qualifiers when comparing types. (digest_init): Do not accept initialization of arrays of atomic elements by string constants. (build_asm_expr): Use convert_lvalue_to_rvalue. (build_binary_op): Do not treat _Atomic void as a qualified version of void. gcc/objc: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> * objc-act.c (objc_push_parm): Handle atomic qualifier. gcc/testsuite: 2013-11-05 Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp (check_effective_target_fenv_exceptions): New function. * lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files. * gcc.dg/atomic/c11-atomic-exec-1.c, gcc.dg/atomic/c11-atomic-exec-2.c, gcc.dg/atomic/c11-atomic-exec-3.c, gcc.dg/atomic/c11-atomic-exec-4.c, gcc.dg/atomic/c11-atomic-exec-5.c, gcc.dg/c11-atomic-1.c, gcc.dg/c11-atomic-2.c, gcc.dg/c11-atomic-3.c, gcc.dg/c90-atomic-1.c, gcc.dg/c99-atomic-1.c: New tests. libatomic: 2013-11-05 Joseph Myers <joseph@codesourcery.com> * fenv.c: New file. * libatomic.map (LIBATOMIC_1.1): New symbol version. Include __atomic_feraiseexcept. * configure.ac (libtool_VERSION): Change to 2:0:1. (fenv.h): Test for header. * Makefile.am (libatomic_la_SOURCES): Add fenv.c. * Makefile.in, auto-config.h.in, configure: Regenerate. From-SVN: r204544
2013-11-07 22:15:25 +01:00
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
@deftypefn {Target Hook} {unsigned int} TARGET_ATOMIC_ALIGN_FOR_MODE (machine_mode @var{mode})
If defined, this function returns an appropriate alignment in bits for an atomic object of machine_mode @var{mode}. If 0 is returned then the default alignment for the specified mode is used.
@end deftypefn
tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC. gcc: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> Joseph Myers <joseph@codesourcery.com> * tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC. (enum tree_index): Add TI_ATOMICQI_TYPE, TI_ATOMICHI_TYPE, TI_ATOMICSI_TYPE, TI_ATOMICDI_TYPE and TI_ATOMICTI_TYPE. (struct tree_base): Add atomic_flag field. * tree.h (TYPE_ATOMIC): New accessor macro. (TYPE_QUALS, TYPE_QUALS_NO_ADDR_SPACE): Add TYPE_QUAL_ATOMIC. (TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): New macro. (atomicQI_type_node, atomicHI_type_node, atomicSI_type_node) (atomicDI_type_node, atomicTI_type_node): New macros for type nodes. * tree.c (set_type_quals): Set TYPE_ATOMIC. (find_atomic_core_type): New function. (build_qualified_type): Adjust alignment for qualified types. (build_atomic_base): New function (build_common_tree_nodes): Build atomicQI_type_node, atomicHI_type_node, atomicSI_type_node, atomicDI_type_node and atomicTI_type_node. * print-tree.c (print_node): Print atomic qualifier. * tree-pretty-print.c (dump_generic_node): Print atomic type attribute. * target.def (atomic_assign_expand_fenv): New hook. * doc/tm.texi.in (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New @hook. * doc/tm.texi: Regenerate. * targhooks.c (default_atomic_assign_expand_fenv): New function. * targhooks.h (default_atomic_assign_expand_fenv): Declare. * sync-builtins.def (__atomic_feraiseexcept): New built-in function. * config/i386/i386-builtin-types.def (VOID_FTYPE_PUSHORT): New function type. * config/i386/i386.c (enum ix86_builtins): Add IX86_BUILTIN_FNSTENV, IX86_BUILTIN_FLDENV, IX86_BUILTIN_FNSTSW and IX86_BUILTIN_FNCLEX. (bdesc_special_args): Add __builtin_ia32_fnstenv, __builtin_ia32_fldenv, __builtin_ia32_fnstsw and __builtin_ia32_fnclex. (ix86_expand_builtin): Handle the new built-in functions. (ix86_atomic_assign_expand_fenv): New function. (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New macro. * config/i386/i386.md (UNSPECV_FNSTENV, UNSPECV_FLDENV) (UNSPECV_FNSTSW, UNSPECV_FNCLEX): New unspecs. (fnstenv, fldenv, fnstsw, fnclex): New insns. gcc/c-family: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> Joseph Myers <joseph@codesourcery.com> * c-common.h (enum rid): Add RID_ATOMIC. * c-common.c (c_common_reswords): Add _Atomic. (sync_resolve_params): Use TYPE_MAIN_VARIANT on pointer argument. (keyword_is_type_qualifier): Accept RID_ATOMIC. * c-format.c (check_format_types): Check for extra _Atomic qualifiers in format argument. * c-pretty-print.c (pp_c_cv_qualifiers): Handle atomic qualifier. (pp_c_type_qualifier_list): Mention _Atomic in comment. gcc/c: 2013-11-05 Joseph Myers <joseph@codesourcery.com> Andrew MacLeod <amacleod@redhat.com> * c-aux-info.c (gen_type): Handle atomic qualifier. * c-decl.c (validate_proto_after_old_defn): Do not remove atomic qualifiers when compating types. (shadow_tag_warned): Handle atomic_p in declspecs. (quals_from_declspecs): Likewise. (start_decl): Use c_type_promotes_to when promoting argument types. (grokdeclarator): Handle _Atomic. (get_parm_info): Diagnose any qualifier on "void" as only parameter. (store_parm_decls_oldstyle): Do not remove atomic qualifiers when comparing types. Use c_type_promotes_to when promoting argument types. (finish_function): Use c_type_promotes_to when promoting argument types. (build_null_declspecs): Handle atomic_p in declspecs. (declspecs_add_qual): Handle RID_ATOMIC. * c-parser.c (c_token_starts_typename, c_token_is_qualifier) (c_token_starts_declspecs): Handle RID_ATOMIC. (c_parser_declspecs): Handle atomic type specifiers and qualifiers. (c_parser_typeof_specifier): Remove const and _Atomic qualifiers from types of expressions with atomic type. (c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue. (c_parser_attribute_any_word): Handle RID_ATOMIC. (c_parser_initializer, c_parser_initelt, c_parser_initval) (c_parser_statement_after_labels, c_parser_switch_statement) (c_parser_for_statement, c_parser_expr_no_commas) (c_parser_conditional_expression, c_parser_binary_expression) (c_parser_cast_expression, c_parser_unary_expression) (c_parser_postfix_expression) (c_parser_postfix_expression_after_primary, c_parser_expression): Use convert_lvalue_to_rvalue. (c_parser_expression_conv, c_parser_expr_list): Document conversion of lvalues to rvalues. Use convert_lvalue_to_rvalue. (c_parser_objc_synchronized_statement): Use convert_lvalue_to_rvalue. (c_parser_objc_selector): Handle RID_ATOMIC. (c_parser_objc_receiver, c_parser_array_notation): Use convert_lvalue_to_rvalue. * c-tree.h (ctsk_typeof): Adjust comment to mention use for _Atomic (type-name). (struct c_declspecs): Add atomic_p field. (convert_lvalue_to_rvalue): Declare. * c-typeck.c (c_type_promotes_to): Promote atomic types to corresponding atomic types. (qualify_type): Don't add _Atomic qualifiers from second argument. (comp_target_types): Do not allow _Atomic mismatches. (type_lists_compatible_p): Do not remove atomic qualifiers when comparing types. (really_atomic_lvalue, convert_lvalue_to_rvalue) (build_atomic_assign): New functions. (build_unary_op): Use build_atomic_assign for atomic increment and decrement. (build_conditional_expr): Do not treat _Atomic void as a qualified version of void. (build_modify_expr): Use build_atomic_assign for atomic LHS. (find_anonymous_field_with_type, convert_to_anonymous_field) (convert_for_assignment): Do not remove atomic qualifiers when comparing types. (digest_init): Do not accept initialization of arrays of atomic elements by string constants. (build_asm_expr): Use convert_lvalue_to_rvalue. (build_binary_op): Do not treat _Atomic void as a qualified version of void. gcc/objc: 2013-11-05 Andrew MacLeod <amacleod@redhat.com> * objc-act.c (objc_push_parm): Handle atomic qualifier. gcc/testsuite: 2013-11-05 Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp (check_effective_target_fenv_exceptions): New function. * lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files. * gcc.dg/atomic/c11-atomic-exec-1.c, gcc.dg/atomic/c11-atomic-exec-2.c, gcc.dg/atomic/c11-atomic-exec-3.c, gcc.dg/atomic/c11-atomic-exec-4.c, gcc.dg/atomic/c11-atomic-exec-5.c, gcc.dg/c11-atomic-1.c, gcc.dg/c11-atomic-2.c, gcc.dg/c11-atomic-3.c, gcc.dg/c90-atomic-1.c, gcc.dg/c99-atomic-1.c: New tests. libatomic: 2013-11-05 Joseph Myers <joseph@codesourcery.com> * fenv.c: New file. * libatomic.map (LIBATOMIC_1.1): New symbol version. Include __atomic_feraiseexcept. * configure.ac (libtool_VERSION): Change to 2:0:1. (fenv.h): Test for header. * Makefile.am (libatomic_la_SOURCES): Add fenv.c. * Makefile.in, auto-config.h.in, configure: Regenerate. From-SVN: r204544
2013-11-07 22:15:25 +01:00
@deftypefn {Target Hook} void TARGET_ATOMIC_ASSIGN_EXPAND_FENV (tree *@var{hold}, tree *@var{clear}, tree *@var{update})
ISO C11 requires atomic compound assignments that may raise floating-point exceptions to raise exceptions corresponding to the arithmetic operation whose result was successfully stored in a compare-and-exchange sequence. This requires code equivalent to calls to @code{feholdexcept}, @code{feclearexcept} and @code{feupdateenv} to be generated at appropriate points in the compare-and-exchange sequence. This hook should set @code{*@var{hold}} to an expression equivalent to the call to @code{feholdexcept}, @code{*@var{clear}} to an expression equivalent to the call to @code{feclearexcept} and @code{*@var{update}} to an expression equivalent to the call to @code{feupdateenv}. The three expressions are @code{NULL_TREE} on entry to the hook and may be left as @code{NULL_TREE} if no code is required in a particular place. The default implementation leaves all three expressions as @code{NULL_TREE}. The @code{__atomic_feraiseexcept} function from @code{libatomic} may be of use as part of the code generated in @code{*@var{update}}.
@end deftypefn
2014-05-06 18:25:05 +02:00
@defmac TARGET_SUPPORTS_WIDE_INT
On older ports, large integers are stored in @code{CONST_DOUBLE} rtl
objects. Newer ports define @code{TARGET_SUPPORTS_WIDE_INT} to be nonzero
to indicate that large integers are stored in
@code{CONST_WIDE_INT} rtl objects. The @code{CONST_WIDE_INT} allows
very large integer constants to be represented. @code{CONST_DOUBLE}
is limited to twice the size of the host's @code{HOST_WIDE_INT}
representation.
Converting a port mostly requires looking for the places where
@code{CONST_DOUBLE}s are used with @code{VOIDmode} and replacing that
code with code that accesses @code{CONST_WIDE_INT}s. @samp{"grep -i
const_double"} at the port level gets you to 95% of the changes that
need to be made. There are a few places that require a deeper look.
@itemize @bullet
@item
There is no equivalent to @code{hval} and @code{lval} for
@code{CONST_WIDE_INT}s. This would be difficult to express in the md
language since there are a variable number of elements.
Most ports only check that @code{hval} is either 0 or -1 to see if the
value is small. As mentioned above, this will no longer be necessary
since small constants are always @code{CONST_INT}. Of course there
are still a few exceptions, the alpha's constraint used by the zap
instruction certainly requires careful examination by C code.
However, all the current code does is pass the hval and lval to C
code, so evolving the c code to look at the @code{CONST_WIDE_INT} is
not really a large change.
@item
Because there is no standard template that ports use to materialize
constants, there is likely to be some futzing that is unique to each
port in this code.
@item
The rtx costs may have to be adjusted to properly account for larger
constants that are represented as @code{CONST_WIDE_INT}.
@end itemize
All and all it does not take long to convert ports that the
maintainer is familiar with.
@end defmac