public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "markus at trippelsdorf dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53011] ice in verify_loop_structure: bad sizes
Date: Mon, 16 Apr 2012 19:36:00 -0000	[thread overview]
Message-ID: <bug-53011-4-AlUkETyWZj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53011-4@http.gcc.gnu.org/bugzilla/>

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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-04-16 19:35:42 UTC ---
Somewhat reduced:

 % cat test.ii
extern "C" class WvFastString;
typedef WvFastString& WvStringParm;
struct WvFastString {
  ~WvFastString();
  operator char* () {}
};
class WvString : WvFastString {};
class WvAddr {};
class WvIPAddr : WvAddr {};
struct WvIPNet : WvIPAddr {
  bool is_default() {}
};
template<class T, bool> struct WvTraits_Helper {
  static void release(T *obj) {
    delete obj;
  }
};
template<class From> struct WvTraits {
  static void release(From *obj) {
    WvTraits_Helper<From, 0>::release(obj);
  }
};
struct WvLink {
  void   *data;
  WvLink *next;
  bool    autofree;
  WvLink(bool, int) : autofree() {}
  bool get_autofree() {}

  void unlink() {
    delete this;
  }
};
struct WvListBase {
  WvLink head, *tail;
  WvListBase() : head(0, 0) {}
};
template<class T> struct WvList : WvListBase {
  ~WvList() {
    zap();
  }

  void zap(bool destroy = 1) {
    while (head.next) unlink_after(&head, destroy);
  }

  void unlink_after(WvLink *after, bool destroy) {
    WvLink *next = 0;
    T *obj       = (destroy && next->get_autofree()) ? 
                   static_cast<T*>(next->data) : 0;

    if (tail) tail = after;
    next->unlink();
    WvTraits<T>::release(obj);
  }
};
typedef WvList<WvString>WvStringListBase;
class WvStringList : WvStringListBase {};
class WvSubProc {
  WvStringList last_args, env;
};
void addroute(WvIPNet& dest, WvStringParm table) {
  if (dest.is_default() || (table != "default")) WvSubProc checkProc;
}

 % g++ -c -O1 test.ii
test.ii: In function ‘void addroute(WvIPNet&, WvStringParm)’:
test.ii:64:1: internal compiler error: Segmentation fault


  reply	other threads:[~2012-04-16 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 18:33 [Bug c++/53011] New: " dcb314 at hotmail dot com
2012-04-16 19:36 ` markus at trippelsdorf dot de [this message]
2012-04-16 20:00 ` [Bug c++/53011] " markus at trippelsdorf dot de
2012-04-17  8:51 ` [Bug rtl-optimization/53011] [4.8 Regression] " rguenth at gcc dot gnu.org
2012-04-17 11:07 ` rguenth at gcc dot gnu.org
2012-04-17 13:49 ` rguenth at gcc dot gnu.org
2012-04-17 13:49 ` rguenth at gcc dot gnu.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=bug-53011-4-AlUkETyWZj@http.gcc.gnu.org/bugzilla/ \
    --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).