+2018-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88215
+ * c-ubsan.c: Include langhooks.h.
+ (ubsan_instrument_division): Change gcc_assert that main variants
+ of op0 and op1 types are equal to gcc_checking_assert that the
+ main variants are compatible types.
+
2018-11-27 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c: Include stringpool.h.
#include "stringpool.h"
#include "attribs.h"
#include "asan.h"
+#include "langhooks.h"
/* Instrument division by zero and INT_MIN / -1. If not instrumenting,
return NULL_TREE. */
/* At this point both operands should have the same type,
because they are already converted to RESULT_TYPE.
Use TYPE_MAIN_VARIANT since typedefs can confuse us. */
- gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (op0))
- == TYPE_MAIN_VARIANT (TREE_TYPE (op1)));
+ tree top0 = TYPE_MAIN_VARIANT (type);
+ tree top1 = TYPE_MAIN_VARIANT (TREE_TYPE (op1));
+ gcc_checking_assert (lang_hooks.types_compatible_p (top0, top1));
op0 = unshare_expr (op0);
op1 = unshare_expr (op1);
+2018-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88215
+ * c-c++-common/ubsan/pr88215.c: New test.
+
2018-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/88182