From f66d8ec8cad7d28d81b3ce55af92fb0169f8edeb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 9 Apr 2015 21:51:08 +0200 Subject: re PR tree-optimization/65709 (Bad code for LZ4 decompression with -O3 on x86_64) PR tree-optimization/65709 * ubsan.c (instrument_mem_ref): Use TREE_TYPE (base) instead of TREE_TYPE (TREE_TYPE (t)). * c-c++-common/ubsan/align-9.c: New test. From-SVN: r221958 --- gcc/ubsan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/ubsan.c') diff --git a/gcc/ubsan.c b/gcc/ubsan.c index b9d9f30..701e9f2 100644 --- a/gcc/ubsan.c +++ b/gcc/ubsan.c @@ -1232,9 +1232,9 @@ instrument_mem_ref (tree mem, tree base, gimple_stmt_iterator *iter, tree t = TREE_OPERAND (base, 0); if (!POINTER_TYPE_P (TREE_TYPE (t))) return; - if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (TREE_TYPE (t))) && mem != base) + if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (base)) && mem != base) ikind = UBSAN_MEMBER_ACCESS; - tree kind = build_int_cst (TREE_TYPE (t), ikind); + tree kind = build_int_cst (build_pointer_type (TREE_TYPE (base)), ikind); tree alignt = build_int_cst (pointer_sized_int_node, align); gcall *g = gimple_build_call_internal (IFN_UBSAN_NULL, 3, t, kind, alignt); gimple_set_location (g, gimple_location (gsi_stmt (*iter))); -- cgit v1.1