public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Matthias Klose <doko@net.local>
To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org
Subject: c++/9789: [3.2 ICE regression, fixed in 3.3] Error reporting routines re-entered
Date: Fri, 21 Feb 2003 17:16:00 -0000	[thread overview]
Message-ID: <E18mGdm-0001ZG-00@tango.net.local> (raw)


>Number:         9789
>Category:       c++
>Synopsis:       [3.2 ICE regression, fixed in 3.3] Error reporting routines re-entered
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 21 17:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     "H. S. Teoh" <hsteoh@quickfur.ath.cx>
>Release:        3.2.2 (Debian) (Debian unstable)
>Organization:
The Debian Project
>Environment:
System: Debian GNU/Linux (unstable)
Architecture: i686
host: i386-linux
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20021212 (Debian prerelease)
>Description:
[ Reported to the Debian BTS as report #180937.
  Please CC 180937@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/180937 ]

A regression from 2.95, fixed in 3.3:

/*
 * g++ 3.2 bug in handling switch statements that contain object declarations
 * constructed using objects declared outside the switch.
 */

class common { };

class someclass {
public:
  someclass(common *c) { }
  ~someclass() { }
};

class someotherclass {
public:
  someotherclass(common *c) { }
  ~someotherclass() { }
};

int main(int argc, char *argv[]) {
  enum { CHOICE_A, CHOICE_B } choice = CHOICE_A;
  common commonobj;

  switch (choice) {
  case CHOICE_A:
    someclass obj1(&commonobj);
    // do something
    break;
  case CHOICE_B:
    someotherclass obj2(&commonobj);
    // do something
    break;
  default:
    break;
  }
}

class common { };

class someclass {
public:
  someclass(common *c) { }
  ~someclass() { }
};

class someotherclass {
public:
  someotherclass(common *c) { }
  ~someotherclass() { }
};

int main(int argc, char *argv[]) {
  enum { CHOICE_A, CHOICE_B } choice = CHOICE_A;
  common commonobj;

  switch (choice) {
  case CHOICE_A:
    someclass obj1(&commonobj);

    break;
  case CHOICE_B:
    someotherclass obj2(&commonobj);

    break;
  default:
    break;
  }
}

$ g++-3.2 bug-180937.cc          
bug-180937.cc: In function `int main(int, char**)':
bug-180937.cc:29: jump to case label
bug-180937.cc:26:   crosses initialization of `someclass obj1'
bug-180937.cc:33: jump to case label
bug-180937.cc:30:   crosses initialization of `someotherclass obj2'
bug-180937.cc:26:   crosses initialization of `someclass obj1'

Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


both g++-2.95.3 and current 3.3 don't ICE.

	
>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-02-21 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-21 17:16 Matthias Klose [this message]
2003-02-21 17:46 bangerth

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=E18mGdm-0001ZG-00@tango.net.local \
    --to=doko@net.local \
    --cc=180937@bugs.debian.org \
    --cc=debian-gcc@lists.debian.org \
    --cc=gcc-gnats@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).