This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] BZ60501: Add addptr optab
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>
- Date: Sat, 15 Mar 2014 12:15:17 +0100
- Subject: Re: [PATCH] BZ60501: Add addptr optab
- Authentication-results: sourceware.org; auth=none
- References: <20140313092413 dot GA14597 at bart> <3263989 dot 6pOavBsA8X at polaris> <5322FDB5 dot 3030706 at linux dot vnet dot ibm dot com>
> > Then you should document that by stating that the pattern is guaranteed
> > to be invoked only for addresses (and may not clobber the condition
> > code).
> Ok, will do.
Thanks.
> > Hoping isn't sufficient IMO here, you need to rename/rework
> > emit_add3_insn and possibly stop the compiler if the value it is
> > invoked on is not an address.
> Agreed. Any idea how to check for this?
The head comment of lra_emit_add appears to be saying that it is invoked only
for addresses; it's clear when it is invoked from base_plus_disp_to_reg but
it's less clear when it is invoked from lra_emit_move. So a possible approach
could be to split lra_emit_move into 2 parts: lra_emit_move with an assertion
that y isn't a PLUS and lra_emit_address_move with the call to lra_emit_add,
and review all the callers.
If that's too much work, just copy (part of) the head comment of lra_emit_add
to that of emit_add3_insn and cross your fingers (yes, the latter action adds
something over just hoping :-)
--
Eric Botcazou