re PR target/84945 (UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift...
authorJakub Jelinek <jakub@redhat.com>
Tue, 20 Mar 2018 08:14:42 +0000 (09:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 20 Mar 2018 08:14:42 +0000 (09:14 +0100)
commitae6dca8c651783208564001c56786f3abc762cf3
tree434aa97e62aef6d534c2885c7c96fb7a40824a55
parent18c5bc3f908b51b44b1b35ece40052221122fe0c
re PR target/84945 (UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift exponent 32 is too large for 32-bit type 'int')

PR target/84945
* config/i386/i386.c (fold_builtin_cpu): For features above 31
use __cpu_features2 variable instead of __cpu_model.__cpu_features[0].
Use 1U instead of 1.  Formatting fixes.

* gcc.target/i386/pr84945.c: New test.

* config/i386/cpuinfo.h (__cpu_features2): Declare.
* config/i386/cpuinfo.c (__cpu_features2): New variable for
ifndef SHARED only.
(set_feature): Define.
(get_available_features): Use set_feature macro.  Set __cpu_features2
to the second word of features ifndef SHARED.

From-SVN: r258673
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr84945.c [new file with mode: 0644]
libgcc/ChangeLog
libgcc/config/i386/cpuinfo.c
libgcc/config/i386/cpuinfo.h