Bug 117486 - gcc incorrectly finds error in simple routine
Summary: gcc incorrectly finds error in simple routine
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 1
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-03-04 15:34 UTC by Joe Harrington
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-03-04 15:45:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joe Harrington 2004-03-04 15:34:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114 Galeon/1.3.11a

Description of problem:
The following file is good C, and compiles without errors under gcc32
and gcc296 in the FC1 release:

int finc(void){
return 1;
}

gcc 3.3.2 give this error:

% gcc -c finc.c
finc.c: In function `finc':
finc.c:2: error: syntax error before "return"

% gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

Adding an unused variable fixes it:

int finc(void){
int a;
return 1;
}

This compiles without errors.  However, replacing the "int" line with
a blank line gives the same error as before.

Version-Release number of selected component (if applicable):
gcc-3.3.2-1

How reproducible:
Always

Steps to Reproduce:
1. cat > finc.c <<EOF
int finc(void){
return 1;
}
EOF

2. gcc -c finc.c

    

Actual Results:  inc.c: In function `finc':
finc.c:2: error: syntax error before "return"


Expected Results:  compiled to finc.o without errors or other messages


Additional info:

gcc32 -c finc.c
gcc296 -c finc.c
both work

I'm rating this high because it breaks lots of existing code. 
Standard packages (e.g., HDF library) won't compile, etc.

--jh--

Comment 1 Jakub Jelinek 2004-03-04 15:45:40 UTC
Sorry, works for me just fine (tried gcc 3.3.2-1, 3.3.2-8).

Comment 2 Joe Harrington 2004-03-04 17:02:59 UTC
Interesting.  I just tried it on 2 other machines, and it works.  It
still fails on the first machine, even when I cut and paste out of my
bug report.  But, these three machines have identical FC1 installs,
and both do nightly updates with yum.  The gcc binaries are the same
size and date, though prelinking has changed their md5sums.
All report:

% /usr/bin/gcc --version
gcc (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

% rpm -q gcc
gcc-3.3.2-1

Clearly there is a problem, but I have no idea what it could be.  Do you?

--jh--


Comment 3 Joe Harrington 2004-03-24 21:23:24 UTC
The problem has been traced to a hardware issue that inserts bit
errors into files.

--jh--



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