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.
Please provide preprocessed testcase.
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
Created attachment 57747 [details] preprocessed file from Linux sources which bombs gcc on Alpha
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".
Appears to work with gcc 3.3.4.