public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG
Date: Sat, 17 Mar 2007 16:58:00 -0000	[thread overview]
Message-ID: <20070317165802.6127.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31246-1902@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-17 16:58 -------
Lets look at the IR:
;; Function __gnu_debug::_Safe_iterator<_Iterator, _Sequence>::_Safe_iterator()
[with _Iterator = __gnu_cxx::__normal_iterator<int*, __gnu_norm::vector<int,
std::allocator<int> > >, _Sequence = __gnu_debug_def::vector<int,
std::allocator<int> >]
(_ZN11__gnu_debug14_Safe_iteratorIN9__gnu_cxx17__normal_iteratorIPiN10__gnu_norm6vectorIiSaIiEEEEEN15__gnu_debug_def6vectorIiS6_EEEC4Ev
*INTERNAL* )
;; enabled by -tree-original

{
  <<cleanup_point <<< Unknown tree: expr_stmt
  __base_ctor  (&((struct _Safe_iterator<__gnu_cxx::__normal_iterator<int*,
__gnu_norm::vector<int, std::allocator<int> > >,__gnu_debug_def::vector<int,
std::allocator<int> > > *) this)->D.12082) >>>
>>;
  try
    {
      <<cleanup_point <<< Unknown tree: expr_stmt
  __comp_ctor  (&((struct _Safe_iterator<__gnu_cxx::__normal_iterator<int*,
__gnu_norm::vector<int, std::allocator<int> > >,__gnu_debug_def::vector<int,
std::allocator<int> > > *) this)->_M_current) >>>
>>;
    }
  catch
    {
      __base_dtor  ((struct _Safe_iterator_base *) this);
    }
}


and the constructor for ->M_current:
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
__gnu_norm::vector<int, std::allocator<int> > >, __gnu_debug_def::vector<int,
std::allocator<int> > >::~_Safe_iterator() (this, __in_chrg)
{
  struct _Safe_iterator_base * this.102;

  [/usr/include/c++/4.0.0/debug/safe_iterator.h : 65] {
    [/usr/include/c++/4.0.0/debug/safe_iterator.h : 65] try
      {

      }
    finally
      {
        [/usr/include/c++/4.0.0/debug/safe_iterator.h : 65] this.102 = (struct
_Safe_iterator_base *) this;
        [/usr/include/c++/4.0.0/debug/safe_iterator.h : 65] __base_dtor 
(this.102);
      }
  }
  [/usr/include/c++/4.0.0/debug/safe_iterator.h : 65] <D12095>:;
}


So the constructor for that cannot throw so the catch part is removed in both
cases.

The warning is not strange and is correct in that the __base_dtor cannot be
called ever.


-- 


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


  reply	other threads:[~2007-03-17 16:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-17 16:38 [Bug libstdc++/31246] New: " sylvain dot pion at sophia dot inria dot fr
2007-03-17 16:58 ` pinskia at gcc dot gnu dot org [this message]
2007-03-17 17:27 ` [Bug libstdc++/31246] " sylvain dot pion at sophia dot inria dot fr
2007-03-17 17:46 ` chris at bubblescope dot net
2007-03-17 18:07 ` chris at bubblescope dot net
2007-03-17 20:41 ` pcarlini at suse dot de
2007-03-17 20:48 ` [Bug c++/31246] " pcarlini at suse dot de
2007-03-17 23:35 ` gdr at cs dot tamu dot edu
2007-03-18  5:38 ` pinskia at gcc dot gnu dot org
2007-03-19 13:56 ` manu at gcc dot gnu dot org
2007-03-19 15:19 ` gdr at cs dot tamu dot edu
2007-03-19 22:31 ` pinskia at gcc dot gnu dot org
2007-03-19 22:45   ` Gabriel Dos Reis
2007-03-19 22:45 ` gdr at cs dot tamu dot edu
2007-03-19 23:13 ` manu at gcc dot gnu dot org
2007-03-19 23:19 ` pinskia at gcc dot gnu dot org
2007-03-19 23:35 ` manu at gcc dot gnu dot org
2007-03-19 23:40 ` gdr at cs dot tamu dot edu
2007-03-19 23:43 ` pcarlini at suse dot de
2008-08-23 16:00 ` manu at gcc dot gnu dot org
2008-08-23 16:02 ` manu at gcc dot gnu dot org
2008-08-23 16:14 ` manu at gcc dot gnu dot org
2008-08-23 16:23 ` manu at gcc dot gnu dot org
2008-08-23 17:25 ` manu at gcc dot gnu dot org
2008-08-23 18:44 ` paolo dot carlini at oracle dot com
2008-08-23 18:46 ` [Bug c++/31246] Strange -Wunreachable-code warnings paolo dot carlini at oracle dot com
2008-08-23 18:51 ` [Bug c++/31246] -Wunreachable-code warnings for compiler-generated code manu at gcc dot gnu dot org
2008-08-26  5:46 ` gdr at integrable-solutions dot net
2008-10-22  8:36 ` manu at gcc dot gnu dot org
2009-02-07 21:07 ` manu at gcc dot gnu dot org
2009-07-07 22:19 ` manu at gcc dot gnu dot org
2009-07-07 22:20 ` manu 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=20070317165802.6127.qmail@sourceware.org \
    --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).