[Bug tree-optimization/45180] bogus warning: array subscript is above array bounds

2017-10-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45180 Martin Sebor changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Bug tree-optimization/45180] bogus warning: array subscript is above array bounds

2010-08-04 Thread pinskia at gcc dot gnu dot org
--- Comment #3 from pinskia at gcc dot gnu dot org 2010-08-04 15:44 --- Since the compiler does not know that f() will never return, it is hard problem to solve. If you mark f with the attribute noreturn, the warning will disappear. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45

[Bug tree-optimization/45180] bogus warning: array subscript is above array bounds

2010-08-04 Thread joachim dot reichel at gmx dot de
--- Comment #2 from joachim dot reichel at gmx dot de 2010-08-04 15:00 --- Ok, I see. But that seems a bit unfortunate. Isn't there a great deal of such code? Just think of some vector class: c would be a class member, get() non-static and "if...f()" is an assert-like statement (that mi

[Bug tree-optimization/45180] bogus warning: array subscript is above array bounds

2010-08-04 Thread rguenth at gcc dot gnu dot org
--- Comment #1 from rguenth at gcc dot gnu dot org 2010-08-04 13:09 --- The reasoning of GCC goes as follows. There is a partial redundancy along the two invocations of get(), as c[i] is possibly clobbered by f(). So we transform g() to if (i >= 3) f(); tem1 = c[i]; if (i >=