Bug 23743 - 4.0.2 snapshot fails to compile valid inline asm with >= -O1
Summary: 4.0.2 snapshot fails to compile valid inline asm with >= -O1
Status: RESOLVED DUPLICATE of bug 11203
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2005-09-05 22:09 UTC by Mark Loeser
Modified: 2005-09-05 22:19 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:

Preprocessed output (2.26 KB, text/plain)
2005-09-05 22:11 UTC, Mark Loeser

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Loeser 2005-09-05 22:09:51 UTC
birdbath ~ # gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with:
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.0.2-beta20050901
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.0.2-beta20050901 (Gentoo 4.0.2_beta20050901)

Failed compile:
 i686-pc-linux-gnu-gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
-DUSE_ASMBLIT -I./hermes -I../../src/hermes -DALSA_SUPPORT
-DESD_DYNAMIC=libesd.so.0 -DENABLE_X11 -DXTHREADS -I./include -I./src/video
-DHAVE_LINUX_VERSION_H -I../../include -I../../include/SDL -I../../src
-I../../src/main/linux -I../../src/audio -I../../src/video
-I../../src/video/XFree86/extensions -I../../src/events -I../../src/joystick
-I../../src/cdrom -I../../src/thread -I../../src/timer -I../../src/endian
-I../../src/file -I../../src/thread -c SDL_yuv_mmx.c  -fPIC -DPIC -o
i686-pc-linux-gnu-gcc: warning: -pipe ignored because -save-temps specified
SDL_yuv_mmx.c: In function 'ColorRGBDitherYV12MMX1X':
SDL_yuv_mmx.c:113: error: can't find a register in class 'GENERAL_REGS' while
reloading 'asm'

When -O0 is used, the compile finishes successfully.  This seems similar to bug
#22362 but the patch Jakub has on there does not resolve this issue.
Comment 1 Mark Loeser 2005-09-05 22:11:36 UTC
Created attachment 9671 [details]
Preprocessed output
Comment 2 Andrew Pinski 2005-09-05 22:13:57 UTC
Lets count the register usage:

there are 5, plus PIC register that make 6 and then there is the frame pointer, that makes 7 which is too 
many for x86 so this is not a GCC bug.
Comment 3 Andrew Pinski 2005-09-05 22:19:38 UTC
Reopening for a second to ...
Comment 4 Andrew Pinski 2005-09-05 22:19:58 UTC
Close as a dup of bug 11203.

*** This bug has been marked as a duplicate of 11203 ***