This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: added_clobbers_hard_reg_p and FLAGS_REGNUM
- From: Ian Lance Taylor <iant at google dot com>
- To: "Paulo J. Matos" <paulo at matos-sorge dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 26 Sep 2011 09:23:22 -0700
- Subject: Re: added_clobbers_hard_reg_p and FLAGS_REGNUM
- References: <j5piln$ptd$1@dough.gmane.org>
"Paulo J. Matos" <paulo@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