From: Jakub Jelinek Date: Tue, 24 Apr 2018 13:20:20 +0000 (+0200) Subject: re PR target/85508 (runtime error in config/i386/i386.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1704194ae7485f7faca06c026fbfc33233feae1d;p=gcc.git re PR target/85508 (runtime error in config/i386/i386.c) PR target/85508 * config/i386/i386.c (ix86_expand_vector_init_one_var): Use UINTVAL instead of INTVAL when shifting x left. * gcc.target/i386/pr85508.c: New test. From-SVN: r259594 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dcf0d0b9a43..767455fb4ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-24 Jakub Jelinek + + PR target/85508 + * config/i386/i386.c (ix86_expand_vector_init_one_var): Use UINTVAL + instead of INTVAL when shifting x left. + 2018-04-24 Andreas Krebbel PR tree-optimization/85478 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 19d1c30514d..fada22bba70 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -43194,7 +43194,7 @@ ix86_expand_vector_init_one_var (bool mmx_ok, machine_mode mode, else { var = convert_modes (HImode, QImode, var, true); - x = gen_int_mode (INTVAL (x) << 8, HImode); + x = gen_int_mode (UINTVAL (x) << 8, HImode); } if (x != const0_rtx) var = expand_simple_binop (HImode, IOR, var, x, var, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c92593cac9..65c4d6144bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-24 Jakub Jelinek + + PR target/85508 + * gcc.target/i386/pr85508.c: New test. + 2018-04-24 Andreas Krebbel PR tree-optimization/85478 diff --git a/gcc/testsuite/gcc.target/i386/pr85508.c b/gcc/testsuite/gcc.target/i386/pr85508.c new file mode 100644 index 00000000000..a75a38f101e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85508.c @@ -0,0 +1,12 @@ +/* PR target/85508 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +typedef signed char V __attribute__((vector_size (16))); +signed char c; + +V +foo (void) +{ + return (V) { c, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; +}