Bug 63504 - [5 Regression] Issues found by --enable-checking=valgrind
Summary: [5 Regression] Issues found by --enable-checking=valgrind
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 5.0
: P1 normal
Target Milestone: 5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on: 63988
Blocks: 64807
  Show dependency treegraph
 
Reported: 2014-10-10 06:34 UTC by Markus Trippelsdorf
Modified: 2015-02-03 09:40 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase for issue 1) (18.27 KB, text/plain)
2014-10-11 08:04 UTC, Markus Trippelsdorf
Details
testcase for issue 2) (38.98 KB, text/plain)
2014-10-12 14:15 UTC, Markus Trippelsdorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2014-10-10 06:34:27 UTC
(Ordered by first occurrence in log.)

1)
==53187== Use of uninitialised value of size 8
==53187==    at 0x102929D0: find_slot_with_hash (hash-table.h:860)
==53187==    by 0x102929D0: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24142)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102B6E8F: optimize_location_lists (dwarf2out.c:24192)
==53187==    by 0x102B6E8F: dwarf2out_finish(char const*) (dwarf2out.c:24453)
==53187==    by 0x1058A43F: compile_file() (toplev.c:602)
==53187==    by 0x1058C7AF: do_compile (toplev.c:1946)
==53187==    by 0x1058C7AF: toplev_main(int, char**) (toplev.c:2022)
==53187==    by 0x100E131F: main (main.c:36)
==53187==  Uninitialised value was created by a stack allocation
==53187==    at 0x102B8A70: generic_wide_int<wide_int_storage>& generic_wide_int<wide_int_storage>::operator=<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*, machine_mode> const&) (wide-int.h:861)
==53187== 
==53187== Use of uninitialised value of size 8
==53187==    at 0x10293100: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24144)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==53187==    by 0x102B6E8F: optimize_location_lists (dwarf2out.c:24192)
==53187==    by 0x102B6E8F: dwarf2out_finish(char const*) (dwarf2out.c:24453)
==53187==    by 0x1058A43F: compile_file() (toplev.c:602)
==53187==    by 0x1058C7AF: do_compile (toplev.c:1946)
==53187==    by 0x1058C7AF: toplev_main(int, char**) (toplev.c:2022)
==53187==    by 0x100E131F: main (main.c:36)
==53187==  Uninitialised value was created by a stack allocation
==53187==    at 0x102B8A70: generic_wide_int<wide_int_storage>& generic_wide_int<wide_int_storage>::operator=<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*, machine_mode> const&) (wide-int.h:861)
==53187== 

variation:==18094== Use of uninitialised value of size 8
==18094==    at 0x102929D0: find_slot_with_hash (hash-table.h:860)
==18094==    by 0x102929D0: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24142)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102B6E8F: optimize_location_lists (dwarf2out.c:24192)
==18094==    by 0x102B6E8F: dwarf2out_finish(char const*) (dwarf2out.c:24453)
==18094==    by 0x1058A43F: compile_file() (toplev.c:602)
==18094==    by 0x1058C7AF: do_compile (toplev.c:1946)
==18094==    by 0x1058C7AF: toplev_main(int, char**) (toplev.c:2022)
==18094==    by 0x100E131F: main (main.c:36)
==18094==  Uninitialised value was created by a client request
==18094==    at 0x101B1898: pool_alloc(alloc_pool_def*) (alloc-pool.c:298)
==18094==    by 0x103F727F: ira_create_allocno(int, bool, ira_loop_tree_node*) (ira-build.c:495)
==18094==    by 0x103F7793: create_insn_allocnos(rtx_def*, rtx_def*, bool) (ira-build.c:1882)
==18094==    by 0x103F7BEB: create_bb_allocnos (ira-build.c:1948)
==18094==    by 0x103F7BEB: create_loop_tree_node_allocnos(ira_loop_tree_node*) (ira-build.c:1994)
==18094==    by 0x103FC36B: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1829)
==18094==    by 0x103FC153: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1847)
==18094==    by 0x103FC153: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1847)
==18094==    by 0x103FCDB7: create_allocnos (ira-build.c:2091)
==18094==    by 0x103FCDB7: ira_build() (ira-build.c:3449)
==18094==    by 0x103F2B17: ira (ira.c:5166)
==18094==    by 0x103F2B17: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5431)
==18094==    by 0x104B5DC7: execute_one_pass(opt_pass*) (passes.c:2151)
==18094==    by 0x104B6463: execute_pass_list_1(opt_pass*) (passes.c:2203)
==18094==    by 0x104B647B: execute_pass_list_1(opt_pass*) (passes.c:2204)
==18094== 
==18094== Use of uninitialised value of size 8
==18094==    at 0x10293100: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24144)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102927A3: optimize_location_lists_1(die_struct*, hash_table<loc_list_hasher, xcallocator, false>*) [clone .isra.249] (dwarf2out.c:24149)
==18094==    by 0x102B6E8F: optimize_location_lists (dwarf2out.c:24192)
==18094==    by 0x102B6E8F: dwarf2out_finish(char const*) (dwarf2out.c:24453)
==18094==    by 0x1058A43F: compile_file() (toplev.c:602)
==18094==    by 0x1058C7AF: do_compile (toplev.c:1946)
==18094==    by 0x1058C7AF: toplev_main(int, char**) (toplev.c:2022)
==18094==    by 0x100E131F: main (main.c:36)
==18094==  Uninitialised value was created by a client request
==18094==    at 0x101B1898: pool_alloc(alloc_pool_def*) (alloc-pool.c:298)
==18094==    by 0x103F727F: ira_create_allocno(int, bool, ira_loop_tree_node*) (ira-build.c:495)
==18094==    by 0x103F7793: create_insn_allocnos(rtx_def*, rtx_def*, bool) (ira-build.c:1882)
==18094==    by 0x103F7BEB: create_bb_allocnos (ira-build.c:1948)
==18094==    by 0x103F7BEB: create_loop_tree_node_allocnos(ira_loop_tree_node*) (ira-build.c:1994)
==18094==    by 0x103FC36B: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1829)
==18094==    by 0x103FC153: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1847)
==18094==    by 0x103FC153: ira_traverse_loop_tree(bool, ira_loop_tree_node*, void (*)(ira_loop_tree_node*), void (*)(ira_loop_tree_node*)) (ira-build.c:1847)
==18094==    by 0x103FCDB7: create_allocnos (ira-build.c:2091)
==18094==    by 0x103FCDB7: ira_build() (ira-build.c:3449)
==18094==    by 0x103F2B17: ira (ira.c:5166)
==18094==    by 0x103F2B17: (anonymous namespace)::pass_ira::execute(function*) (ira.c:5431)
==18094==    by 0x104B5DC7: execute_one_pass(opt_pass*) (passes.c:2151)
==18094==    by 0x104B6463: execute_pass_list_1(opt_pass*) (passes.c:2203)
==18094==    by 0x104B647B: execute_pass_list_1(opt_pass*) (passes.c:2204)
==18094== 

2)==24993== Conditional jump or move depends on uninitialised value(s)
==24993==    at 0x1080E8CC: divmod_internal_2 (wide-int.cc:1623)
==24993==    by 0x1080E8CC: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*
) (wide-int.cc:1823)
==24993==    by 0x103132C7: div_trunc<const tree_node*, generic_wide_int<wide_int_storage> > (wide-int.h:2506)
==24993==    by 0x103132C7: int_const_binop_1(tree_code, tree_node const*, tree_node const*, int) (fold-const.c:1038)
==24993==    by 0x1079BC6F: vrp_int_const_binop(tree_code, tree_node*, tree_node*) (tree-vrp.c:1934)
==24993==    by 0x1079C2EB: extract_range_from_multiplicative_op_1(value_range_d*, tree_code, value_range_d*, value_range_d*) (tree-vrp.c:2218)
==24993==    by 0x107A06CF: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:3117)
==24993==    by 0x1079FCC7: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:2397)
==24993==    by 0x107A2E57: extract_range_from_binary_expr(value_range_d*, tree_code, tree_node*, tree_node*, tree_node*) (tree-vrp.c:3293)
==24993==    by 0x107A6373: extract_range_from_assignment(value_range_d*, gimple_statement_base*) (tree-vrp.c:4003)
==24993==    by 0x107A8227: vrp_visit_assignment_or_call (tree-vrp.c:6920)
==24993==    by 0x107A8227: vrp_visit_stmt(gimple_statement_base*, edge_def**, tree_node**) (tree-vrp.c:7731)
==24993==    by 0x106DEC97: simulate_stmt(gimple_statement_base*) (tree-ssa-propagate.c:331)
==24993==    by 0x106E153F: simulate_block (tree-ssa-propagate.c:454)
==24993==    by 0x106E153F: ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) (tree-ssa-propaga
te.c:871)
==24993==    by 0x107B063F: execute_vrp (tree-vrp.c:9994)
==24993==    by 0x107B063F: (anonymous namespace)::pass_vrp::execute(function*) (tree-vrp.c:10074)
==24993==  Uninitialised value was created by a stack allocation
==24993==    at 0x1080E418: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*
) (wide-int.cc:1683)
==24993== 
==24993== Conditional jump or move depends on uninitialised value(s)
==24993==    at 0x1080E8E4: divmod_internal_2 (wide-int.cc:1623)
==24993==    by 0x1080E8E4: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*
) (wide-int.cc:1823)
==24993==    by 0x103132C7: div_trunc<const tree_node*, generic_wide_int<wide_int_storage> > (wide-int.h:2506)
==24993==    by 0x103132C7: int_const_binop_1(tree_code, tree_node const*, tree_node const*, int) (fold-const.c:1038)
==24993==    by 0x1079BC6F: vrp_int_const_binop(tree_code, tree_node*, tree_node*) (tree-vrp.c:1934)
==24993==    by 0x1079C2EB: extract_range_from_multiplicative_op_1(value_range_d*, tree_code, value_range_d*, value_range_d*) (tree-vrp.c:2218)
==24993==    by 0x107A06CF: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:3117)
==24993==    by 0x1079FCC7: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:2397)
==24993==    by 0x107A2E57: extract_range_from_binary_expr(value_range_d*, tree_code, tree_node*, tree_node*, tree_node*) (tree-vrp.c:3293)
==24993==    by 0x107A6373: extract_range_from_assignment(value_range_d*, gimple_statement_base*) (tree-vrp.c:4003)
==24993==    by 0x107A8227: vrp_visit_assignment_or_call (tree-vrp.c:6920)
==24993==    by 0x107A8227: vrp_visit_stmt(gimple_statement_base*, edge_def**, tree_node**) (tree-vrp.c:7731)
==24993==    by 0x106DEC97: simulate_stmt(gimple_statement_base*) (tree-ssa-propagate.c:331)
==24993==    by 0x106E153F: simulate_block (tree-ssa-propagate.c:454)
==24993==    by 0x106E153F: ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) (tree-ssa-propagate.c:871)
==24993==    by 0x107B063F: execute_vrp (tree-vrp.c:9994)
==24993==    by 0x107B063F: (anonymous namespace)::pass_vrp::execute(function*) (tree-vrp.c:10074)
==24993==  Uninitialised value was created by a stack allocation
==24993==    at 0x1080E418: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1683)
==24993== 
==24993== Conditional jump or move depends on uninitialised value(s)
==24993==    at 0x1080E964: divmod_internal_2 (wide-int.cc:1645)
==24993==    by 0x1080E964: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1823)
==24993==    by 0x103132C7: div_trunc<const tree_node*, generic_wide_int<wide_int_storage> > (wide-int.h:2506)
==24993==    by 0x103132C7: int_const_binop_1(tree_code, tree_node const*, tree_node const*, int) (fold-const.c:1038)
==24993==    by 0x1079BC6F: vrp_int_const_binop(tree_code, tree_node*, tree_node*) (tree-vrp.c:1934)
==24993==    by 0x1079C2EB: extract_range_from_multiplicative_op_1(value_range_d*, tree_code, value_range_d*, value_range_d*) (tree-vrp.c:2218)
==24993==    by 0x107A06CF: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:3117)
==24993==    by 0x1079FCC7: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:2397)
==24993==    by 0x107A2E57: extract_range_from_binary_expr(value_range_d*, tree_code, tree_node*, tree_node*, tree_node*) (tree-vrp.c:3293)
==24993==    by 0x107A6373: extract_range_from_assignment(value_range_d*, gimple_statement_base*) (tree-vrp.c:4003)
==24993==    by 0x107A8227: vrp_visit_assignment_or_call (tree-vrp.c:6920)
==24993==    by 0x107A8227: vrp_visit_stmt(gimple_statement_base*, edge_def**, tree_node**) (tree-vrp.c:7731)
==24993==    by 0x106DEC97: simulate_stmt(gimple_statement_base*) (tree-ssa-propagate.c:331)
==24993==    by 0x106E153F: simulate_block (tree-ssa-propagate.c:454)
==24993==    by 0x106E153F: ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) (tree-ssa-propagate.c:871)
==24993==    by 0x107B063F: execute_vrp (tree-vrp.c:9994)
==24993==    by 0x107B063F: (anonymous namespace)::pass_vrp::execute(function*) (tree-vrp.c:10074)
==24993==  Uninitialised value was created by a stack allocation
==24993==    at 0x1080E418: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1683)
==24993== 
==24993== Conditional jump or move depends on uninitialised value(s)
==24993==    at 0x10809E8C: canonize(long*, unsigned int, unsigned int) (wide-int.cc:109)
==24993==    by 0x1080E9DB: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1829)
==24993==    by 0x1079BC6F: vrp_int_const_binop(tree_code, tree_node*, tree_node*) (tree-vrp.c:1934)
==24993==    by 0x1079C2EB: extract_range_from_multiplicative_op_1(value_range_d*, tree_code, value_range_d*, value_range_d*) (tree-vrp.c:2218)
==24993==    by 0x107A06CF: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:3117)
==24993==    by 0x1079FCC7: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:2397)
==24993==    by 0x107A2E57: extract_range_from_binary_expr(value_range_d*, tree_code, tree_node*, tree_node*, tree_node*) (tree-vrp.c:3293)
==24993==    by 0x107A6373: extract_range_from_assignment(value_range_d*, gimple_statement_base*) (tree-vrp.c:4003)
==24993==    by 0x107A8227: vrp_visit_assignment_or_call (tree-vrp.c:6920)
==24993==    by 0x107A8227: vrp_visit_stmt(gimple_statement_base*, edge_def**, tree_node**) (tree-vrp.c:7731)
==24993==    by 0x106DEC97: simulate_stmt(gimple_statement_base*) (tree-ssa-propagate.c:331)
==24993==    by 0x106E153F: simulate_block (tree-ssa-propagate.c:454)
==24993==    by 0x106E153F: ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) (tree-ssa-propagate.c:871)
==24993==    by 0x107B063F: execute_vrp (tree-vrp.c:9994)
==24993==    by 0x107B063F: (anonymous namespace)::pass_vrp::execute(function*) (tree-vrp.c:10074)
==24993==  Uninitialised value was created by a stack allocation
==24993==    at 0x1080E418: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1683)
==24993== 
==24993== Conditional jump or move depends on uninitialised value(s)
==24993==    at 0x107CA644: force_fit_type(tree_node*, generic_wide_int<wide_int_ref_storage<false> > const&, int, bool) (tree.c:1223)
==24993==    by 0x103135A7: int_const_binop_1(tree_code, tree_node const*, tree_node const*, int) (fold-const.c:1098)
==24993==    by 0x1079BC6F: vrp_int_const_binop(tree_code, tree_node*, tree_node*) (tree-vrp.c:1934)
==24993==    by 0x1079C2EB: extract_range_from_multiplicative_op_1(value_range_d*, tree_code, value_range_d*, value_range_d*) (tree-vrp.c:2218)
==24993==    by 0x107A06CF: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:3117)
==24993==    by 0x1079FCC7: extract_range_from_binary_expr_1(value_range_d*, tree_code, tree_node*, value_range_d*, value_range_d*) (tree-vrp.c:2397)
==24993==    by 0x107A2E57: extract_range_from_binary_expr(value_range_d*, tree_code, tree_node*, tree_node*, tree_node*) (tree-vrp.c:3293)
==24993==    by 0x107A6373: extract_range_from_assignment(value_range_d*, gimple_statement_base*) (tree-vrp.c:4003)
==24993==    by 0x107A8227: vrp_visit_assignment_or_call (tree-vrp.c:6920)
==24993==    by 0x107A8227: vrp_visit_stmt(gimple_statement_base*, edge_def**, tree_node**) (tree-vrp.c:7731)
==24993==    by 0x106DEC97: simulate_stmt(gimple_statement_base*) (tree-ssa-propagate.c:331)
==24993==    by 0x106E153F: simulate_block (tree-ssa-propagate.c:454)
==24993==    by 0x106E153F: ssa_propagate(ssa_prop_result (*)(gimple_statement_base*, edge_def**, tree_node**), ssa_prop_result (*)(gimple_statement_base*)) (tree-ssa-propagate.c:871)
==24993==    by 0x107B063F: execute_vrp (tree-vrp.c:9994)
==24993==    by 0x107B063F: (anonymous namespace)::pass_vrp::execute(function*) (tree-vrp.c:10074)
==24993==  Uninitialised value was created by a stack allocation
==24993==    at 0x1080E418: wi::divmod_internal(long*, unsigned int*, long*, long const*, unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop_e, bool*) (wide-int.cc:1683)
...

3)
==25128== Invalid read of size 4
==25128==    at 0x10A41D6C: get_last_value_validate(rtx_def**, rtx_insn*, int, int) (combine.c:12629)
==25128==    by 0x10A41B97: get_last_value_validate(rtx_def**, rtx_insn*, int, int) (combine.c:12688)
==25128==    by 0x10A42BF7: record_value_for_reg(rtx_def*, rtx_insn*, rtx_def*) (combine.c:12300)
==25128==    by 0x1051F41F: note_stores(rtx_def const*, void (*)(rtx_def*, rtx_def const*, void*), void*) (rtlanal.c:1606)
==25128==    by 0x10A4320F: record_dead_and_set_regs(rtx_insn*) (combine.c:12432)
==25128==    by 0x10A5D3FB: combine_instructions (combine.c:1473)
==25128==    by 0x10A5D3FB: rest_of_handle_combine (combine.c:13902)
==25128==    by 0x10A5D3FB: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==25128==    by 0x104B5DC7: execute_one_pass(opt_pass*) (passes.c:2151)
==25128==    by 0x104B6463: execute_pass_list_1(opt_pass*) (passes.c:2203)
==25128==    by 0x104B647B: execute_pass_list_1(opt_pass*) (passes.c:2204)
==25128==    by 0x104B64FB: execute_pass_list(function*, opt_pass*) (passes.c:2214)
==25128==    by 0x102236F7: cgraph_node::expand() (cgraphunit.c:1735)
==25128==    by 0x10224CC7: expand_all_functions (cgraphunit.c:1871)
==25128==    by 0x10224CC7: symbol_table::compile() (cgraphunit.c:2206)
==25128==  Address 0xd35cef8 is 0 bytes after a block of size 2,152 alloc'd
==25128==    at 0x402924C: malloc (vg_replace_malloc.c:296)
==25128==    by 0x10BA2E73: xmalloc (xmalloc.c:147)
==25128==    by 0x104F4823: regstat_init_n_sets_and_refs() (regstat.c:60)
==25128==    by 0x10A5C7A3: rest_of_handle_combine (combine.c:13899)
==25128==    by 0x10A5C7A3: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==25128==    by 0x104B5DC7: execute_one_pass(opt_pass*) (passes.c:2151)
==25128==    by 0x104B6463: execute_pass_list_1(opt_pass*) (passes.c:2203)
==25128==    by 0x104B647B: execute_pass_list_1(opt_pass*) (passes.c:2204)
==25128==    by 0x104B64FB: execute_pass_list(function*, opt_pass*) (passes.c:2214)
==25128==    by 0x102236F7: cgraph_node::expand() (cgraphunit.c:1735)
==25128==    by 0x10224CC7: expand_all_functions (cgraphunit.c:1871)
==25128==    by 0x10224CC7: symbol_table::compile() (cgraphunit.c:2206)
==25128==    by 0x10226533: symbol_table::finalize_compilation_unit() (cgraphunit.c:2283)
==25128==    by 0x100F78A3: c_write_global_declarations() (c-decl.c:10623)
==25128==
Comment 1 Markus Trippelsdorf 2014-10-10 07:37:01 UTC
Two more variations of issue 3)

==47649== Invalid read of size 4
==47649==    at 0x10B00978: reg_num_sign_bit_copies_for_combine(rtx_def const*, machine_mode, rtx_def const*, machine_mode, unsigned int, unsigned int*) (combine.c:9581)
==47649==    by 0x105E3CC3: num_sign_bit_copies1(rtx_def const*, machine_mode, rtx_def const*, machine_mode, unsigned int) (rtlanal.c:4661)
==47649==    by 0x10B0493B: if_then_else_cond(rtx_def*, rtx_def**, rtx_def**) (combine.c:8785)
==47649==    by 0x10B047D7: if_then_else_cond(rtx_def*, rtx_def**, rtx_def**) (combine.c:8640)
==47649==    by 0x10B12D67: combine_simplify_rtx(rtx_def*, machine_mode, int, int) (combine.c:5270)
==47649==    by 0x10B14C7B: subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) (combine.c:5207)
==47649==    by 0x10B14DF7: subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) (combine.c:5152)
==47649==    by 0x10B1694B: try_combine(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, int*, rtx_insn*) (combine.c:3093)
==47649==    by 0x10B1BA47: combine_instructions (combine.c:1261)
==47649==    by 0x10B1BA47: rest_of_handle_combine (combine.c:13902)
==47649==    by 0x10B1BA47: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==47649==    by 0x10573E27: execute_one_pass(opt_pass*) (passes.c:2151)
==47649==    by 0x105744C3: execute_pass_list_1(opt_pass*) (passes.c:2203)
==47649==    by 0x105744DB: execute_pass_list_1(opt_pass*) (passes.c:2204)
==47649==  Address 0x69d38a8 is 0 bytes after a block of size 1,720 alloc'd
==47649==    at 0x402924C: malloc (vg_replace_malloc.c:296)
==47649==    by 0x10C6DE73: xmalloc (xmalloc.c:147)
==47649==    by 0x105B2883: regstat_init_n_sets_and_refs() (regstat.c:60)
==47649==    by 0x10B1AEE3: rest_of_handle_combine (combine.c:13899)
==47649==    by 0x10B1AEE3: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==47649==    by 0x10573E27: execute_one_pass(opt_pass*) (passes.c:2151)
==47649==    by 0x105744C3: execute_pass_list_1(opt_pass*) (passes.c:2203)
==47649==    by 0x105744DB: execute_pass_list_1(opt_pass*) (passes.c:2204)
==47649==    by 0x1057455B: execute_pass_list(function*, opt_pass*) (passes.c:2214)
==47649==    by 0x102E2157: cgraph_node::expand() (cgraphunit.c:1735)
==47649==    by 0x102E3727: expand_all_functions (cgraphunit.c:1871)
==47649==    by 0x102E3727: symbol_table::compile() (cgraphunit.c:2206)
==47649==    by 0x102E4F93: symbol_table::finalize_compilation_unit() (cgraphunit.c:2283)
==47649==    by 0x104DF877: write_global_declarations() (langhooks.c:328)
==47649==
==47649== Invalid read of size 4
==47649==    at 0x10B00C68: reg_nonzero_bits_for_combine(rtx_def const*, machine_mode, rtx_def const*, machine_mode, unsigned long, unsigned long*) (combine.c:9504)
==47649==    by 0x105DAEF3: nonzero_bits1(rtx_def const*, machine_mode, rtx_def const*, machine_mode, unsigned long) (rtlanal.c:4175)
==47649==    by 0x10B04C23: if_then_else_cond(rtx_def*, rtx_def**, rtx_def**) (combine.c:8792)
==47649==    by 0x10B047D7: if_then_else_cond(rtx_def*, rtx_def**, rtx_def**) (combine.c:8640)
==47649==    by 0x10B12D67: combine_simplify_rtx(rtx_def*, machine_mode, int, int) (combine.c:5270)
==47649==    by 0x10B14C7B: subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) (combine.c:5207)
==47649==    by 0x10B14DF7: subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) (combine.c:5152)
==47649==    by 0x10B1694B: try_combine(rtx_insn*, rtx_insn*, rtx_insn*, rtx_insn*, int*, rtx_insn*) (combine.c:3093)
==47649==    by 0x10B1BA47: combine_instructions (combine.c:1261)
==47649==    by 0x10B1BA47: rest_of_handle_combine (combine.c:13902)
==47649==    by 0x10B1BA47: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==47649==    by 0x10573E27: execute_one_pass(opt_pass*) (passes.c:2151)
==47649==    by 0x105744C3: execute_pass_list_1(opt_pass*) (passes.c:2203)
==47649==    by 0x105744DB: execute_pass_list_1(opt_pass*) (passes.c:2204)
==47649==  Address 0x69d38a8 is 0 bytes after a block of size 1,720 alloc'd
==47649==    at 0x402924C: malloc (vg_replace_malloc.c:296)
==47649==    by 0x10C6DE73: xmalloc (xmalloc.c:147)
==47649==    by 0x105B2883: regstat_init_n_sets_and_refs() (regstat.c:60)
==47649==    by 0x10B1AEE3: rest_of_handle_combine (combine.c:13899)
==47649==    by 0x10B1AEE3: (anonymous namespace)::pass_combine::execute(function*) (combine.c:13945)
==47649==    by 0x10573E27: execute_one_pass(opt_pass*) (passes.c:2151)
==47649==    by 0x105744C3: execute_pass_list_1(opt_pass*) (passes.c:2203)
==47649==    by 0x105744DB: execute_pass_list_1(opt_pass*) (passes.c:2204)
==47649==    by 0x1057455B: execute_pass_list(function*, opt_pass*) (passes.c:2214)
==47649==    by 0x102E2157: cgraph_node::expand() (cgraphunit.c:1735)
==47649==    by 0x102E3727: expand_all_functions (cgraphunit.c:1871)
==47649==    by 0x102E3727: symbol_table::compile() (cgraphunit.c:2206)
==47649==    by 0x102E4F93: symbol_table::finalize_compilation_unit() (cgraphunit.c:2283)
==47649==    by 0x104DF877: write_global_declarations() (langhooks.c:328)
Comment 2 Markus Trippelsdorf 2014-10-10 08:53:37 UTC
To reproduce issue 3) run:

valgrind --track-origins=yes --trace-children=yes gfortran gcc/testsuite/gfortran.dg/actual_array_result_1.f90 -fno-diagnostics-show-caret -fdiagnostics-color=never -Os -c
Comment 3 Markus Trippelsdorf 2014-10-10 09:03:28 UTC
(In reply to Markus Trippelsdorf from comment #2)
> To reproduce issue 3) run:
> 
> valgrind --track-origins=yes --trace-children=yes gfortran
> gcc/testsuite/gfortran.dg/actual_array_result_1.f90
> -fno-diagnostics-show-caret -fdiagnostics-color=never -Os -c

on ppc64.
Comment 4 Markus Trippelsdorf 2014-10-11 08:04:12 UTC
On x86_64-unknown-linux-gnu everything seems fine, 
but issues 1) and 3) can be reproduced with a cross:

../gcc/configure --target=powerpc64-unknown-linux-gnu --disable-libsanitizer --disable-bootstrap --disable-libstdcxx-pch --disable-libvtv --disable-libitm --disable-libcilkrts --disable-libssp --disable-libgomp --disable-werror --disable-multilib --enable-languages=c,c++,fortran

1)
valgrind --track-origins=yes --trace-children=yes ./gcc/xgcc -Bgcc -std=gnu11 -fcx-fortran-rules -g -O2 -S ~/maxloc0_4_i16.i

2)
Happened during testsuite run on a 64-core machine. So it is hard to tell
which command line triggered the problem. And running the testsuite single-
threaded would take weeks.

3)
valgrind --track-origins=yes --trace-children=yes ./gcc/gfortran -Bgcc ~/gcc/gcc/testsuite/gfortran.dg/actual_array_result_1.f90 -S -fno-diagnostics-show-caret -fdiagnostics-color=never -Os -c
Comment 5 Markus Trippelsdorf 2014-10-11 08:04:53 UTC
Created attachment 33687 [details]
testcase for issue 1)
Comment 6 Markus Trippelsdorf 2014-10-12 14:15:49 UTC
Created attachment 33693 [details]
testcase for issue 2)

2)
 % valgrind --track-origins=yes --trace-children=yes ./gcc/xgcc -Bgcc -c -S -std=gnu11 -fcx-fortran-rules -O2 ../read.i
Comment 7 Markus Trippelsdorf 2014-10-12 18:12:53 UTC
4)
markus@x4 gcc % valgrind -q --track-origins=yes --trace-children=yes g++ -Igcc/testsuite/g++.dg/cpp1y -Igcc/testsuite//g++.dg/cpp1y/testinc gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C -std=gnu++1y -S
==16557== Conditional jump or move depends on uninitialised value(s)
==16557==    at 0x1215932: parse_has_include(cpp_reader*, include_type) (expr.c:2143)
==16557==    by 0x1218E63: eval_token (expr.c:1056)
==16557==    by 0x1218E63: _cpp_parse_expr (expr.c:1224)
==16557==    by 0x1211BE3: do_if(cpp_reader*) (directives.c:1980)
==16557==    by 0x1213417: _cpp_handle_directive (directives.c:509)
==16557==    by 0x12202CC: _cpp_lex_token (lex.c:2172)
==16557==    by 0x122513F: cpp_get_token_1(cpp_reader*, unsigned int*) (macro.c:2408)
==16557==    by 0x7CB2BC: c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int) (c-lex.c:303)
==16557==    by 0x673A0F: cp_lexer_get_preprocessor_token(cp_lexer*, cp_token*) (parser.c:763)
==16557==    by 0x6AA905: cp_parser_initial_pragma (parser.c:31771)
==16557==    by 0x6AA905: cp_lexer_new_main (parser.c:633)
==16557==    by 0x6AA905: cp_parser_new (parser.c:3434)
==16557==    by 0x6AA905: c_parse_file() (parser.c:32090)
==16557==    by 0x7D3482: c_common_parse_file() (c-opts.c:1043)
==16557==    by 0xBD4631: compile_file() (toplev.c:551)
==16557==    by 0xBD6A01: do_compile (toplev.c:1946)
==16557==    by 0xBD6A01: toplev_main(int, char**) (toplev.c:2022)
==16557==  Uninitialised value was created by a heap allocation
==16557==    at 0x4028AEF: malloc (vg_replace_malloc.c:296)
==16557==    by 0x124B867: xmalloc (xmalloc.c:147)
==16557==    by 0x121D6CA: _cpp_init_tokenrun (lex.c:2006)
==16557==    by 0x121BD1A: cpp_create_reader(c_lang, ht*, line_maps*) (init.c:242)
==16557==    by 0x7D115C: c_common_init_options(unsigned int, cl_decoded_option*) (c-opts.c:237)
==16557==    by 0xBD6131: toplev_main(int, char**) (toplev.c:2000)
==16557==    by 0x4ED6FCF: (below main) (in /lib64/libc-2.19.90.so)
==16557== 
==16557== Conditional jump or move depends on uninitialised value(s)
==16557==    at 0x1218424: _cpp_parse_expr (expr.c:1325)
==16557==    by 0x1211BE3: do_if(cpp_reader*) (directives.c:1980)
==16557==    by 0x1213417: _cpp_handle_directive (directives.c:509)
==16557==    by 0x12202CC: _cpp_lex_token (lex.c:2172)
==16557==    by 0x122513F: cpp_get_token_1(cpp_reader*, unsigned int*) (macro.c:2408)
==16557==    by 0x7CB2BC: c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int) (c-lex.c:303)
==16557==    by 0x673A0F: cp_lexer_get_preprocessor_token(cp_lexer*, cp_token*) (parser.c:763)
==16557==    by 0x6AA905: cp_parser_initial_pragma (parser.c:31771)
==16557==    by 0x6AA905: cp_lexer_new_main (parser.c:633)
==16557==    by 0x6AA905: cp_parser_new (parser.c:3434)
==16557==    by 0x6AA905: c_parse_file() (parser.c:32090)
==16557==    by 0x7D3482: c_common_parse_file() (c-opts.c:1043)
==16557==    by 0xBD4631: compile_file() (toplev.c:551)
==16557==    by 0xBD6A01: do_compile (toplev.c:1946)
==16557==    by 0xBD6A01: toplev_main(int, char**) (toplev.c:2022)
==16557==    by 0x4ED6FCF: (below main) (in /lib64/libc-2.19.90.so)
==16557==  Uninitialised value was created by a heap allocation
==16557==    at 0x4028AEF: malloc (vg_replace_malloc.c:296)
==16557==    by 0x124B867: xmalloc (xmalloc.c:147)
==16557==    by 0x121D6CA: _cpp_init_tokenrun (lex.c:2006)
==16557==    by 0x121BD1A: cpp_create_reader(c_lang, ht*, line_maps*) (init.c:242)
==16557==    by 0x7D115C: c_common_init_options(unsigned int, cl_decoded_option*) (c-opts.c:237)
==16557==    by 0xBD6131: toplev_main(int, char**) (toplev.c:2000)
==16557==    by 0x4ED6FCF: (below main) (in /lib64/libc-2.19.90.so)
==16557==
Comment 8 Markus Trippelsdorf 2014-10-13 11:39:30 UTC
Issue 4) started with r215752.
Comment 9 Richard Biener 2014-11-20 12:14:05 UTC
note that individual bugs would have been easier to assign / keep track of
Comment 10 Jakub Jelinek 2015-01-26 17:04:23 UTC
I can reproduce 3) with current trunk (again, using x86_64-linux -> powerpc64-linux cross).
The problem is that on
(set (reg:DI 213)
    (plus:DI (reg:DI 211 [ D.2022+-4 ])
        (const_int -4294967297 [0xfffffffeffffffff])))
we get:
#6  0x000000000093ea52 in gen_raw_REG (mode=DImode, regno=215) at ../../gcc/emit-rtl.c:440
#7  0x000000000093fc35 in gen_reg_rtx (mode=DImode) at ../../gcc/emit-rtl.c:1081
#8  0x000000000116465c in gen_split_1299 (curr_insn=0x7ffff19a4000, operands=0x1d86980 <recog_data>) at ../../gcc/config/rs6000/rs6000.md:1639
#9  0x00000000012693fd in split_11 (x0=0x7ffff19a3f48, insn=0x7ffff19a4000) at ../../gcc/config/rs6000/rs6000.md:305
#10 0x0000000001273870 in split_insns (x0=0x7ffff19a3f48, uncast_insn=0x7ffff19a4000) at ../../gcc/config/rs6000/rs6000.md:12081
#11 0x00000000012a2c0e in combine_split_insns (pattern=0x7ffff19a3f48, insn=0x7ffff19a4000) at ../../gcc/combine.c:552
#12 0x00000000012aaba1 in try_combine (i3=0x7ffff19a4000, i2=0x7ffff1935d80, i1=0x7ffff1935d40, i0=0x0, new_direct_jump_p=0x7fffffffde7c, 
    last_combined_insn=0x7ffff19a4000) at ../../gcc/combine.c:3482
#13 0x00000000012a49d4 in combine_instructions (f=0x7ffff19698f8, nregs=215) at ../../gcc/combine.c:1396
#14 0x00000000012c7d52 in rest_of_handle_combine () at ../../gcc/combine.c:14107

combine_split_insns takes care to adjust reg_stat vector, but regstat_n_sets_and_refs unfortunately is not a vector, and there is no function to reallocate it and update for the added pseudos.
So, either we need to change that into a vector and add some entry point to grow it, or guard all uses of REG_N_SETS etc. in the combiner with comparison against maximum pseudo at the start of combine, something else?
Comment 11 Jakub Jelinek 2015-01-26 17:57:08 UTC
For 2) a short testcase is:
__uint128_t
foo (void)
{
  __uint128_t a = -1;
  __uint128_t b = a - 0x80000000ULL;
  return a / b;
}
(even on x86_64 native).
Comment 12 Jakub Jelinek 2015-01-26 18:35:14 UTC
2) == #c11 tracked now in PR64807.
Comment 13 Jakub Jelinek 2015-01-27 19:24:32 UTC
The 1) issue is that e.g.
  mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
  *mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
doesn't in any way make sure the unused bits in the structure are all zeros,
they can contain random stack garbage.  While the object is allocated cleared,
then it is overwritten with bits from wide_int constructed.

So I think we want something like:

--- gcc/dwarf2out.c.jj	2015-01-27 19:03:30.000000000 +0100
+++ gcc/dwarf2out.c	2015-01-27 20:10:27.683868052 +0100
@@ -3886,7 +3886,7 @@ add_AT_wide (dw_die_ref die, enum dwarf_
 
   attr.dw_attr = attr_kind;
   attr.dw_attr_val.val_class = dw_val_class_wide_int;
-  attr.dw_attr_val.v.val_wide = ggc_cleared_alloc<wide_int> ();
+  attr.dw_attr_val.v.val_wide = ggc_alloc<wide_int> ();
   *attr.dw_attr_val.v.val_wide = w;
   add_dwarf_attr (die, &attr);
 }
@@ -5728,7 +5728,14 @@ attr_checksum (dw_attr_ref at, struct md
       CHECKSUM (at->dw_attr_val.v.val_double);
       break;
     case dw_val_class_wide_int:
-      CHECKSUM (*at->dw_attr_val.v.val_wide);
+      {
+        unsigned int len = at->dw_attr_val.v.val_wide->get_len ();
+        unsigned int precision = at->dw_attr_val.v.val_wide->get_precision ();
+        CHECKSUM (len);
+        CHECKSUM (precision);
+        CHECKSUM_BLOCK (at->dw_attr_val.v.val_wide->get_val (),
+			HOST_BITS_PER_WIDE_INT * len / HOST_BITS_PER_CHAR);
+      }
       break;
     case dw_val_class_vec:
       CHECKSUM_BLOCK (at->dw_attr_val.v.val_vec.array,
@@ -13162,7 +13169,7 @@ mem_loc_descriptor (rtx rtl, machine_mod
 	  mem_loc_result->dw_loc_oprnd1.v.val_die_ref.external = 0;
 	  mem_loc_result->dw_loc_oprnd2.val_class
 	    = dw_val_class_wide_int;
-	  mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
+	  mem_loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> ();
 	  *mem_loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
 	}
       break;
@@ -13665,7 +13672,7 @@ loc_descriptor (rtx rtl, machine_mode mo
 	  loc_result = new_loc_descr (DW_OP_implicit_value,
 				      GET_MODE_SIZE (mode), 0);
 	  loc_result->dw_loc_oprnd2.val_class = dw_val_class_wide_int;
-	  loc_result->dw_loc_oprnd2.v.val_wide = ggc_cleared_alloc<wide_int> ();
+	  loc_result->dw_loc_oprnd2.v.val_wide = ggc_alloc<wide_int> ();
 	  *loc_result->dw_loc_oprnd2.v.val_wide = std::make_pair (rtl, mode);
 	}
       break;
@@ -24037,7 +24044,14 @@ hash_loc_operands (dw_loc_descr_ref loc,
 	  hstate.add_object (val2->v.val_double.high);
 	  break;
 	case dw_val_class_wide_int:
-	  hstate.add_object (*val2->v.val_wide);
+	  {
+	    unsigned int precision = val2->v.val_wide->get_precision ();
+	    unsigned int len = val2->v.val_wide->get_len ();
+	    hstate.add_object (precision);
+	    hstate.add_object (len);
+	    hstate.add (val2->v.val_wide->get_val (),
+			HOST_BITS_PER_WIDE_INT * len / HOST_BITS_PER_CHAR);
+	  }
 	  break;
 	case dw_val_class_addr:	
 	  inchash::add_rtx (val2->v.val_addr, hstate);
@@ -24128,7 +24142,14 @@ hash_loc_operands (dw_loc_descr_ref loc,
 	    hstate.add_object (val2->v.val_double.high);
 	    break;
 	  case dw_val_class_wide_int:
-	    hstate.add_object (*val2->v.val_wide);
+	    {
+	      unsigned int precision = val2->v.val_wide->get_precision ();
+	      unsigned int len = val2->v.val_wide->get_len ();
+	      hstate.add_object (precision);
+	      hstate.add_object (len);
+	      hstate.add (val2->v.val_wide->get_val (),
+			  HOST_BITS_PER_WIDE_INT * len / HOST_BITS_PER_CHAR);
+	    }
 	    break;
 	  default:
 	    gcc_unreachable ();

or perhaps not hash precision and len separately, but instead call get_full_len to get that length and use that for the get_val () checksumming?

But then there is (question mainly on Cary) the .debug_types checksumming:

    case dw_val_class_const_double:
      CHECKSUM_ULEB128 (DW_FORM_block);
      CHECKSUM_ULEB128 (sizeof (at->dw_attr_val.v.val_double));
      CHECKSUM (at->dw_attr_val.v.val_double);
      break;
        
    case dw_val_class_wide_int:
      CHECKSUM_ULEB128 (DW_FORM_block);
      CHECKSUM_ULEB128 (sizeof (*at->dw_attr_val.v.val_wide));
      CHECKSUM (*at->dw_attr_val.v.val_wide);
      break;

and that one ought to be governed by the DWARF standard, so I wonder how it can get away without converting for endianity etc.
Comment 14 ccoutant 2015-01-27 20:17:46 UTC
> But then there is (question mainly on Cary) the .debug_types checksumming:
>
>     case dw_val_class_const_double:
>       CHECKSUM_ULEB128 (DW_FORM_block);
>       CHECKSUM_ULEB128 (sizeof (at->dw_attr_val.v.val_double));
>       CHECKSUM (at->dw_attr_val.v.val_double);
>       break;
>
>     case dw_val_class_wide_int:
>       CHECKSUM_ULEB128 (DW_FORM_block);
>       CHECKSUM_ULEB128 (sizeof (*at->dw_attr_val.v.val_wide));
>       CHECKSUM (*at->dw_attr_val.v.val_wide);
>       break;
>
> and that one ought to be governed by the DWARF standard, so I wonder how it can
> get away without converting for endianity etc.

There shouldn't be any location lists in .debug_types, so I don't
think the DWARF standard really matters for this case, and it would be
reasonable to use the same hashing you use for other purposes. Some
may slip through, unfortunately, so I covered this case just for
completeness.

-cary
Comment 15 Jakub Jelinek 2015-01-28 20:31:05 UTC
Author: jakub
Date: Wed Jan 28 20:30:30 2015
New Revision: 220216

URL: https://gcc.gnu.org/viewcvs?rev=220216&root=gcc&view=rev
Log:
	PR other/63504
	* dwarf2out.c (add_AT_wide, mem_loc_descriptor, loc_descriptor):
	Use ggc_alloc<wide_int> instead of ggc_cleared_alloc<wide_int>.
	(attr_checksum, attr_checksum_ordered, hash_loc_operands): Checksum
	only get_full_len HOST_WIDE_INTs from get_val () array rather than
	all bits in *val_wide.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
Comment 16 Jakub Jelinek 2015-02-03 09:39:51 UTC
Author: jakub
Date: Tue Feb  3 09:39:19 2015
New Revision: 220368

URL: https://gcc.gnu.org/viewcvs?rev=220368&root=gcc&view=rev
Log:
	PR other/63504
	* combine.c (reg_n_sets_max): New variable.
	(can_change_dest_mode, reg_nonzero_bits_for_combine,
	reg_num_sign_bit_copies_for_combine, get_last_value_validate,
	get_last_value): Use REG_N_SETS only on pseudos < reg_n_sets_max.
	(try_combine): Use INC_REG_N_SETS only on pseudos < reg_n_sets_max.
	(rest_of_handle_combine): Initialize reg_n_sets_max.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/combine.c
Comment 17 Jakub Jelinek 2015-02-03 09:40:50 UTC
I believe all the reported issues are fixed now.  If any further issues come up, they should be filed separately, using a single PR to track too many unrelated things is bad.