This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/63966] [5 regression] inconsistent operand constraints compiling build libcpp


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]