[Bug optimization/13681] [tree-ssa] ICE in get_expr_operands with out-of-bounds access
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Thu Jan 15 22:17:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list