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]
Other format: [Raw text]

Re: [PATCH] checking version of rtl flag access macros


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


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