[Bug c++/41847] warning: array subscript is above array bounds

2017-02-07 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41847

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |RESOLVED
 CC||msebor at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #8 from Martin Sebor  ---
With the top of trunk (GCC 7) the test case from attachment 18916 compiles
cleanly both with a s390x cross-compiler and natively on x86_64:

$ /build/s390x-linux/gcc-trunk/gcc/xgcc -B /build/s390x-linux/gcc-trunk/gcc -O2
-S -Wall -Wextra t.C
t.C: In instantiation of ‘void ImplHomMatrixTemplate<_RowSize>::ludcmp(short
unsigned int*) [with unsigned int _RowSize = 4]’:
t.C:89:21:   required from here
t.C:62:36: warning: unused parameter ‘nIndex’ [-Wunused-parameter]
  void ludcmp(unsigned short nIndex[])
^

Resolving as fixed.

[Bug c++/41847] warning: array subscript is above array bounds

2012-01-19 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41847

Paolo Carlini  changed:

   What|Removed |Added

 CC|gcc-bugs at gcc dot gnu.org |

--- Comment #7 from Paolo Carlini  2012-01-19 
23:35:18 UTC ---
Jakub, is this still an issue?


[Bug c++/41847] warning: array subscript is above array bounds

2011-10-15 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41847

--- Comment #6 from Paolo Carlini  2011-10-15 
21:30:07 UTC ---
Should this be target or middle-end instead of c++? (I have no easy way to
check whether it's still an issue today)


[Bug c++/41847] warning: array subscript is above array bounds

2009-10-31 Thread caolanm at redhat dot com


--- Comment #5 from caolanm at redhat dot com  2009-10-31 17:59 ---
bug 41892 now logged for the concrete runtime problem I'm encountering.


-- 


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



[Bug c++/41847] warning: array subscript is above array bounds

2009-10-27 Thread caolanm at redhat dot com


--- Comment #4 from caolanm at redhat dot com  2009-10-27 20:17 ---
At runtime of the original version of one of these loops (or a similar one, I
decided for ease to boil down to the warning case for this bug) goes way past
the RowSpan limits. If this one is cosmetic, then I've got another more
difficult to extract one to do.


-- 


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



[Bug c++/41847] warning: array subscript is above array bounds

2009-10-27 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2009-10-27 16:53 ---
The issue is that for some strange reason VRP sees the loop iterator (which is
[0, 4) ) as VARYING.  Then the fDum = get(b, b) is called when
b is not 3, and get uses the return maLine[nRow].get(nColumn); for nRow < 3.
So, VRP figures that in return mpLine->get(nColumn); nColumn (== b) is
necessarily [4, 65535] and reports out of bounds access on something that will
really never be executed.
If VRP figured that b is [0, 4), it would have been able to tell that the bb's
are unreachable and not report diagnostics in that case.

I wonder what related runtime failure you are talking about though, this to me
looks like a false positive on something that is never executed (although not
optimized out at least until *.optimized dump).


-- 


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



[Bug c++/41847] warning: array subscript is above array bounds

2009-10-27 Thread jakub at gcc dot gnu dot org


--- Comment #2 from jakub at gcc dot gnu dot org  2009-10-27 16:33 ---
Reproduceable on today's trunk as well (s390x-linux target).


-- 


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



[Bug c++/41847] warning: array subscript is above array bounds

2009-10-27 Thread caolanm at redhat dot com


--- Comment #1 from caolanm at redhat dot com  2009-10-27 14:47 ---
Created an attachment (id=18916)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18916&action=view)
standalone demo

gcc -Wall -O2 -c demo.cxx


-- 


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