This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Disable tree-stdarg on a per-target basis
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 26 May 2005 06:45:25 -0400
- Subject: Re: [PATCH] Disable tree-stdarg on a per-target basis
- References: <email@example.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, May 26, 2005 at 12:03:49PM +0200, Eric Botcazou wrote:
> This patch adds a new target flag, TARGET_STDARG_OPTIMIZE_DISABLE, to make it
> possible to disable the tree-level stdarg optimization pass, and defines it to
> true on SPARC (I think the RTL CSE + DCE passes already eliminate as much
> stdarg overhead as tree-stdarg would there).
> Tested on sparc-sun-solaris2.10. OK for mainline?
I don't think extra hook is needed.
For targets which have structure type va_list, if they are interested
in the optimization, they set va_list_gpr_counter_field
or va_list_fpr_counter_field, otherwise they don't.
/* For struct * va_list, if the backend didn't tell us what the counter fields
are, there is nothing more we can do. */
&& va_list_gpr_counter_field == NULL_TREE
&& va_list_fpr_counter_field == NULL_TREE)
plus copy of
va_list_simple_ptr = POINTER_TYPE_P (va_list_type_node)
&& (TREE_TYPE (va_list_type_node) == void_type_node
|| TREE_TYPE (va_list_type_node) == char_type_node);
could move to gate.
Now, for the char */void * type va_list, perhaps the backend could signal
that it is going to make use of the optimization by setting
targetm.stdarg_optimize_hook to something, even if that is just
a dummy routine that returns false; unconditionally.
The only problem with doing this is that current stdarg tests contain data
even for ports that really don't make any use of this optimization
and therefore it could be disabled there (i386) or targets where it
is useful, but not implemented yet (ia64). And it would be good if
the tests covered at least 2 different arches that have char */void *
> 2005-05-26 Eric Botcazou <firstname.lastname@example.org>
> * target.h (gcc_target): New field stdarg_optimize_disable.
> * target-def.h (TARGET_STDARG_OPTIMIZE_DISABLE): New
> hook defaulting to false.
> (TARGET_INITIALIZER): Add it.
> * doc/tm.texi (Varargs): Document it.
> * tree-stdarg.c (gate_optimize_stdarg): Unconditionally return
> false if TARGET_STDARG_OPTIMIZE_DISABLE.
> * config/sparc/sparc.c (TARGET_STDARG_OPTIMIZE_DISABLE): Define
> to true.