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 GCC]Clean pedantic calls and useless lvalue code in fold_cond_expr_with_comparison


On Thu, Nov 3, 2016 at 3:11 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> According to analysis given by https://gcc.gnu.org/ml/gcc/2016-10/msg00228.html, calls to pedantic_non_lvalue_loc and code handling lvalue in fold_cond_expr_with_comparison are useless now.  Given this is complicated legacy code, it may be better to change code step by step, rather than doing this cleanup together with moving simplification from fold_cond_expr_with_comparison to match.pd.
> BTW, after last cleanup of pedantic_lvalues, function pedantic_non_lvalue_loc now has nothing to do with lvalue.  It could be further cleaned up, or at least renamed into something else.  This patch doesn't do that because that depends on the answer to the question of the aforementioned message.
>
> Bootstrap and test on x86_64 and AArch64.  Any comments?

Ok.

Note removal of [pedantic_]non_lvalue can at most result in accepting
invalid code
where we might not have any testsuite coverage.  For the 2nd case with
/* Avoid adding NOP_EXPRs in case this is an lvalue.  */ and C++ lvalue ?:
I'm not sure we have testsuite coverage given Jason failed to add a testcase
when adding the code in r34416.

Thanks,
Richard.

> Thanks,
> bin
>
> 2016-10-27  Bin Cheng  <bin.cheng@arm.com>
>
>         * fold-const.c (fold_cond_expr_with_comparison): Remove call
>         to pedantic_non_lvalue_loc.  Remove useless code for lvalue
>         where cond_expr can't be a lvalue.


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