This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Poison some old target macros


Joseph S. Myers wrote:-

> On Sun, 14 Oct 2001, Neil Booth wrote:
> 
> > 	* system.h: Poison old unused target macros.
> 
> You ought to get rid of any existing uses at the same time, including
> commented out ones (some of which exist in stormy16.h - which I pointed
> out in <URL:http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01448.html> but
> they are still there).

Ugh, I don't want to get in the business of fixing incorrect or out of
date comments; that could go on for ever.

Anyway, I've done what I could see with a simple grep.  If there are
any remaining, tough.

OK to commit?

Neil.

	* system.h: Poison old unused target macros.
	* config/dsp16xx.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove.
	* config/stormy16/stormy16.c: Update references to obsolete macros.
	* config/stormy16/stormy16.h: Similarly.
	* config/stormy16/stormy16.md: Similarly.
	* config/cris/cris.h: Similarly.

============================================================
Index: gcc/system.h
*** system.h	2001/10/09 14:03:12	1.104
--- gcc/system.h	2001/10/14 18:46:56
*************** typedef union tree_node *tree;
*** 584,589 ****
--- 584,599 ----
  #undef calloc
  #undef strdup
   #pragma GCC poison malloc realloc calloc strdup
+ 
+ /* Old target macros that have moved to the target hooks structure.  */
+  #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN			\
+ 	FUNCTION_PROLOGUE FUNCTION_EPILOGUE				\
+ 	FUNCTION_END_PROLOGUE FUNCTION_BEGIN_EPILOGUE			\
+ 	DECL_MACHINE_ATTRIBUTES COMP_TYPE_ATTRIBUTES INSERT_ATTRIBUTES	\
+ 	VALID_MACHINE_DECL_ATTRIBUTE VALID_MACHINE_TYPE_ATTRIBUTE	\
+ 	SET_DEFAULT_TYPE_ATTRIBUTES SET_DEFAULT_DECL_ATTRIBUTES		\
+ 	MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES	\
+ 	MD_INIT_BUILTINS MD_EXPAND_BUILTIN
  #endif /* IN_GCC */
  
  /* Note: not all uses of the `index' token (e.g. variable names and
============================================================
Index: gcc/config/cris/cris.h
*** cris.h	2001/10/12 19:44:38	1.2
--- gcc/config/cris/cris.h	2001/10/14 18:47:06
*************** extern int target_flags;
*** 509,516 ****
     Old comment: (2.1: still valid in 2.7.2?)
      Note that to make this macro affect the alignment of stack
     locals, a fix was required, and special precautions when handling
!    the stack pointer in various other macros (FUNCTION_PROLOGUE et al)
!    were required.  See file "function.c".  If you would just define
     this macro, it would only affect the builtin alloca and variable
     local data (non-ANSI, non-K&R, Gnu C extension).  */
  #define STACK_BOUNDARY \
--- 509,516 ----
     Old comment: (2.1: still valid in 2.7.2?)
      Note that to make this macro affect the alignment of stack
     locals, a fix was required, and special precautions when handling
!    the stack pointer in various other macros (TARGET_ASM_FUNCTION_PROLOGUE
!    et al) were required.  See file "function.c".  If you would just define
     this macro, it would only affect the builtin alloca and variable
     local data (non-ANSI, non-K&R, Gnu C extension).  */
  #define STACK_BOUNDARY \
============================================================
Index: gcc/config/dsp16xx/dsp16xx.h
*** dsp16xx.h	2001/10/14 02:14:28	1.27
--- gcc/config/dsp16xx/dsp16xx.h	2001/10/14 18:47:27
*************** const_section ()                        
*** 1736,1745 ****
      (OUTPUT) = (char *) alloca (strlen (NAME) + 11);			\
      ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO);		\
    } while (0)
- 
- #define ASM_OPEN_PAREN "("
- #define ASM_CLOSE_PAREN ")"
- 
  
  /* OUTPUT OF UNINITIALIZED VARIABLES */
  
--- 1736,1741 ----
============================================================
Index: gcc/config/stormy16/stormy16.c
*** stormy16.c	2001/09/21 01:27:06	1.4
--- gcc/config/stormy16/stormy16.c	2001/10/14 18:47:27
*************** emit_addhi3_postreload (dest, src0, src1
*** 908,919 ****
    return insn;
  }
  
! /* Called after register allocation to add any instructions needed for the
!    prologue.  Using a prologue insn is favored compared to putting all of the
!    instructions in the FUNCTION_PROLOGUE macro, since it allows the scheduler
!    to intermix instructions with the saves of the caller saved registers.  In
!    some cases, it might be necessary to emit a barrier instruction as the last
!    insn to prevent such scheduling.
  
     Also any insns generated here should have RTX_FRAME_RELATED_P(insn) = 1
     so that the debug info generation code can handle them properly.  */
--- 908,920 ----
    return insn;
  }
  
! /* Called after register allocation to add any instructions needed for
!    the prologue.  Using a prologue insn is favored compared to putting
!    all of the instructions in the TARGET_ASM_FUNCTION_PROLOGUE macro,
!    since it allows the scheduler to intermix instructions with the
!    saves of the caller saved registers.  In some cases, it might be
!    necessary to emit a barrier instruction as the last insn to prevent
!    such scheduling.
  
     Also any insns generated here should have RTX_FRAME_RELATED_P(insn) = 1
     so that the debug info generation code can handle them properly.  */
*************** direct_return ()
*** 1003,1014 ****
  	  && stormy16_compute_stack_layout ().frame_size == 0);
  }
  
! /* Called after register allocation to add any instructions needed for the
!    epilogue.  Using a epilogue insn is favored compared to putting all of the
!    instructions in the FUNCTION_PROLOGUE macro, since it allows the scheduler
!    to intermix instructions with the saves of the caller saved registers.  In
!    some cases, it might be necessary to emit a barrier instruction as the last
!    insn to prevent such scheduling.  */
  
  void
  stormy16_expand_epilogue ()
--- 1004,1016 ----
  	  && stormy16_compute_stack_layout ().frame_size == 0);
  }
  
! /* Called after register allocation to add any instructions needed for
!    the epilogue.  Using a epilogue insn is favored compared to putting
!    all of the instructions in the TARGET_ASM_FUNCTION_PROLOGUE macro,
!    since it allows the scheduler to intermix instructions with the
!    saves of the caller saved registers.  In some cases, it might be
!    necessary to emit a barrier instruction as the last insn to prevent
!    such scheduling.  */
  
  void
  stormy16_expand_epilogue ()
============================================================
Index: gcc/config/stormy16/stormy16.h
*** stormy16.h	2001/10/05 20:33:09	1.10
--- gcc/config/stormy16/stormy16.h	2001/10/14 18:47:43
*************** typedef int CUMULATIVE_ARGS;
*** 2421,2430 ****
     the return address.  Hence returning from FUNCTION will return to whoever
     called the current `thunk'.
  
!    The effect must be as if FUNCTION had been called directly with the adjusted
!    first argument.  This macro is responsible for emitting all of the code for
!    a thunk function; `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE' are not
!    invoked.
  
     The THUNK_FNDECL is redundant.  (DELTA and FUNCTION have already been
     extracted from it.)  It might possibly be useful on some targets, but
--- 2421,2431 ----
     the return address.  Hence returning from FUNCTION will return to whoever
     called the current `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 of the code for a thunk function;
!    TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE are
!    not invoked.
  
     The THUNK_FNDECL is redundant.  (DELTA and FUNCTION have already been
     extracted from it.)  It might possibly be useful on some targets, but
*************** typedef int CUMULATIVE_ARGS;
*** 2564,2573 ****
     code to call function `__bb_trace_ret'.  The assembler code should
     only be output if the global compile flag `profile_block_flag' ==
     2.  This macro has to be used at every place where code for
!    returning from a function is generated (e.g. `FUNCTION_EPILOGUE').
!    Although you have to write the definition of `FUNCTION_EPILOGUE'
!    as well, you have to define this macro to tell the compiler, that
!    the proper call to `__bb_trace_ret' is produced.  */
  /* #define FUNCTION_BLOCK_PROFILER_EXIT(FILE) */
  
  /* A C statement or compound statement to save all registers, which may be
--- 2565,2575 ----
     code to call function `__bb_trace_ret'.  The assembler code should
     only be output if the global compile flag `profile_block_flag' ==
     2.  This macro has to be used at every place where code for
!    returning from a function is generated
!    (e.g. `TARGET_ASM_FUNCTION_EPILOGUE').  Although you have to write
!    the definition of `TARGET_ASM_FUNCTION_EPILOGUE' as well, you have
!    to define this macro to tell the compiler, that the proper call to
!    `__bb_trace_ret' is produced.  */
  /* #define FUNCTION_BLOCK_PROFILER_EXIT(FILE) */
  
  /* A C statement or compound statement to save all registers, which may be
*************** typedef int CUMULATIVE_ARGS;
*** 2576,2592 ****
     the assembler code can be concatenated with the string ID, to obtain a
     unique lable name.
  
!    Registers or condition codes clobbered by `FUNCTION_PROLOGUE' or
!    `FUNCTION_EPILOGUE' must be saved in the macros `FUNCTION_BLOCK_PROFILER',
     `FUNCTION_BLOCK_PROFILER_EXIT' and `BLOCK_PROFILER' prior calling
!    `__bb_init_trace_func', `__bb_trace_ret' and `__bb_trace_func' respectively.  */
  /* #define MACHINE_STATE_SAVE(ID) */
  
  /* A C statement or compound statement to restore all registers, including
     condition codes, saved by `MACHINE_STATE_SAVE'.
  
!    Registers or condition codes clobbered by `FUNCTION_PROLOGUE' or
!    `FUNCTION_EPILOGUE' must be restored in the macros
     `FUNCTION_BLOCK_PROFILER', `FUNCTION_BLOCK_PROFILER_EXIT' and
     `BLOCK_PROFILER' after calling `__bb_init_trace_func', `__bb_trace_ret' and
     `__bb_trace_func' respectively.  */
--- 2578,2596 ----
     the assembler code can be concatenated with the string ID, to obtain a
     unique lable name.
  
!    Registers or condition codes clobbered by
!    `TARGET_ASM_FUNCTION_PROLOGUE' or `TARGET_ASM_FUNCTION_EPILOGUE'
!    must be saved in the macros `FUNCTION_BLOCK_PROFILER',
     `FUNCTION_BLOCK_PROFILER_EXIT' and `BLOCK_PROFILER' prior calling
!    `__bb_init_trace_func', `__bb_trace_ret' and `__bb_trace_func'
!    respectively.  */
  /* #define MACHINE_STATE_SAVE(ID) */
  
  /* A C statement or compound statement to restore all registers, including
     condition codes, saved by `MACHINE_STATE_SAVE'.
  
!    Registers or condition codes clobbered by `TARGET_ASM_FUNCTION_PROLOGUE' or
!    `TARGET_ASM_FUNCTION_EPILOGUE' must be restored in the macros
     `FUNCTION_BLOCK_PROFILER', `FUNCTION_BLOCK_PROFILER_EXIT' and
     `BLOCK_PROFILER' after calling `__bb_init_trace_func', `__bb_trace_ret' and
     `__bb_trace_func' respectively.  */
*************** typedef int CUMULATIVE_ARGS;
*** 2720,2726 ****
     stack slot.  This default is right for most machines.  The exceptions are
     machines where it is impossible to execute instructions in the stack area.
     On such machines, you may have to implement a separate stack, using this
!    macro in conjunction with `FUNCTION_PROLOGUE' and `FUNCTION_EPILOGUE'.
  
     FP points to a data structure, a `struct function', which describes the
     compilation status of the immediate containing function of the function
--- 2724,2731 ----
     stack slot.  This default is right for most machines.  The exceptions are
     machines where it is impossible to execute instructions in the stack area.
     On such machines, you may have to implement a separate stack, using this
!    macro in conjunction with `TARGET_ASM_FUNCTION_PROLOGUE' and
!    `TARGET_ASM_FUNCTION_EPILOGUE'.
  
     FP points to a data structure, a `struct function', which describes the
     compilation status of the immediate containing function of the function
*************** do {									\
*** 4875,4882 ****
     To support optional call frame debugging information, you must also define
     `INCOMING_RETURN_ADDR_RTX' and either set `RTX_FRAME_RELATED_P' on the
     prologue insns if you use RTL for the prologue, or call `dwarf2out_def_cfa'
!    and `dwarf2out_reg_save' as appropriate from `FUNCTION_PROLOGUE' if you
!    don't.
  
     Defined in svr4.h.  */
  /* #define DWARF2_DEBUGGING_INFO */
--- 4880,4887 ----
     To support optional call frame debugging information, you must also define
     `INCOMING_RETURN_ADDR_RTX' and either set `RTX_FRAME_RELATED_P' on the
     prologue insns if you use RTL for the prologue, or call `dwarf2out_def_cfa'
!    and `dwarf2out_reg_save' as appropriate from `TARGET_ASM_FUNCTION_PROLOGUE'
!    if you don't.
  
     Defined in svr4.h.  */
  /* #define DWARF2_DEBUGGING_INFO */
*************** do {									\
*** 5210,5234 ****
     #pragma pack(push,<n>) and #pragma pack(pop). */
  /* HANDLE_PRAGMA_PACK_PUSH_POP 1 */
     
- /* If defined, a C expression whose value is nonzero if IDENTIFIER with
-    arguments ARGS is a valid machine specific attribute for DECL.  The
-    attributes in ATTRIBUTES have previously been assigned to DECL.  */
- /* #define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) */
- 
- /* If defined, a C expression whose value is nonzero if IDENTIFIER with
-    arguments ARGS is a valid machine specific attribute for TYPE.  The
-    attributes in ATTRIBUTES have previously been assigned to TYPE.  */
- /* #define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) */
- 
- /* If defined, a C expression whose value is zero if the attributes on TYPE1
-    and TYPE2 are incompatible, one if they are compatible, and two if they are
-    nearly compatible (which causes a warning to be generated).  */
- /* #define COMP_TYPE_ATTRIBUTES(TYPE1, TYPE2) */
- 
- /* If defined, a C statement that assigns default attributes to newly defined
-    TYPE.  */
- /* #define SET_DEFAULT_TYPE_ATTRIBUTES(TYPE) */
- 
  /* Define this macro to control use of the character `$' in identifier names.
     The value should be 0, 1, or 2.  0 means `$' is not allowed by default; 1
     means it is allowed by default if `-traditional' is used; 2 means it is
--- 5215,5220 ----
============================================================
Index: gcc/config/stormy16/stormy16.md
*** stormy16.md	2001/10/05 20:33:09	1.3
--- gcc/config/stormy16/stormy16.md	2001/10/14 18:47:55
***************
*** 917,928 ****
  ;; ::
  ;; ::::::::::::::::::::
  
! ;; Called after register allocation to add any instructions needed for the
! ;; prologue.  Using a prologue insn is favored compared to putting all of the
! ;; instructions in the FUNCTION_PROLOGUE macro, since it allows the scheduler
! ;; to intermix instructions with the saves of the caller saved registers.  In
! ;; some cases, it might be necessary to emit a barrier instruction as the last
! ;; insn to prevent such scheduling.
  (define_expand "prologue"
    [(const_int 1)]
    ""
--- 917,929 ----
  ;; ::
  ;; ::::::::::::::::::::
  
! ;; Called after register allocation to add any instructions needed for
! ;; the prologue.  Using a prologue insn is favored compared to putting
! ;; all of the instructions in the TARGET_ASM_FUNCTION_PROLOGUE macro,
! ;; since it allows the scheduler to intermix instructions with the
! ;; saves of the caller saved registers.  In some cases, it might be
! ;; necessary to emit a barrier instruction as the last insn to prevent
! ;; such scheduling.
  (define_expand "prologue"
    [(const_int 1)]
    ""
***************
*** 932,943 ****
    DONE;
  }")
  
! ;; Called after register allocation to add any instructions needed for the
! ;; epilogue.  Using a epilogue insn is favored compared to putting all of the
! ;; instructions in the FUNCTION_EPILOGUE macro, since it allows the scheduler
! ;; to intermix instructions with the restires of the caller saved registers.
! ;; In some cases, it might be necessary to emit a barrier instruction as the
! ;; first insn to prevent such scheduling.
  (define_expand "epilogue"
    [(const_int 2)]
    ""
--- 933,945 ----
    DONE;
  }")
  
! ;; Called after register allocation to add any instructions needed for
! ;; the epilogue.  Using a epilogue insn is favored compared to putting
! ;; all of the instructions in the TARGET_ASM_FUNCTION_EPILOGUE macro,
! ;; since it allows the scheduler to intermix instructions with the
! ;; restires of the caller saved registers.  In some cases, it might be
! ;; necessary to emit a barrier instruction as the first insn to
! ;; prevent such scheduling.
  (define_expand "epilogue"
    [(const_int 2)]
    ""


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]