This is the mail archive of the gcc-patches@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: [PATCH]: Simplify inside CONST expressions


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-


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