This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not refer directly to gen_lowpart_xxx
- From: "Paolo Bonzini" <paolo dot bonzini at polimi dot it>
- To: <joern dot rennecke at superh dot com>, <zack at codesourcery dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Jan 2004 14:39:58 +0100
- Subject: Re: [PATCH] Do not refer directly to gen_lowpart_xxx
> > bonzini@sola3:~/gcc/obj/gcc$ gdb cc1
> > (gdb) b gen_lowpart
> > "gen_lowpart" is not a function
> > (gdb) b gen_lowpart <TAB>
> > gen_lowpart gen_lowpart_common gen_lowpart_general
> > gen_lowpart_SUBREG gen_lowpart_for_combine
> > gen_lowpart_if_possible
>
> The first symbol displayed is the gen_lowpart function in emit-rtl.c .
Nope. It is a *pointer to function*. That's the reason for the error in "b
gen_lowpart". I renamed the function in emit-rtl.c to gen_lowpart_general,
and gen_lowpart is initialized to gen_lowpart_general.
> The existance of gen_lowpart_for_combine function does not imply that
> all calls to gen_lowpart inside combine.c are calls to
> gen_lowpart_for_combine.
combine.c's only entry point is combine_instructions, which sets gen_lowpart
so that it points gen_lowpart_for_combine.
> It looks more like a coding error, or that you
> can now use both functions side-by-side.
After this patch, everything should go through the gen_lowpart pointer to
function; explicit usage of gen_lowpart_general, gen_lowpart_for_combine or
gen_lowpart_if_possible should be viewed with suspect. Previously,
combine.c had a cute macro like
#define gen_lowpart dont_use_gen_lowpart_in_combine_you_dummy
but now it is not needed anymore, just use gen_lowpart. This is necessary
to move many cunning simplifications in combine.c (that in current HEAD
gen_lowpart_for_combine) to simplify-rtx.c (where they can use the
gen_lowpart pointer to function after this patch).
Paolo