From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16 i586; Nav) When passing bogus parameters to inline function, gcc 2.96-80 reports internal 'tree check' error. Reproducible: Always Steps to Reproduce: 1. Create file bug.c: __inline__ g(int x) { } f() { g(blablabla); } 2. Compile it gcc -O bug.c Actual Results: compiler output: bug.c: In function `f': bug.c:7: `blablabla' undeclared (first use in this function) bug.c:7: (Each undeclared identifier is reported only once bug.c:7: for each function it appears in.) bug.c:7: Tree check: expected class 't', have 'x' (error_mark) bug.c:7: confused by earlier errors, bailing out Expected Results: expected output: bug.c: In function `f': bug.c:7: `blablabla' undeclared (first use in this function) bug.c:7: (Each undeclared identifier is reported only once bug.c:7: for each function it appears in.)
Are you sure this is gcc-2.96-80? None of 2.96-40+ rpms are built with tree checking, so they cannot generate such ICE. Anyway, I cannot reproduce it even with --enable-checking=tree compiler, neither in 2.96-8x, nor on gcc-3_0-branch, nor on gcc HEAD.
It's not original RPM. I actually brought gcc 2.96-80 SRPM to redhat 7.1 system, applied patches with rpm -bp, copied the tree to my own machine and compiled it with ./configure, make, make install. That's because I do not want to completely overwrite my partition with redhat 7.1 installation. The only option I gave to ./configure was --disable-nls. I compiled gcc-2.96-80 with itself, given flags -O2 (or -O3, I don't remember) -mpentium -fomit-frame-pointer -mpreferred-stack-boundary=2. BTW. tree checking is default setting. cd /usr/src/gcc-2.96-80/gcc ./configure --help --enable-checking[=LIST] enable expensive run-time checks. With LIST, enable only specific categories of checks. Categories are: misc,tree,rtl,gc,gcac; default is misc,tree,gc BTW2: I tried 20010423 snapshot compiled with --enable-checking=misc,tree,rtl,gc,gcac. Under the same conditions (function is inline, optimization used) it writes "blablabla undeclared; confised by earlier errors, bailing out", but no "tree check". Without inline function, it reports "blablabla undeclared" error and goes on. Mikulas
Oh, I see it in gcc HEAD. Should be fixed by http://gcc.gnu.org/ml/gcc-patches/2001-04/msg01207.html and I'll include the patch into 2.96-82.