This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Simplify inside CONST expressions
- From: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Sep 2005 09:38:49 +0200
- Subject: Re: [PATCH]: Simplify inside CONST expressions
- References: <20050905135022.GA3306@de.ibm.com> <431D415B.6010604@lu.unisi.ch>
Hello,
> What about this instead:
>
> {
> rtx tem_lhs = GET_CODE (lhs) == CONST ? XEXP (lhs, 0) : lhs;
> rtx tem_rhs = GET_CODE (rhs) == CONST ? XEXP (rhs, 0) : rhs;
> tem = simplify_binary_operation (ncode, mode, tem_lhs, tem_rhs);
> if (GET_CODE (lhs) == CONST && GET_CODE (rhs) == CONST)
> {
> gcc_assert (GET_MODE (lhs) == GET_MODE (rhs));
> if (!CONSTANT (tem))
> tem = gen_rtx_CONST (GET_MODE (lhs), tem);
> }
> }
But wouldn't this allow intermixing CONST expressions with others? I think this
could potentially create expressions too complicated to be resolved by the
linker. My intention was to simplify only if we have two CONSTs in order to make
sure that the result is still ok for the linker.
Bye,
-Andreas-