This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR82808
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>, Martin Jambor <mjambor at suse dot cz>
- Date: Fri, 3 Nov 2017 11:08:38 +0100
- Subject: Re: PR82808
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMmAJPxAYomqv6tx0rdnrpbH=ak7=91A+n05x-mSjddXMA@mail.gmail.com>
On Fri, Nov 3, 2017 at 6:15 AM, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
> Hi Martin,
> As mentioned in PR, the issue here for propagating value of 'm' from
> f_c1 to foo() is that the jump function operation is FLOAT_EXPR, and
> the type of input param 'm' is int, so fold_unary() doesn't do the
> conversion to real_type. The attached patch fixes that by calling
> fold_convert if operation is FLOAT_EXPR / FIX_TRUNC_EXPR /
> CONVERT_EXPR and converts it to the type of corresponding parameter in
> callee.
>
> There are still two issues:
> a) Using NOP_EXPR for early_exit in ipa_get_jf_pass_through_result.
> I suppose we need to change to some other code to indicate that there
> is no operation ?
> b) Patch does not passing param_type from all callers.
> I suppose we could fix these incrementally ?
>
> Bootstrap+tested on x86_64-unknown-linux-gnu.
> OK for trunk ?
This doesn't look like a well designed fix. Both fold_unary and fold_binary
calls get a possibly bogus type and you single out only a few ops.
Either _fully_ list a set of operations that are know to have matching
input/output types or always require param_type to be non-NULL.
For a) simply remove the special-casing and merge it with CONVERT_EXPR
handling (however it will end up looking).
Please don't use fold_convert, using fold_unary is fine.
Thanks,
Richard.
> Thanks,
> Prathamesh