This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] REG_EQUAL notes on cond_jumps.
- From: Roger Sayle <roger at www dot eyesopen dot com>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 May 2003 15:37:15 -0600 (MDT)
- Subject: Re: [PATCH] REG_EQUAL notes on cond_jumps.
> The cse pass generates the latter form for insn 25 but possibly
> it doesn't know how to use it for jump simplification. Anyway, it
> is a puzzle why cse can simplify the jump in 20010119-1.c at -O1
> but not at -O2.
Sorry, I didn't read this part of your original post. The reason
is that __builtin_constant_p leaves the decision as to whether a
a variable is constant or not until afer GCSE at -O2, but at -O1
and lower it decides much earlier during CSE1, as dead-code won't
get eliminated if the decision is made too late.
In 20010119-1.c, the loop calls "bar" at -O2 and higher, but calls
"baz" at -O1. You can see why I wanted to give an reduced example
where __builtin_constant_p didn't complicate the analysis :>