This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13681] [tree-ssa] ICE in get_expr_operands with out-of-bounds access
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2004 22:17:54 -0000
- Subject: [Bug optimization/13681] [tree-ssa] ICE in get_expr_operands with out-of-bounds access
- References: <20040114153700.13681.bangerth@dealii.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-01-15 22:17 -------
I should add that the problem is not easily worked around, as it may
seem at first glance. I have this code on code-paths that are not
taken when the size of the array is smaller than the index. For example
here:
---------------------
void f();
template <int N> struct X {
double values[N];
double & foo (const unsigned int index)
{ return values[index]; }
};
template <int N> void foo() {
double d;
X<N> h1;
if (N<=2)
f();
h1.foo(2) = d;
}
template void foo<2>();
----------------------------
f() is a no-return function, but unfortunately the author forgot
to mark it as that. Now, it is quite impressive to see that
gcc doesn't ICE any more once I mark f() as noreturn, but the
present behavior is annoying nevertheless. It triggers at least
half a dozen times in my code :-(
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13681