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

Re: reload question


Miles Bader wrote:
Say I've got a mov instruction that only works via an accumulator A, and
a two-operand add instruction.  "r" regclass includes regs A,X,Y, and
"a" regclass only includes reg A.

So mov has constraints like:  0 = "g,a"   1 = "a,gi"
and add3 has constraints:     0 = "r"     1 = "0"    2 = "i" (say)

Then if there's an insn before reload like:

add3 X, Y, 1

Reload will notice this, and generate a reload to put Y into X, so
you'll end up with:

   mov   X, Y
   add3  X, X, 1

Now, what I _expected_ to happen is that reload would then be repeated
to handle the newly added mov insn, which would see that the mov insn's
constraint don't match, and would then generate an additional reload to
yield:

   mov   A, Y
   mov   X, A
   add3  X, X, 1

but in fact this final step doesn't seem to be happening -- it just
finishes reload without changing the bogus "mov X, Y" insn and goes on
to die with an "insn does not satisfy its constraints:" error in final.

Reload insns aren't themselves reloaded. You should look at the SECONDARY_*_RELOAD_CLASS; they'll probably let you do what you want.



Bernd



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