This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Possible bug in C++, can someone else verify?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]