Bug 44034 - target hooks are hard to maintain
Summary: target hooks are hard to maintain
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.6.0
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: patch
Depends on:
Blocks: 44033
  Show dependency treegraph
 
Reported: 2010-05-07 22:17 UTC by Jorn Wolfgang Rennecke
Modified: 2010-06-30 19:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-05-07 22:28:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2010-05-07 22:17:00 UTC
The definition of target hooks is spread across multiple files, which makes
it hard to add new or modify existing target hooks in a consistent manner.
Comment 1 Steven Bosscher 2010-05-07 22:28:55 UTC
Indeed. A serious issue.
Comment 2 Jorn Wolfgang Rennecke 2010-05-12 06:54:18 UTC
A patch is here:
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00788.html
Comment 3 Jorn Wolfgang Rennecke 2010-05-26 07:57:48 UTC
(In reply to comment #2)

updated patch for revision 159828:
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01938.html
Comment 4 Jorn Wolfgang Rennecke 2010-06-07 22:22:56 UTC
(In reply to comment #3)
 
updated patch for revision 160389:
 
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00665.html
Comment 5 Jorn Wolfgang Rennecke 2010-06-09 03:14:46 UTC
(In reply to comment #4)
  
updated patch for revision 160454:

http://gcc.gnu.org/ml/gcc-patches/2010-06/msg00846.html
Comment 6 Jorn Wolfgang Rennecke 2010-06-29 18:22:19 UTC
Subject: Bug 44034

Author: amylaar
Date: Tue Jun 29 18:22:00 2010
New Revision: 161547

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161547
Log:
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


Added:
    trunk/gcc/doc/tm.texi.in
      - copied, changed from r161540, trunk/gcc/doc/tm.texi
    trunk/gcc/genhooks.c
    trunk/gcc/target.def
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/Makefile.in
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/config/alpha/alpha.c
    trunk/gcc/config/arm/arm.c
    trunk/gcc/config/cris/cris.c
    trunk/gcc/config/ia64/ia64.c
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/spu/spu.c
    trunk/gcc/df-scan.c
    trunk/gcc/doc/tm.texi
    trunk/gcc/dwarf2out.c
    trunk/gcc/except.c
    trunk/gcc/haifa-sched.c
    trunk/gcc/opts.c
    trunk/gcc/po/ChangeLog
    trunk/gcc/po/EXCLUDES
    trunk/gcc/sel-sched.c
    trunk/gcc/target-def.h
    trunk/gcc/target.h
    trunk/gcc/tree-vect-data-refs.c
    trunk/gcc/varasm.c

Comment 7 Iain Sandoe 2010-06-30 14:34:15 UTC
Subject: Bug 44034

Author: iains
Date: Wed Jun 30 14:33:40 2010
New Revision: 161606

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161606
Log:

	PR other/44034
	* config/darwin.c (darwin_override_options): Use renamed
	targetm.asm_out.emit_unwind_label.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/darwin.c

Comment 8 Jorn Wolfgang Rennecke 2010-06-30 19:08:03 UTC
Patch committed to mainline.
AFAIK the only lingering issue is this one:
http://gcc.gnu.org/ml/gcc-patches/2010-06/msg03046.html

(And of course the stuff that needs some help from the FSF - PR44035, PR44033,
 PR44032)