public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug optimization/13681] [tree-ssa] ICE in get_expr_operands with out-of-bounds access
Date: Thu, 15 Jan 2004 22:17:00 -0000	[thread overview]
Message-ID: <20040115221754.14460.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040114153700.13681.bangerth@dealii.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


  parent reply	other threads:[~2004-01-15 22:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14 15:37 [Bug optimization/13681] New: " bangerth at dealii dot org
2004-01-14 22:38 ` [Bug optimization/13681] " pinskia at gcc dot gnu dot org
2004-01-15 22:17 ` bangerth at dealii dot org [this message]
2004-01-16 10:06 ` steven at gcc dot gnu dot org
2004-01-16 12:13 ` steven at gcc dot gnu dot org
2004-01-16 12:48 ` steven at gcc dot gnu dot org
2004-01-21 22:17 ` rth at gcc dot gnu dot org
2004-01-21 22:37 ` bangerth at dealii dot org
2004-01-22  0:05 ` rth at redhat dot com
2004-01-22  0:10 ` bangerth at dealii dot org
2004-01-22  1:58 ` cvs-commit at gcc dot gnu dot org
2004-01-22  2:16 ` rth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040115221754.14460.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).