gsi_replace (gsi, new_stmt, false);
return true;
}
+ gimple_set_location (new_stmt, loc);
gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
goto done;
}
new_stmt);
gimple_assign_set_lhs (new_stmt, srcvar);
gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+ gimple_set_location (new_stmt, loc);
gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
}
new_stmt = gimple_build_assign (destvar, srcvar);
gsi_replace (gsi, new_stmt, false);
return true;
}
+ gimple_set_location (new_stmt, loc);
gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
}
+/* Verify that we have source locations for
+ -Wanalyzer-use-of-uninitialized-value warnings involving folded
+ memory ops. */
+
#include <string.h>
-int main()
+int test_memmove_within_uninit (void)
{
char s[5]; /* { dg-message "region created on stack here" } */
memmove(s, s + 1, 2); /* { dg-warning "use of uninitialized value" } */
return 0;
}
+
+int test_memcpy_from_uninit (void)
+{
+ char a1[5];
+ char a2[5]; /* { dg-message "region created on stack here" } */
+ return (memcpy(a1, a2, 5) == a1); /* { dg-warning "use of uninitialized value" } */
+}