This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/60121] gcc does not warn an obvious out-of-bound array access at -O0 and -O1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60121

--- Comment #8 from Chengnian Sun <chengniansun at gmail dot com> ---
(In reply to Andrew Pinski from comment #7)
> (In reply to Chengnian Sun from comment #6)
> > The test case can be further reduced to the following code, which is NOT
> > dead or dependent on bug 60115. 
> > 
> > int b[1];
> > int f() {
> >   return b[9999];
> > }
> 
> Because we don't warn in the front-end.  That was on purpose.  I can find
> the old bug reports of why we don't want to warn in the front-end.  The
> warning only happens in VPR which is only enabled for -O2 and above (-Os is
> -O2 plus optimize for size really).

Thanks. Is it possible to enable vrp with -ftree-vrp at -O0 level? Therefore
the user can get this warning even when the code is not optimized?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]