public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386]: Fix PR 63966, inconsistent operand constraints compiling libcpp
@ 2014-11-19 21:43 Uros Bizjak
  2014-11-20 12:26 ` Uros Bizjak
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2014-11-19 21:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

Hello!

libcpp/lex.c includes "../gcc/config/i386/cpuid.h", and is picked up
by the system compiler during stage1. Recently, cpuid.h was changed to
account for %ebx changes and now uses "b" asm constraint for i686 even
with __PIC__.

Attached patch solves this issue by including system <cpuid.h> for GCC < 5.0.

2014-11-19  Uros Bizjak  <ubizjak@gmail.com>

    PR target/63966
    * lex.c [__i386__ || __x86_64__]: Include system <cpuid.h> for
    GCC_VERSION < 5000.

Patch was bootstrapped on x86_64-linux-gnu, Fedora 20. Patch will be
committed to mainline in a day or two, preferably after someone tests
it on Darwin.

Uros.

[-- Attachment #2: c.diff.txt --]
[-- Type: text/plain, Size: 477 bytes --]

Index: lex.c
===================================================================
--- lex.c	(revision 217789)
+++ lex.c	(working copy)
@@ -471,7 +471,11 @@ search_line_sse42 (const uchar *s, const uchar *en
 
 /* Check the CPU capabilities.  */
 
+#if (GCC_VERSION >= 5000)
 #include "../gcc/config/i386/cpuid.h"
+#else
+#include <cpuid.h>
+#endif
 
 typedef const uchar * (*search_line_fast_type) (const uchar *, const uchar *);
 static search_line_fast_type search_line_fast;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, i386]: Fix PR 63966, inconsistent operand constraints compiling libcpp
  2014-11-19 21:43 [PATCH, i386]: Fix PR 63966, inconsistent operand constraints compiling libcpp Uros Bizjak
@ 2014-11-20 12:26 ` Uros Bizjak
  0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2014-11-20 12:26 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth

On Wed, Nov 19, 2014 at 9:59 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> libcpp/lex.c includes "../gcc/config/i386/cpuid.h", and is picked up
> by the system compiler during stage1. Recently, cpuid.h was changed to
> account for %ebx changes and now uses "b" asm constraint for i686 even
> with __PIC__.

Attached patch is what I have committed to mainline SVN.

2014-11-20  Uros Bizjak  <ubizjak@gmail.com>

    PR target/63966
    * lex.c [__i386__ || __x86_64__]: Compile special SSE functions
    only for (__GNUC__ >= 5 || !defined(__PIC__)).

Bootstrapped on x86_64-linux-gnu, Fedora 20 and CentOS 5.11.

Uros.

Index: lex.c
===================================================================
--- lex.c       (revision 217830)
+++ lex.c       (working copy)
@@ -270,7 +270,7 @@
    extensions used, so SSE4.2 executables cannot run on machines that
    don't support that extension.  */

-#if (GCC_VERSION >= 4005) && (defined(__i386__) ||
defined(__x86_64__)) && !(defined(__sun__) && defined(__svr4__))
+#if (GCC_VERSION >= 4005) && (__GNUC__ >= 5 || !defined(__PIC__)) &&
(defined(__i386__) || defined(__x86_64__)) && !(defined(__sun__) && de

 /* Replicated character data to be shared between implementations.
    Recall that outside of a context with vector support we can't

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-20 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 21:43 [PATCH, i386]: Fix PR 63966, inconsistent operand constraints compiling libcpp Uros Bizjak
2014-11-20 12:26 ` Uros Bizjak

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).