From: Jakub Jelinek Date: Sat, 20 Jan 2018 09:54:06 +0000 (+0100) Subject: re PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in simplify... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09cbbded0d197f2da4f01be6f90c8535474b8200;p=gcc.git re PR target/83930 (ICE: RTL check: expected code 'const_int', have 'mem' in simplify_binary_operation_1, at simplify-rtx.c:3302) PR target/83930 * simplify-rtx.c (simplify_binary_operation_1) : Use UINTVAL (trueop1) instead of INTVAL (op1). * gcc.dg/pr83930.c: New test. From-SVN: r256915 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd3c00361f1..983675622ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-20 Jakub Jelinek + + PR target/83930 + * simplify-rtx.c (simplify_binary_operation_1) : Use + UINTVAL (trueop1) instead of INTVAL (op1). + 2018-01-19 Jakub Jelinek PR debug/81570 diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index b0a01783101..2e7aa5c1295 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3411,7 +3411,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, if (CONST_INT_P (trueop1) && exact_log2 (UINTVAL (trueop1)) > 0) return simplify_gen_binary (AND, mode, op0, - gen_int_mode (INTVAL (op1) - 1, mode)); + gen_int_mode (UINTVAL (trueop1) - 1, + mode)); break; case MOD: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0f7baad75a6..e58ae1e2817 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-20 Jakub Jelinek + + PR target/83930 + * gcc.dg/pr83930.c: New test. + 2018-01-19 Steven G. Kargl PR fortran/83900 diff --git a/gcc/testsuite/gcc.dg/pr83930.c b/gcc/testsuite/gcc.dg/pr83930.c new file mode 100644 index 00000000000..8a079af3fb4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83930.c @@ -0,0 +1,17 @@ +/* PR target/83930 */ +/* { dg-do compile } */ +/* { dg-options "-Og -fno-tree-ccp -w" } */ + +unsigned __attribute__ ((__vector_size__ (16))) v; + +static inline void +bar (unsigned char d) +{ + v /= d; +} + +__attribute__ ((always_inline)) void +foo (void) +{ + bar (4); +}