Bug 36986 - Tree check error in gcc
Tree check error in gcc
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-21 11:11 EDT by Mikulas Patocka
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-04-25 12:45:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mikulas Patocka 2001-04-21 11:11:59 EDT
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.)
Comment 1 Jakub Jelinek 2001-04-24 12:26:36 EDT
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.
Comment 2 Mikulas Patocka 2001-04-24 18:07:41 EDT
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
Comment 3 Jakub Jelinek 2001-04-25 12:45:09 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.