This is the mail archive of the gcc-bugs@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]

Internal error in fix_lexical_addr


SYSTEM:
i686 Linux 2.2.5, libc 2.1.1

COMPILER VERSION:
austern@pizzelle% g++ -v
Reading specs from
/home/austern/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000112 (experimental)

SYMPTOM:
Compiling the following C++ file at -O2 gives an internal error.
The file compiles correctly at -O0.

austern@pizzelle% cat ts.cc
int index (int);
class X { };

struct Table {
  inline X& operator[] (int idx);
};

extern X* tab1;
extern Table tab2;

struct Y {
  explicit Y(int);
};

Y f (const X&);
inline Y f(int n) { return f(tab2[n]); }

inline X& Table::operator[] (int idx) {
  return tab1[index(idx)];
}

static void g(int n) {
  Y y = f(n);
}

static void h(int n) {
  Y y = f(n);
}
austern@pizzelle% g++ -c -O0 ts.cc
austern@pizzelle% g++ -c -O2 ts.cc
ts.cc: In function `void h (int)':
ts.cc:24: Internal compiler error in `fix_lexical_addr', at function.c:5339
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
austern@pizzelle%

				--Matt

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