aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/match.pd4
-rw-r--r--gcc/testsuite/gcc.dg/pr112673.c10
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index b30de36..61e5d34 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -8285,7 +8285,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(simplify
(BIT_FIELD_REF (view_convert @0) @1 @2)
- (BIT_FIELD_REF @0 @1 @2))
+ (if (! INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || type_has_mode_precision_p (TREE_TYPE (@0)))
+ (BIT_FIELD_REF @0 @1 @2)))
(simplify
(BIT_FIELD_REF @0 @1 integer_zerop)
diff --git a/gcc/testsuite/gcc.dg/pr112673.c b/gcc/testsuite/gcc.dg/pr112673.c
new file mode 100644
index 0000000..531f277
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr112673.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/112673 */
+/* { dg-do compile { target bitint575 } } */
+/* { dg-options "-O3" } */
+/* { dg-additional-options "-mavx2" { target i?86-*-* x86_64-*-* } } */
+
+int
+foo (_BitInt(256) x)
+{
+ return __builtin_ctzg ((unsigned _BitInt(512)) x);
+}