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 optimization/13681] [tree-ssa] ICE in get_expr_operands with out-of-bounds access


------- 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


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