This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PR70715]Expand simple operations in IV.base and check if it's the control_IV
- From: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: Bin Cheng <Bin dot Cheng at arm 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, 22 Apr 2016 17:26:21 +0200
- Subject: Re: [PATCH PR70715]Expand simple operations in IV.base and check if it's the control_IV
- Authentication-results: sourceware.org; auth=none
- References: <DB5PR08MB114462C918A8C3679BFA85BBE76D0 at DB5PR08MB1144 dot eurprd08 dot prod dot outlook dot com> <CAFiYyc36FVj_HLVFkPeTmbCY=j+qNH2vSFbmA4NfA9B5rp9mcA at mail dot gmail dot com>
On 21 April 2016 at 11:03, Richard Biener <richard.guenther@gmail.com> wrote:
> On Wed, Apr 20, 2016 at 5:08 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
>> Hi,
>> As reported in PR70715, GCC failed to prove no-overflows of IV(&p[n]) for simple example like:
>> int
>> foo (char *p, unsigned n)
>> {
>> while(n--)
>> {
>> p[n]='A';
>> }
>> return 0;
>> }
>> Actually, code has already been added to handle this form loops when fixing PR68529. Problem with this case is loop niter analyzer records control_IV with its base expanded by calling expand_simple_operations. This patch simply adds code expanding BASE before we check its equality against control_IV.base. In the long run, we might want to remove the use of expand_simple_operations.
>>
>> Bootstrap and test on x86_64. Is it OK?
>
Hi Bin,
On ARM and AArch64 bare-metal toolchains, this causes
FAIL: gcc.dg/tree-ssa/minmax-2.c scan-tree-dump optimized "__builtin_fmin"
Christophe
> Ok.
>
> Richard.
>
>> Thanks,
>> bin
>>
>>
>> 2016-04-20 Bin Cheng <bin.cheng@arm.com>
>>
>> PR tree-optimization/70715
>> * tree-ssa-loop-niter.c (loop_exits_before_overflow): Check equality
>> after expanding BASE using expand_simple_operations.