From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55810 invoked by alias); 3 Jul 2018 12:16:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 55777 invoked by uid 89); 3 Jul 2018 12:16:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jul 2018 12:16:45 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DC18DAD09; Tue, 3 Jul 2018 12:16:42 +0000 (UTC) Subject: Re: extract_range_from_binary* cleanups for VRP To: Aldy Hernandez , gcc-patches References: <47b890d4-33e2-bd24-8054-5f220b7bfc26@redhat.com> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <969ae609-7f14-4f2a-159b-2e87339ee095@suse.cz> Date: Tue, 03 Jul 2018 12:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <47b890d4-33e2-bd24-8054-5f220b7bfc26@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00111.txt.bz2 Hi. It caused UBSAN errors: $ cat ubsan.i int a; void d() { int c, b = 8 - a; } $ /home/marxin/Programming/gcc2/objdir/./gcc/xgcc -B/home/marxin/Programming/gcc2/objdir/./gcc/ ubsan.i -c -O2 ../../gcc/tree-vrp.c:1715:26: runtime error: load of value 255, which is not a valid value for type 'bool' #0 0x3246ca2 in extract_range_from_binary_expr_1(value_range*, tree_code, tree_node*, value_range*, value_range*) ../../gcc/tree-vrp.c:1715 #1 0x34aa8b6 in vr_values::extract_range_from_binary_expr(value_range*, tree_code, tree_node*, tree_node*, tree_node*) ../../gcc/vr-values.c:794 #2 0x34b45fa in vr_values::extract_range_from_assignment(value_range*, gassign*) ../../gcc/vr-values.c:1455 #3 0x494cfd5 in evrp_range_analyzer::record_ranges_from_stmt(gimple*, bool) ../../gcc/gimple-ssa-evrp-analyze.c:293 #4 0x4942548 in evrp_dom_walker::before_dom_children(basic_block_def*) ../../gcc/gimple-ssa-evrp.c:139 #5 0x487652b in dom_walker::walk(basic_block_def*) ../../gcc/domwalk.c:353 #6 0x49470f9 in execute_early_vrp ../../gcc/gimple-ssa-evrp.c:310 #7 0x49470f9 in execute ../../gcc/gimple-ssa-evrp.c:347 #8 0x1fc4a0e in execute_one_pass(opt_pass*) ../../gcc/passes.c:2446 #9 0x1fc8b47 in execute_pass_list_1 ../../gcc/passes.c:2535 #10 0x1fc8b8e in execute_pass_list_1 ../../gcc/passes.c:2536 #11 0x1fc8c68 in execute_pass_list(function*, opt_pass*) ../../gcc/passes.c:2546 #12 0x2004c85 in do_per_function_toporder(void (*)(function*, void*), void*) ../../gcc/passes.c:1688 #13 0x2005e9a in execute_ipa_pass_list(opt_pass*) ../../gcc/passes.c:2894 #14 0xfcfa79 in ipa_passes ../../gcc/cgraphunit.c:2400 #15 0xfcfa79 in symbol_table::compile() ../../gcc/cgraphunit.c:2536 #16 0xfdc52a in symbol_table::finalize_compilation_unit() ../../gcc/cgraphunit.c:2696 #17 0x25115e4 in compile_file ../../gcc/toplev.c:479 #18 0x9278af in do_compile ../../gcc/toplev.c:2086 #19 0x9278af in toplev::main(int, char**) ../../gcc/toplev.c:2221 #20 0x92a79a in main ../../gcc/main.c:39 #21 0x7ffff659c11a in __libc_start_main ../csu/libc-start.c:308 #22 0x92a8c9 in _start (/home/marxin/Programming/gcc2/objdir/gcc/cc1+0x92a8c9) It's because neg_min_op0, or any other from: bool neg_min_op0, neg_min_op1, neg_max_op0, neg_max_op1; Martin