diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 187013a37cc..e01b1c88299 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -860,7 +860,8 @@ region_model::get_gassign_result (const gassign *assign, or by greater than or equal to the number of bits that exist in the operand." */ if (const tree rhs2_cst = rhs2_sval->maybe_get_constant ()) - if (TREE_CODE (rhs2_cst) == INTEGER_CST) + if (TREE_CODE (rhs2_cst) == INTEGER_CST + && INTEGRAL_TYPE_P (TREE_TYPE (rhs1))) { if (tree_int_cst_sgn (rhs2_cst) < 0) ctxt->warn diff --git a/gcc/testsuite/gcc.dg/analyzer/pr110455.c b/gcc/testsuite/gcc.dg/analyzer/pr110455.c new file mode 100644 index 00000000000..7f979436b79 --- /dev/null +++ b/gcc/testsuite/gcc.dg/analyzer/pr110455.c @@ -0,0 +1,7 @@ +int __attribute__((__vector_size__ (4))) v; + +void +foo (void) +{ + v | v << 1; +}