public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Audley <paudley@compbio.dundee.ac.uk>
To: gcc-help@gcc.gnu.org
Subject: Possible bug in C++, can someone else verify?
Date: Wed, 17 Sep 2003 16:15:00 -0000	[thread overview]
Message-ID: <w4an0d32xz6.fsf@ant.compbio.dundee.ac.uk> (raw)


With a recent debian gcc (3.3.2 20030908) we can no longer compile a
bit of code with optimizations.  Can someone else verify that this
fails with 3.3.2 or a newer compiler?  3.3 seems to work perfectly for
me.

Is this valid C++?

----------8<-----------------------------
#include <vector>

struct blc_offset {
  long start;
};

int main(void) {
  std::vector<blc_offset> vec;
  blc_offset b_off;
  b_off.start = 1;
  vec.push_back( b_off );
  vec[0].start = vec[0].start == 0 ? 0 : vec[0].start - 1;    
}
---------------------->8-----------------


when compiled with v3.3 at -O3 it runs fine, on v3.3.2 (debian
pre-release) it hangs in stl_vector.h somewhere in the template.

                                      Thanks,
                                        Patrick.


-- 
Patrick Audley                          paudley@compbio.dundee.ac.uk
Computational Biology & Bioinformatics  http://www.compbio.dundee.ac.uk
University of Dundee                    http://blackcat.ca
Dundee, Scotland                        +44 1382 348721

                 reply	other threads:[~2003-09-17 16:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=w4an0d32xz6.fsf@ant.compbio.dundee.ac.uk \
    --to=paudley@compbio.dundee.ac.uk \
    --cc=gcc-help@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).