This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] checking version of rtl flag access macros
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: Janis Johnson <janis187 at us dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 May 2002 13:52:42 -0700
- Subject: Re: [PATCH] checking version of rtl flag access macros
- References: <20020508125437.A27443@us.ibm.com> <200205082036.g48Kar19018939@hiauly1.hia.nrc.ca>
On Wed, May 08, 2002 at 04:36:53PM -0400, John David Anglin wrote:
> > Like this?
> >
> > /* 1 if RTX is an insn in the delay slot of a branch insn for which an
> > annulling branch should be used. */
> > #define INSN_ANNULLED_BRANCH_P(RTX) \
> > (RTL_FLAG_CHECK2("INSN_ANNULLED_BRANCH_P", (RTX), INSN, \
> > JUMP_INSN)->unchanging)
>
> I like the style of the comment but I think it can simply be:
>
> /* 1 if RTX is a annulled branch insn. */
But it's not an annulled branch insn, it's an insn in the delay slot of
such a branch.
> I think that using RTL_FLAG_CHECKn is wrong. It's not an error
> if the rtx is not a JUMP_INSN or a CALL_INSN. However, the result
> should be 1 only if the rtx is a JUMP_INSN or CALL_INSN, with the
> unchanging bit set.
Each of the eight RTL flags is used for multiple purposes. It seems
much cleaner for the code that uses the macros to explicitly check
that it's about to use a macro correctly than for the macros to do
the checks and then do nothing if they are invoked incorrectly.
Macros that silently do nothing depending on how they are used
sound like a debugging nightmare.
> Fix is also needed for INSN_FROM_TARGET_P.
Yes, I noticed that.
Janis