Skip to content

Dragonegg miscompiles dlls/d3dx9_36/tests/math.c from Wine #11012

@llvmbot

Description

@llvmbot
Bugzilla Link 10640
Version 2.9
OS Linux
Depends On llvm/llvm-bugzilla-archive#10704
Blocks llvm/llvm-bugzilla-archive#10682
Attachments llvm preprocessed, gcc preprocessed, reduced testcase
Reporter LLVM Bugzilla Contributor

Extended Description

Dragonegg can compile wine successfully, aside from http://bugs.winehq.org/show_bug.cgi?id=28050. Running its test suite, however, shows a few problems.

To reproduce, compile wine with:
$ CC=llvm-gcc ./configure
$ make

then run the test:
$ cd dlls/d3dx9_36/tests
$ make math.ok

this will fail:
llvm-gcc -c -I. -I. -I../../../include -I../../../include -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wtype-limits -Wwrite-strings -Wpointer-arith -Wlogical-op -g -O2 -o math.o math.c
../../../tools/winegcc/winegcc -B../../../tools/winebuild --sysroot=../../.. -fasynchronous-unwind-tables asm.o core.o effect.o line.o math.o mesh.o shader.o surface.o texture.o rsrc.res testlist.o -o d3dx9_36_test.exe.so ../../../libs/port/libwine_port.a -ld3dx9 -ld3d9 -luser32 -lgdi32
../../../tools/runtest -q -P wine -M d3dx9_36.dll -T ../../.. -p d3dx9_36_test.exe.so math.c && touch math.ok
fixme:d3dx:D3DXQuaternionLn The quaternion (0.200000, 0.100000, 0.300000, 0.900000) has a norm <1. This should not happen. Windows returns a result anyway. This case is not implemented yet.
math.c:2278: Test failed: Got ffff, expected 7fff or 7fff for index 18.
math.c:2278: Test failed: Got 7fff, expected ffff or ffff for index 19.
make: *** [math.ok] Error 2

compiling math.c with gcc, or using -O0 instead of 01/02 works around the issue. I'll attach preprocessed source files from llvm-gcc and gcc (versions below), as well as a reduced down version of math.c that more clearly shows the problem. If more info is needed, please don't hesitate to ask.

austin@debian:~/wine-llvmgcc/dlls/crypt32/tests$ llvm-gcc --version
gcc-4.5 (Debian 4.5.3-3) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

austin@debian:~/wine-llvmgcc/dlls/crypt32/tests$ gcc --version
gcc (Debian 4.4.6-7) 4.4.6
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillamiscompilationobsoleteIssues with old (unsupported) versions of LLVMwontfixIssue is real, but we can't or won't fix it. Not invalid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions