"Paulo J. Matos" <pa...@matos-sorge.com> writes:

> My question is, should added_clobbers_hard_reg_p take FLAGS_REGNUM
> into consideration and allow it in a clobber, just as it allows a
> scratch?

There is no middle-end concept of FLAGS_REGNUM (barring reg-stack.c
which is really a target-specific pass).  Some targets have several
different flags registers, of which some are caller-saved and
callee-saved.  So what you are suggesting would seem to be a large
conceptual change to the middle-end.

One approach would be to use a pseudo-register which you eliminate to
the flag register.  I really don't know how well that would work.

The function added_clobbers_hard_reg_p is a generated function.  So
another approach would be some sort of attribute which directs the
generator (genemit) to ignore certain hard registers.

And another approach would be a new target hook.

I haven't thought enough about it to know whether any of these is a good
idea.

Ian

Reply via email to