Bug 65086 - ov511.c from kernel sources trips gcc
ov511.c from kernel sources trips gcc
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.3
alpha Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-17 02:44 EDT by Michal Jaegermann
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 16:16:14 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)
preprocessed file from Linux sources which bombs gcc on Alpha (81.05 KB, application/octet-stream)
2002-05-17 12:19 EDT, Michal Jaegermann
no flags Details

  None (edit)
Description Michal Jaegermann 2002-05-17 02:44:50 EDT
Description of Problem:

The following command (script) on Alpha

:
TOPDIR=/home/src/work/linux-2.4.18-4
OPT=-O2

cc -D__KERNEL__ -I$TOPDIR/include -Wall -Wstrict-prototypes \
-Wno-trigraphs $OPT -fomit-frame-pointer -fno-strict-aliasing \
-fno-common -Wno-unused -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6 \
-DMODULE -DMODVERSIONS -include $TOPDIR/include/linux/modversions.h \
-DKBUILD_BASENAME=ov511 -DEXPORT_SYMTAB -c ov511.c
exit

invariably ends up with

ov511.c: In function `ov51x_v4l1_open':
ov511.c:4697: Internal error: Segmentation fault.

Adjust TOPDIR, of course, and execute that from drivers/usb/ directory
after configuring sources.  This was from an attempt to recompile
patched sources for 2.4.18-4 on Alpha but "regular" 2.4.18 should do
as well.

After dropping OPT from '-O2' to '-O1' it is possible to recompile
ov511.c without troubles. None of remaining USB modules require such
manipulations to compile.

Version-Release number of selected component (if applicable):
gcc-2.96-101

How Reproducible:
Bombs every time.
Comment 1 Jakub Jelinek 2002-05-17 05:28:05 EDT
Please provide preprocessed testcase.
Comment 2 Michal Jaegermann 2002-05-17 12:17:48 EDT
Attached.  With a preprocessed file the following script will cause exception,
or not, depending on OPT settings:

OPT=-O2

cc  -Wall -Wstrict-prototypes \
-Wno-trigraphs $OPT -fomit-frame-pointer -fno-strict-aliasing \
-fno-common -Wno-unused -mno-fp-regs -ffixed-8 -mcpu=ev5 -Wa,-mev6 \
-c ov511.expanded.c
Comment 3 Michal Jaegermann 2002-05-17 12:19:12 EDT
Created attachment 57747 [details]
preprocessed file from Linux sources which bombs gcc on Alpha
Comment 4 Michal Jaegermann 2002-06-15 16:33:47 EDT
I am clearly not the first person bitten by this bug.  See, for example,
kernel Makefiles in 7.2 distribution for Alpha where source rpm contains
patches to compile ov511.c with -O3 and where comments note that this particular
file will compile with any level of optimization but -O2 due to register
assignments problems (bryce@redhat.com should know more on the subject).

That comment is indeed correct for a case of a "generic" kernel.  If you will
try platform specific kernels where one may get '-mcpu=ev67' (example and you
will get that for "Nautilus") then this bug resurfaces with -O3 and higher.

Setting EXTRA_FLAGS to '-O3 -mcpu=ev4' looks to be "safe".
Comment 5 Richard Henderson 2004-10-02 16:16:14 EDT
Appears to work with gcc 3.3.4.

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