From 44f308e59bfa0f93ae05b17e257d8563c12399fd Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Thu, 9 Feb 2023 16:03:54 +0100 Subject: match.pd: When simplifying BFR of an insert, require a mode precision integral type [PR108688] The same problem as PR 88739 has crept in but this time in match.pd when simplifying bit_field_ref of an bit_insert. That is we are generating a BIT_FIELD_REF of a non-mode-precision integral type. PR tree-optimization/108688 * match.pd (bit_field_ref [bit_insert]): Avoid generating BIT_FIELD_REFs of non-mode-precision integral operands. * gcc.c-torture/compile/pr108688-1.c: New test. --- gcc/testsuite/gcc.c-torture/compile/pr108688-1.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr108688-1.c (limited to 'gcc/testsuite/gcc.c-torture') diff --git a/gcc/testsuite/gcc.c-torture/compile/pr108688-1.c b/gcc/testsuite/gcc.c-torture/compile/pr108688-1.c new file mode 100644 index 0000000..43d782d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr108688-1.c @@ -0,0 +1,15 @@ + + +union U { signed int d : 7; signed int e : 2; } u; +int a, b; + +void +foo (void) +{ + for (int i = 0; i < 64; i++) + { + u.d = a; + u.e ^= b; + } +} + -- cgit v1.1