This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC]Clean pedantic calls and useless lvalue code in fold_cond_expr_with_comparison
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bin Cheng <Bin dot Cheng at arm dot com>, Jason Merrill <jason at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Fri, 4 Nov 2016 09:40:22 +0100
- Subject: Re: [PATCH GCC]Clean pedantic calls and useless lvalue code in fold_cond_expr_with_comparison
- Authentication-results: sourceware.org; auth=none
- References: <VI1PR0802MB21766E0B63E27FAF9EBDC8E1E7A30@VI1PR0802MB2176.eurprd08.prod.outlook.com>
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.