Optimizer bug -- known?

Mike Oliver oliver@math.ucla.edu
Sat Mar 24 12:11:00 GMT 2001


Hi, I have a completely harmless piece of code that will not
compile optimized under g++2.95.2 or 2.95.3 .  The
compile command used was
  g++ -O3 -funroll-loops -fPIC -fno-for-scope -pipe   -c temp.cxx
The error output was 
  {standard input}: Assembler messages:
  {standard input}:324: Error: Symbol .LEHB1762 already defined.
  {standard input}:332: Error: Symbol .LEHE1762 already defined.
  {standard input}:339: Error: Symbol .LEHB1762 already defined.
  {standard input}:372: Error: Symbol .LEHE1762 already defined.

Removing -funroll-loops resolves the error.
Finally, here are the contents of temp.cxx:
  #include <vector>
  #include <algorithm>
  using namespace std;
  vector<unsigned> _tour;
  bool silly()
  {
      unsigned i;
      vector<unsigned> tt(_tour);
 
      sort(tt.begin(),tt.end());
 
      for (i=0;i<tt.size();i++)
      {
          if (tt[i]!=i)
          {
              return( false );
          }
      }
 
      return( true );
  }

Is this a known bug?  Will it be fixed in gcc3.0 ?  (It does seem
to be fixed in the gcc2.96 that shipped with Linux RedHat 7.0).



More information about the Gcc-bugs mailing list