public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lloyd at randombit dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/44018]  New: Using cpuid.h, can't find a register in class 'CLOBBERED_REGS' while reloading 'asm'
Date: Thu, 06 May 2010 22:53:00 -0000	[thread overview]
Message-ID: <bug-44018-6477@http.gcc.gnu.org/bugzilla/> (raw)

I have some code (will be attached) that fails to compile with GCC 4.5.0 if you
use the exact right (wrong) flags:

$ g++-4.5.0 -fPIC -m32 -O2 -c cpuid.cpp -o cpuid.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/cpuid.h: In function 'unsigned
int get_x86_cache_line_size()':
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/cpuid.h:179:52: error: can't
find a register in class 'CLOBBERED_REGS' while reloading 'asm'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/cpuid.h:179:52: error: 'asm'
operand has impossible constraints
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/cpuid.h:179:52: error: 'asm'
operand has impossible constraints
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/cpuid.h:179:52: error: 'asm'
operand has impossible constraints

If not using -fPIC, or if using -O instead of -O2, it compiles. This code
compiles with the same flags (and any other permutation I've thought to try)
with GCC 4.3.1 and 4.4.3. As far as I know the code is valid. I've pruned it
down as much as I could.

$ g++-4.5.0 -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/portage/sys-devel/gcc-4.5.0/work/gcc-4.5.0/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.0
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.0/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --with-ppl --with-cloog --disable-lto --enable-nls
--without-included-gettext --with-system-zlib --disable-checking
--disable-werror --enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-libgomp --enable-cld
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.0/python
--disable-libgcj --enable-languages=c,c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.0 p1.0'
Thread model: posix
gcc version 4.5.0 (Gentoo 4.5.0 p1.0) 

This is the Gentoo build of GCC 4.5.0, but I've checked the packaging; there
are no noticeable patches being applied to the 4.5.0 sources, so I think this
is a problem in vanilla 4.5.0.


-- 
           Summary: Using cpuid.h, can't find a register in class
                    'CLOBBERED_REGS' while reloading 'asm'
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lloyd at randombit dot net
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44018


             reply	other threads:[~2010-05-06 22:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 22:53 lloyd at randombit dot net [this message]
2010-05-06 22:54 ` [Bug inline-asm/44018] " lloyd at randombit dot net
2010-05-07  0:30 ` hjl dot tools at gmail dot com
2010-05-07 10:11 ` rguenth at gcc dot gnu dot org
2010-05-07 12:20 ` ubizjak at gmail dot com
2010-05-07 13:09 ` hjl dot tools at gmail dot com
2010-05-11 13:29 ` [Bug inline-asm/44018] [4.5/4.6 Regression] " rguenth at gcc dot gnu dot org
2010-05-19 12:55 ` rguenth at gcc dot gnu dot org
2010-05-26 10:04 ` jakub at gcc dot gnu dot org
2010-07-25  1:50 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-44018-6477@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).