Bug 65086

Summary: ov511.c from kernel sources trips gcc
Product: [Retired] Red Hat Linux Reporter: Michal Jaegermann <michal>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 20:16:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
preprocessed file from Linux sources which bombs gcc on Alpha none

Description Michal Jaegermann 2002-05-17 06:44:50 UTC
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 09:28:05 UTC
Please provide preprocessed testcase.

Comment 2 Michal Jaegermann 2002-05-17 16:17:48 UTC
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 16:19:12 UTC
Created attachment 57747 [details]
preprocessed file from Linux sources which bombs gcc on Alpha

Comment 4 Michal Jaegermann 2002-06-15 20:33:47 UTC
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 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 20:16:14 UTC
Appears to work with gcc 3.3.4.