Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39064 - gcc inline assembler errors
Summary: gcc inline assembler errors
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-22 12:00 UTC by James Graham
Modified: 2004-03-03 07:21 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
code to reproduce the error (gcc-inline.tar.bz2,22.99 KB, application/octet-stream)
2004-01-22 12:00 UTC, James Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Graham 2004-01-22 12:00:19 UTC
When compiling applications with inline assembly (mostly mmx/sse/3dnow) the
compiler bails out with this error (or close to it): 
can't find a register in class `BREG' while reloading `asm'
attached is the code that gives the error, thoug this example is only polling
the cpu for vender identification.

uname info:
Linux Dark 2.6.1-gentoo-r1 #1 Tue Jan 13 15:47:31 PST 2004 i686 AMD Athlon(tm)
Processor AuthenticAMD GNU/Linux
(nptl enabled)

gcc -v info:
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
Configured with: /var/tmp/portage/gcc-3.3.2-r5/work/gcc-3.3.2/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3
--includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib
--enable-languages=c,c++,f77,objc,java --enable-threads=posix --enable-long-long
--disable-checking --enable-cstdio=stdio --enable-clocale=generic
--enable-__cxa_atexit --enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3
--with-local-prefix=/usr/local --enable-shared --enable-nls
--without-included-gettext --x-includes=/usr/X11R6/include
--x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib
--with-x --disable-multilib
Thread model: posix
gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)

The command to invoke the error is:
gcc -DHAVE_CONFIG_H -I../.. -I../.. -I../../app -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include   -I/usr/local/include cpu-accel.c

attached are all the files needed to reproduce the error.
Comment 1 James Graham 2004-01-22 12:00:51 UTC
Created attachment 24250 [details]
code to reproduce the error
Comment 2 SpanKY gentoo-dev 2004-01-22 21:31:18 UTC
uhh, is this your source code ?

cause it works over here ;)
root@vapier 0 f # gcc -DHAVE_CONFIG_H -I../.. -I../.. -I../../app -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I/usr/local/include cpu-accel.c -c
root@vapier 0 f #

could you include some `emerge info` like the bug reporting page says to ?
chances are you should take -fPIC out of your CFLAGS :P
Comment 3 Alexander Gabert (RETIRED) gentoo-dev 2004-03-03 05:10:45 UTC
you either have hardened-gcc installed or fPIC in your CFLAGS

remove both please if any and report back, thanks, Alex ;-)
Comment 4 James Graham 2004-03-03 07:21:32 UTC
yes, the issue was hardened-gcc.  Somehow the default gcc profile disapeared, and an unmerge of hardened-gcc failed to leave a valid profile. luckly, i found a binary and was able to remove hcc.

bug should be closed.