This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/45978] [4.6 Regression] bogus "array subscript is above array bounds" warning in extremely simple code with no loops
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2011 08:39:00 +0000
- Subject: [Bug tree-optimization/45978] [4.6 Regression] bogus "array subscript is above array bounds" warning in extremely simple code with no loops
- Auto-submitted: auto-generated
- References: <bug-45978-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45978
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.7.0
Summary|[4.6/4.7 Regression] bogus |[4.6 Regression] bogus
|"array subscript is above |"array subscript is above
|array bounds" warning in |array bounds" warning in
|extremely simple code with |extremely simple code with
|no loops |no loops
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-20 08:19:59 UTC ---
The bug was indeed worked around in VRP by making it use the CCP engine.
It now sees
MEM[(struct Y *)&<retval> + 16B] = vect_cst_.6_11;
instead of &MEM[(struct Y *)&<retval>].ar[4] as a base which makes it not warn.
The vectorizer still uses that address as base though.
So I suppose we can say it's fixed in 4.7 by adjusting the pass that
emits the warning.