Bug 440139

Summary: gcc crashes while compiling Wine with optimization turned on
Product: [Fedora] Fedora Reporter: Michael Stefaniuc <mstefani>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: andreas.bierfert, dwrobel, good_bye300, hongbo, jreiser, justin.venus, linux_bugs, mail2benny, nospam, rankincj, roel, rom, ruslanpisarev, samlb, trevor.davenport, zboszor
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
URL: http://www.winehq.org/site/download/
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-03 09:25:41 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 C code of Wine's source file dlls/user32/tests/menu.c none

Description Michael Stefaniuc 2008-04-01 21:09:22 UTC
Description of problem:
gcc crashes while compiling Wine's dlls/user32/tests/menu.c file:
predeal:~/j/wine/build/wine/dlls/user32/tests$ make
gcc -c -I../../../../../source/wine/dlls/user32/tests -I.
-I../../../../../source/wine/include -I../../../include   -D_REENTRANT -fPIC
-Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings
-Wtype-limits -Wpointer-arith  -g -O2  -o menu.o
../../../../../source/wine/dlls/user32/tests/menu.c
{standard input}: Assembler messages:
{standard input}:7400: Warning: end of file not at end of a line; newline inserted
{standard input}:7732: Error: bad register name `%'
gcc: Internal error: Segmentation fault (program cc1)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.

No /tmp/cc* files are generated. With -save-temps instead of -pipe a
corrupt/unfinished menu.s gets generated. Size of the unfinished menu.s  varies
depending on the optimization level aka -O, -O2 and -O3.

The crash can be reproduced also with the preprocessed menu.i (attached).
"gcc -c -O -o menu.o menu.i" is enough to reproduce the problem.

There is no crash with disabled optimization. The code compiles fine on an
up2date RHEL5 as well as an up2date F8.


Version-Release number of selected component (if applicable):
gcc-4.3.0-5.i386

How reproducible:
Always

Steps to Reproduce:
1. Build Wine version 0.9.58 or any later checkout from git, or
2. "gcc -c -O -o menu.o menu.i" of the attached menu.i file.
3.
  
Actual results:
Segfault while writing out the assembler code.

Expected results:
Successful compilation of the file.

Additional info:
This is on an up2date F9/Rawhide on a 4 year old OptiPlex GX270 with a P4 2.8
GHz with HT enabled and running a SMP kernel:
Linux predeal 2.6.25-0.177.rc7.git6.fc9.i686 #1 SMP Mon Mar 31 13:30:54 EDT 2008
i686 i686 i386 GNU/Linux
The box has 1 GB RAM with 2GB swap.

Comment 1 Michael Stefaniuc 2008-04-01 21:09:22 UTC
Created attachment 299969 [details]
Preprocessed C code of  Wine's source file dlls/user32/tests/menu.c

Comment 2 Michael Stefaniuc 2008-04-01 21:13:51 UTC
Looks like bugzilla has gzip the attachment a second time. Sorry about that. 

Comment 3 Jakub Jelinek 2008-04-03 09:25:41 UTC
Tracking this upstream.

Comment 4 Jakub Jelinek 2008-04-18 22:27:37 UTC
*** Bug 443165 has been marked as a duplicate of this bug. ***

Comment 5 Jakub Jelinek 2008-04-22 14:54:55 UTC
*** Bug 443536 has been marked as a duplicate of this bug. ***

Comment 6 Andreas Bierfert 2008-05-13 11:37:01 UTC
Is there any news on this? I see that there still is some discussion in upstream
#35204. What would be the recommended way to go because wine still fails on >=F9
and thus effectively blocks updates for F7,F8 as well.

Comment 7 John Reiser 2008-05-13 13:58:06 UTC
(In reply to comment #6)
For a work-around, then compile menu.c without "-O2".  I do it by hand, but it
could be automated by adding an explicit target for menu.o to the Makefile, and
editing CC_FLAGS to delete the "-O2" before invoking the compiler.


Comment 8 Jakub Jelinek 2008-05-19 10:39:26 UTC
You can just compile menu.c with -O2 -fno-tree-fre -fno-tree-pre as workaround,
see PR35204.

Comment 9 Jakub Jelinek 2008-05-19 10:39:42 UTC
*** Bug 447281 has been marked as a duplicate of this bug. ***

Comment 10 Jakub Jelinek 2008-05-20 16:28:46 UTC
*** Bug 447584 has been marked as a duplicate of this bug. ***

Comment 11 Jakub Jelinek 2008-05-29 07:48:11 UTC
*** Bug 448868 has been marked as a duplicate of this bug. ***

Comment 12 Jakub Jelinek 2008-05-29 16:54:53 UTC
*** Bug 445494 has been marked as a duplicate of this bug. ***

Comment 13 Jakub Jelinek 2008-06-15 22:39:45 UTC
*** Bug 451420 has been marked as a duplicate of this bug. ***

Comment 14 Jakub Jelinek 2008-07-14 14:18:30 UTC
*** Bug 455177 has been marked as a duplicate of this bug. ***

Comment 15 Jakub Jelinek 2008-07-16 07:18:55 UTC
*** Bug 455549 has been marked as a duplicate of this bug. ***

Comment 16 Jakub Jelinek 2008-08-13 09:15:41 UTC
*** Bug 458903 has been marked as a duplicate of this bug. ***

Comment 17 Fred Wittekind IV 2008-08-13 13:28:10 UTC
Upstream 35811 marked RESOLVED / DUPLICATE of bug 35204 2008-04-03 09:53
Upstream 35204 marked RESOLVED / FIXED 2008-05-20 20:58

Is it possible now to get this patch included an updated package for Fedora 9?

Comment 18 Jakub Jelinek 2008-08-29 07:18:59 UTC
*** Bug 460569 has been marked as a duplicate of this bug. ***

Comment 19 Jakub Jelinek 2008-08-29 07:19:35 UTC
*** Bug 459913 has been marked as a duplicate of this bug. ***

Comment 20 Jakub Jelinek 2008-10-20 06:33:28 UTC
*** Bug 456790 has been marked as a duplicate of this bug. ***

Comment 21 Jakub Jelinek 2008-10-20 06:33:43 UTC
*** Bug 467543 has been marked as a duplicate of this bug. ***

Comment 22 Jakub Jelinek 2008-10-31 16:54:42 UTC
*** Bug 468909 has been marked as a duplicate of this bug. ***

Comment 23 Fedora Update System 2009-02-24 20:40:38 UTC
wine-1.1.14-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.