This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36902] Array bound warning with dead code after optimization
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Aug 2008 17:54:03 -0000
- Subject: [Bug middle-end/36902] Array bound warning with dead code after optimization
- References: <bug-36902-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #21 from manu at gcc dot gnu dot org 2008-08-22 17:54 -------
(In reply to comment #19)
> (In reply to comment #18)
> > I think that if the compiler knows that the code is never executed then, we
> > shouldn't warn.
>
> It does but only later on in the optimization it knows that the code is dead.
My point is that if I understand the vrp code correctly, we can detect that the
code is dead before warning. In this case, the code is detected dead within
VRP, not in a later pass. Maybe I am wrong. Let's see what Mueller and Guenther
have to say. In any case, we should consider whether warning in conditional BBs
is a good idea at all. I think that saying
"array subscript *is* above array bounds"
in a BB that is executed conditionally is not a good idea in general.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902