This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/63966] [5 regression] inconsistent operand constraints compiling build libcpp
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Nov 2014 10:09:09 +0000
- Subject: [Bug target/63966] [5 regression] inconsistent operand constraints compiling build libcpp
- Auto-submitted: auto-generated
- References: <bug-63966-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63966
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to UroÅ Bizjak from comment #5)
> Can you please test this patch:
>
> --cut here--
> Index: lex.c
> ===================================================================
> --- lex.c (revision 217789)
> +++ lex.c (working copy)
> @@ -471,7 +471,11 @@
>
> /* 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;
> --cut here--
That assumes there is <cpuid.h> provided by the system compiler.
The code is guarded with
#if (GCC_VERSION >= 4005) && (defined(__i386__) || defined(__x86_64__)) &&
!(defined(__sun__) && defined(__svr4__))
but doesn't clang and icc pretend to be some versions of GCC?
I think better would be to include #include "../gcc/config/i386/cpuid.h"
only if GCC_VERSION >= 5000 (or perhaps that or __PIC__ not defined or
__x86_64__ defined), and otherwise not use __get_cpuid at all, just statically
decide based on minimum value.