This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
- From: "pangbw at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Sep 2015 17:59:33 +0000
- Subject: [Bug tree-optimization/59124] [4.9/5/6 Regression] Wrong warnings "array subscript is above array bounds"
- Auto-submitted: auto-generated
- References: <bug-59124-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
--- Comment #27 from baoshan <pangbw at gmail dot com> ---
> It seems GCC at some moment unrolls the loop and creates such block with
> those ranges. Probably, the block is unreachable, but it would be better to
> not create it in the first place. Finding out where and why it is created
> would help to figure out a fix.
At pass "cunrolli", it would unroll the loops according the estimated iterate
times. The problem is at this time it use array ref(infer_loop_bounds_from_ref)
to infer the iterate times which is not accurate. The inaccurate iterate times
result the extra blocks.
I am not sure which way to go at this point. Should we add value range
propagation in/before "cunrolli" so we can get the accurate iterate times? or
We just disable the warning being reported at "vrp" pass?