public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "leif at rdos dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/55712] cpuinfo.c doesn't compile for x86-64 with medium memory model
Date: Sun, 23 Dec 2012 22:50:00 -0000	[thread overview]
Message-ID: <bug-55712-4-yfHG1EyHLe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-55712-4@http.gcc.gnu.org/bugzilla/>


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

Leif Ekblad <leif at rdos dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29038|0                           |1
        is obsolete|                            |

--- Comment #3 from Leif Ekblad <leif at rdos dot net> 2012-12-23 22:49:53 UTC ---
Comment on attachment 29038
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29038
Save rbx and use another file for ebx parameter to cpuid

>diff -crNB gcc-4.8-20121216/gcc/config/i386/cpuid.h gcc-work/gcc/config/i386/cpuid.h
>*** gcc-4.8-20121216/gcc/config/i386/cpuid.h	2012-10-26 11:45:46.000000000 +0200
>--- gcc-work/gcc/config/i386/cpuid.h	2012-12-23 23:06:08.000000000 +0100
>***************
>*** 166,171 ****
>--- 166,189 ----
>  	   : "0" (level), "2" (count))
>  #endif
>  #else
>+ 
>+ #if defined(__x86_64__) && defined(__PIC__)
>+ #define __cpuid(level, a, b, c, d)			\
>+   __asm__ ("pushq %%rbx\n\t"        \
>+ 	   "cpuid\n\t"					\
>+ 	   "movl %%ebx, %1\n\t"         \
>+ 	   "popq %%rbx\n\t"             \
>+ 	   : "=a" (a), "=r" (b), "=c" (c), "=d" (d)	\
>+ 	   : "0" (level))
>+ 
>+ #define __cpuid_count(level, count, a, b, c, d)		\
>+   __asm__ ("pushq %%rbx\n\t"        \
>+ 	   "cpuid\n\t"					\
>+ 	   "movl %%ebx, %1\n\t"         \
>+ 	   "popq %%rbx\n\t"             \
>+ 	   : "=a" (a), "=r" (b), "=c" (c), "=d" (d)	\
>+ 	   : "0" (level), "2" (count))
>+ #else
>  #define __cpuid(level, a, b, c, d)			\
>    __asm__ ("cpuid\n\t"					\
>  	   : "=a" (a), "=b" (b), "=c" (c), "=d" (d)	\
>***************
>*** 176,181 ****
>--- 194,200 ----
>  	   : "=a" (a), "=b" (b), "=c" (c), "=d" (d)	\
>  	   : "0" (level), "2" (count))
>  #endif
>+ #endif
>  
>  /* Return highest supported input value for cpuid instruction.  ext can
>     be either 0x0 or 0x8000000 to return highest supported value for


  parent reply	other threads:[~2012-12-23 22:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-16  9:30 [Bug libgcc/55712] New: " leif at rdos dot net
2012-12-23 22:38 ` [Bug libgcc/55712] " leif at rdos dot net
2012-12-23 22:47 ` leif at rdos dot net
2012-12-23 22:50 ` leif at rdos dot net [this message]
2012-12-23 22:51 ` leif at rdos dot net
2012-12-24 15:43 ` [Bug target/55712] " ubizjak at gmail dot com
2012-12-24 17:53 ` leif at rdos dot net
2012-12-27  8:12 ` ubizjak at gmail dot com
2013-01-03 17:17 ` uros at gcc dot gnu.org
2013-01-06  8:46 ` uros at gcc dot gnu.org
2013-01-06  9:16 ` ubizjak at gmail dot com

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-55712-4-yfHG1EyHLe@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).