2016-10-05 Jakub Jelinek <jakub@redhat.com>
+ PR sanitizer/66343
+ * ubsan.c (ubsan_create_data): Call initialize_sanitizer_builtins here.
+ (ubsan_instrument_float_cast): And not here.
+
PR sanitizer/66343
* ubsan.c (ubsan_ids): New GTY(()) array.
(ubsan_type_descriptor, ubsan_create_data): Use ubsan_ids
+2016-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/66343
+ * c-ubsan.c (ubsan_instrument_return): Don't call
+ initialize_sanitizer_builtins here.
+
2016-10-05 Bernd Edlinger <bernd.edlinger@hotmail.de>
* c-common.c (c_common_truthvalue_conversion): Warn also for suspicious
{
if (flag_sanitize_undefined_trap_on_error)
return build_call_expr_loc (loc, builtin_decl_explicit (BUILT_IN_TRAP), 0);
- /* It is possible that PCH zapped table with definitions of sanitizer
- builtins. Reinitialize them if needed. */
- initialize_sanitizer_builtins ();
tree data = ubsan_create_data ("__ubsan_missing_return_data", 1, &loc,
NULL_TREE, NULL_TREE);
2016-10-05 Jakub Jelinek <jakub@redhat.com>
+ PR sanitizer/66343
+ * gcc.dg/pch/pr66343-3.c: New test.
+ * gcc.dg/pch/pr66343-3.hs: New file.
+
PR sanitizer/66343
* gcc.dg/pch/pr66343-1.c: New test.
* gcc.dg/pch/pr66343-1.hs: New file.
--- /dev/null
+/* PR sanitizer/66343 */
+/* { dg-do assemble } */
+/* { dg-options "-fsanitize=undefined" } */
+
+#include "pr66343-3.h"
+
+void
+bar (int a, int b)
+{
+ a / b;
+}
+
+/* Hack to turn off PCH assembly comparison, as it is incompatible
+ with dg-do assemble. The target condition will be always false. */
+/* { dg-error "" "" { target { lp64 && { ! lp64 } } } } */
--- /dev/null
+/* PR sanitizer/66343 */
+/* { dg-options "-fno-sanitize=undefined" } */
+
+/* Empty. */
size_t i = 0;
int j;
+ /* It is possible that PCH zapped table with definitions of sanitizer
+ builtins. Reinitialize them if needed. */
+ initialize_sanitizer_builtins ();
+
/* Firstly, create a pointer to type descriptor type. */
tree td_type = ubsan_get_type_descriptor_type ();
td_type = build_pointer_type (td_type);
{
location_t *loc_ptr = NULL;
unsigned num_locations = 0;
- initialize_sanitizer_builtins ();
/* Figure out if we can propagate location to ubsan_data and use new
style handlers in libubsan. */
if (ubsan_use_new_style_p (loc))