This is the mail archive of the gcc@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]

Using rtx_varies_p vs rtx_unstable_p


We use rtx_varies_p in a few places where I think we should be using
rtx_unstable_p.

For those who don't know what each does:
rtx_unstable_p - Return 1 if the value of X is unstable (would be
different at different points in the program). The frame pointer, arg
pointer, etc. are considered stable (within one function), and so is
anything marked unchanging.

rtx_varies_p - Return 1 if the value of X can vary even between two
runs of the program.


In alias.c, in the propagation loop of init_alias_analysis, we use
rtx_varies_p when trying to determine if a register has a known value.

However, IMHO, we should be using rtx_unstable_p.

It's not relevant whether it varies over two runs of the program, it
has a known value if it's not going to be different at different
points in the program.

Making this change and bootstrapping produces no failures on powerpc
or x86.

In sched-deps.c, we use true_dependence, and pass it rtx_varies_p.
Once again, for the purposes of flow dependence, it's only relevant
whether it would be different at different points in the program, not
whether it ever can change over different program runs.  Same deal
with making this change, bootstrapping produces no failures on powerpc
and x86.

For a simple example of the difference of rtx_varies_p and
rtx_unstable_p, to make sure i have the idea right, can someone tell
me if the following is correct?

rtx_unstable_p would say argc is stable. It doesn't vary at different
points in the program.

rtx_varies_p would say argc is unstable. It can vary over different
runs of a program.

If this is correct, than IMHO, we should be using rtx_unstable_p in
the places above.

--Dan


-- 
"The brain is a wonderful organ; it starts working the moment you
get up in the morning and doesn't stop until you get to work.
"-Steven Wright


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