gcc/analyzer/ChangeLog:
* region-model-manager.cc
PR analyzer/96705
(region_model_manager::maybe_fold_binop): Check that we have an
integral type before calling build_int_cst.
gcc/testsuite/ChangeLog:
PR analyzer/96705
* gcc.dg/analyzer/pr96705.c: New test.
break;
case MULT_EXPR:
/* (VAL * 0). */
- if (cst1 && zerop (cst1))
+ if (cst1 && zerop (cst1) && INTEGRAL_TYPE_P (type))
return get_or_create_constant_svalue (build_int_cst (type, 0));
/* (VAL * 1) -> VAL. */
if (cst1 && integer_onep (cst1))
case TRUTH_AND_EXPR:
if (cst1)
{
- if (zerop (cst1))
+ if (zerop (cst1) && INTEGRAL_TYPE_P (type))
/* "(ARG0 && 0)" -> "0". */
return get_or_create_constant_svalue (build_int_cst (type, 0));
else
--- /dev/null
+int __attribute__ ((vector_size (8))) v;
+int i;
+
+void
+test (void)
+{
+ v &= 0;
+ v *= i;
+}