On Nov 9, 2006, at 6:39 AM, Mohamed Shafi wrote:
When i diff the rtl dumps for programs passing negative value with and
without frame pointer i find changes from file.greg .
And, is that change bad? We do expect changes in codegen, you didn't
say if those changes are invalid, or what was invalid about them. If
they are valid, which pass is the first pass that contains invalid
rtl? If this was the first pass with invalid rtl, which instruction
was invalid and why? What assembly do you get in both cases? Which
instruction is wrong? What's wrong about it?
Did you examine:
long long l, k;
l = -k;
for correctness by itself? Was it valid or invalid?
[ read ahead for spoilers, I'd rather you pull this information out
of the dump and present it to us... ]
A quick glance at the rtl shows that insn 95 tries to use [a4+4] but
insn 94 clobbered a4 already, also d3 is used by insn 93, but there
isn't a set for it.
The way the instructions are numbered suggests that the code went
wrong before this point. You have to read and understand all the
dumps, whether they are right or wrong and why, track down the code
in the compiler that is creating the wrong code and then see if you
can guess why. If not, fire up gdb, and watch it add/remove/reorder
instructions and why it was doing it and the conditions it checked
before doing the transformation and then reason about why it is wrong
and what it should be doing instead. I'd suspect the bug lies in
your port file and gcc is using information from it and coming up
with the bad code.
For example, what pass removed the setting of d3?