public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/55358] New: Valgrind errors
@ 2012-11-16 18:57 hjl.tools at gmail dot com
  2012-11-21 15:31 ` [Bug other/55358] " markus at trippelsdorf dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2012-11-16 18:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

             Bug #: 55358
           Summary: Valgrind errors
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com


With revision 193546, valgrind reports:

==25552== Invalid read of size 8
==25552==    at 0x38F3A88D5F: __GI_mempcpy (in /usr/lib64/libc-2.15.so)
==25552==    by 0x38F3A785DD: _IO_default_xsputn (in /usr/lib64/libc-2.15.so)
==25552==    by 0x38F3A76940: _IO_file_xsputn@@GLIBC_2.2.5 (in
/usr/lib64/libc-2.15.so)
==25552==    by 0x38F3A6C4FC: fwrite (in /usr/lib64/libc-2.15.so)
==25552==    by 0x622AD7: ggc_pch_write_object(ggc_pch_data*, _IO_FILE*, void*,
void*, unsigned long, bool) (ggc-page.c:2322)
==25552==    by 0x74D8C1: gt_pch_save(_IO_FILE*) (ggc-common.c:593) 
==25552==    by 0x610027: c_common_write_pch() (c-pch.c:184)
==25552==    by 0x548D45: cp_write_global_declarations() (decl2.c:3948)
==25552==    by 0x8A252C: compile_file() (toplev.c:559)
==25552==    by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)
==25552==    by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)
==25552==  Address 0x1089a7d8 is not stack'd, malloc'd or (recently) free'd

==25552== Invalid read of size 8
==25552==    at 0x4A0A33A: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881)
==25552==    by 0x74D84B: gt_pch_save(_IO_FILE*) (ggc-common.c:583)
==25552==    by 0x610027: c_common_write_pch() (c-pch.c:184)
==25552==    by 0x548D45: cp_write_global_declarations() (decl2.c:3948)
==25552==    by 0x8A252C: compile_file() (toplev.c:559)
==25552==    by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)
==25552==    by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)
==25552==  Address 0xffffce8 is not stack'd, malloc'd or (recently) free'd

==25565== Invalid write of size 8
==25565==    at 0x4A0A23B: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:881)
==25565==    by 0x74D8E3: gt_pch_save(_IO_FILE*) (ggc-common.c:595)
==25565==    by 0x610027: c_common_write_pch() (c-pch.c:184)
==25565==    by 0x548D45: cp_write_global_declarations() (decl2.c:3948)
==25565==    by 0x8A252C: compile_file() (toplev.c:559)
==25565==    by 0x8A4087: toplev_main(int, char**) (toplev.c:1881)
==25565==    by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)
==25565==  Address 0xfb40778 is not stack'd, malloc'd or (recently) free'd

==26359== Invalid read of size 4
==26359==    at 0xB58AEE: rest_of_handle_ree() (ree.c:617)
==26359==    by 0x74ADA3: execute_one_pass(opt_pass*) (passes.c:2339)
==26359==    by 0x74B174: execute_pass_list(opt_pass*) (passes.c:2400)
==26359==    by 0x74B186: execute_pass_list(opt_pass*) (passes.c:2401)
==26359==    by 0x74B186: execute_pass_list(opt_pass*) (passes.c:2401)
==26359==    by 0x5AB16D: expand_function(cgraph_node*) (cgraphunit.c:1643)
==26359==    by 0x5AC786: compile() (cgraphunit.c:1747)
==26359==    by 0x5ACBA9: finalize_compilation_unit() (cgraphunit.c:2122)
==26359==    by 0x4E47DF: c_write_global_declarations() (c-decl.c:10128)
==26359==    by 0x7D7F4C: compile_file() (toplev.c:559)
==26359==    by 0x7D9AA7: toplev_main(int, char**) (toplev.c:1881)
==26359==    by 0x38F3A21674: (below main) (in /usr/lib64/libc-2.15.so)
==26359==  Address 0x4e10d51 is 2,785 bytes inside a block of size 2,788
alloc'd
==26359==    at 0x4A06B0F: calloc (vg_replace_malloc.c:593)
==26359==    by 0xC0F708: xcalloc (xmalloc.c:162)
==26359==    by 0xB59070: rest_of_handle_ree() (ree.c:886)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
@ 2012-11-21 15:31 ` markus at trippelsdorf dot de
  2012-11-21 16:53 ` markus at trippelsdorf dot de
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-21 15:31 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-21 15:30:35 UTC ---
The last error is reproducible with e.g.:

 % /var/tmp/gcc_valgrind/usr/local/bin/gcc -w -O2 -c
/home/markus/gcc/libiberty/cp-demangle.c
==6842== Invalid read of size 4
==6842==    at 0xD20A91: rest_of_handle_ree() (ree.c:615)
==6842==    by 0x826B2A: execute_one_pass(opt_pass*) (passes.c:2327)
==6842==    by 0x826FA4: execute_pass_list(opt_pass*) (passes.c:2387)
==6842==    by 0x826FB6: execute_pass_list(opt_pass*) (passes.c:2388)
==6842==    by 0x826FB6: execute_pass_list(opt_pass*) (passes.c:2388)
==6842==    by 0x5EC801: expand_function(cgraph_node*) (cgraphunit.c:1641)
==6842==    by 0x5EE5C6: compile() (cgraphunit.c:1745)
==6842==    by 0x5EEC69: finalize_compilation_unit() (cgraphunit.c:2120)
==6842==    by 0x4D52EB: c_write_global_declarations() (c-decl.c:10120)
==6842==    by 0x8C845C: compile_file() (toplev.c:559)
==6842==    by 0x8CA319: toplev_main(int, char**) (toplev.c:1881)
==6842==    by 0x4ECD894: (below main) (libc-start.c:258)
==6842==  Address 0x5b37f51 is 2,577 bytes inside a block of size 2,580 alloc'd
==6842==    at 0x4026BA4: calloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6842==    by 0xDFABD8: xcalloc (xmalloc.c:162)
==6842==    by 0xD211C6: rest_of_handle_ree() (ree.c:884)
==6842==    by 0x826B2A: execute_one_pass(opt_pass*) (passes.c:2327)
...


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
  2012-11-21 15:31 ` [Bug other/55358] " markus at trippelsdorf dot de
@ 2012-11-21 16:53 ` markus at trippelsdorf dot de
  2012-11-21 17:17 ` markus at trippelsdorf dot de
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-21 16:53 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #2 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-21 16:52:59 UTC ---
==13066== Conditional jump or move depends on uninitialised value(s)
==13066==    at 0x56333A: pp_c_specifier_qualifier_list(c_pretty_print_info*,
tree_node*) (c-pretty-print.c:449)
==13066==    by 0x563668: pp_c_type_id(c_pretty_print_info*, tree_node*)
(c-pretty-print.c:621)
==13066==    by 0x4FF780: c_tree_printer(pretty_print_info*, text_info*, char
const*, int, bool, bool, bool) (c-objc-common.c:149)
==13066==    by 0xDB6682: pp_base_format(pretty_print_info*, text_info*)
(pretty-print.c:509)
==13066==    by 0xDB4478: diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) (diagnostic.c:756)
==13066==    by 0xDB5043: error_at(unsigned int, char const*, ...)
(diagnostic.c:1036)
==13066==    by 0x4EA6BA: build_component_ref(unsigned int, tree_node*,
tree_node*) (c-typeck.c:2156)
==13066==    by 0x50968B: c_parser_postfix_expression_after_primary(c_parser*,
unsigned int, c_expr) (c-parser.c:6946)
==13066==    by 0x501568: c_parser_postfix_expression(c_parser*)
(c-parser.c:6779)
==13066==    by 0x502F22: c_parser_unary_expression(c_parser*)
(c-parser.c:5978)
==13066==    by 0x50733E: c_parser_cast_expression(c_parser*, c_expr*)
(c-parser.c:5830)
==13066==    by 0x502E06: c_parser_unary_expression(c_parser*)
(c-parser.c:5892)
==13066==
==13066== Conditional jump or move depends on uninitialised value(s)
==13066==    at 0x5633C8: pp_c_specifier_qualifier_list(c_pretty_print_info*,
tree_node*) (c-pretty-print.c:497)
==13066==    by 0x563668: pp_c_type_id(c_pretty_print_info*, tree_node*)
(c-pretty-print.c:621)
==13066==    by 0x4FF780: c_tree_printer(pretty_print_info*, text_info*, char
const*, int, bool, bool, bool) (c-objc-common.c:149)
==13066==    by 0xDB6682: pp_base_format(pretty_print_info*, text_info*)
(pretty-print.c:509)
==13066==    by 0xDB4478: diagnostic_report_diagnostic(diagnostic_context*,
diagnostic_info*) (diagnostic.c:756)
==13066==    by 0xDB5043: error_at(unsigned int, char const*, ...)
(diagnostic.c:1036)
==13066==    by 0x4EA6BA: build_component_ref(unsigned int, tree_node*,
tree_node*) (c-typeck.c:2156)
==13066==    by 0x50968B: c_parser_postfix_expression_after_primary(c_parser*,
unsigned int, c_expr) (c-parser.c:6946)
==13066==    by 0x501568: c_parser_postfix_expression(c_parser*)
(c-parser.c:6779)
==13066==    by 0x502F22: c_parser_unary_expression(c_parser*)
(c-parser.c:5978)
==13066==    by 0x50733E: c_parser_cast_expression(c_parser*, c_expr*)
(c-parser.c:5830)
==13066==    by 0x502E06: c_parser_unary_expression(c_parser*)
(c-parser.c:5892)
==13066==


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
  2012-11-21 15:31 ` [Bug other/55358] " markus at trippelsdorf dot de
  2012-11-21 16:53 ` markus at trippelsdorf dot de
@ 2012-11-21 17:17 ` markus at trippelsdorf dot de
  2012-11-21 17:20 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-21 17:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-21 17:17:23 UTC ---
I hope it's OK to just dump the errors here as I encounter them.
This one looks similar to the rest_of_handle_ree() issue:

==23637== Invalid write of size 8
==23637==    at 0xCF9951: rest_of_handle_dse() (dse.c:2874)
==23637==    by 0x826B2A: execute_one_pass(opt_pass*) (passes.c:2327)
==23637==    by 0x826FA4: execute_pass_list(opt_pass*) (passes.c:2387)
==23637==    by 0x826FB6: execute_pass_list(opt_pass*) (passes.c:2388)
==23637==    by 0x5EC801: expand_function(cgraph_node*) (cgraphunit.c:1641)
==23637==    by 0x5EE5C6: compile() (cgraphunit.c:1745)
==23637==    by 0x5EEC69: finalize_compilation_unit() (cgraphunit.c:2120)
==23637==    by 0x4D52EB: c_write_global_declarations() (c-decl.c:10120)
==23637==    by 0x8C845C: compile_file() (toplev.c:559)
==23637==    by 0x8CA319: toplev_main(int, char**) (toplev.c:1881)
==23637==    by 0x4ECD894: (below main) (libc-start.c:258)
==23637==  Address 0x69fdd50 is 112 bytes inside a block of size 11,208 alloc'd
==23637==    at 0x4028ECB: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23637==    by 0xDFAB97: xmalloc (xmalloc.c:147)
==23637==    by 0x57E6C8: pool_alloc(alloc_pool_def*) (alloc-pool.c:282)
==23637==    by 0xCF8F1C: record_store(rtx_def*, bb_info*) (dse.c:1544)
==23637==    by 0xCF9D14: rest_of_handle_dse() (dse.c:2676)
==23637==    by 0x826B2A: execute_one_pass(opt_pass*) (passes.c:2327)
==23637==    by 0x826FA4: execute_pass_list(opt_pass*) (passes.c:2387)
==23637==    by 0x826FB6: execute_pass_list(opt_pass*) (passes.c:2388)
==23637==    by 0x5EC801: expand_function(cgraph_node*) (cgraphunit.c:1641)
==23637==    by 0x5EE5C6: compile() (cgraphunit.c:1745)
==23637==    by 0x5EEC69: finalize_compilation_unit() (cgraphunit.c:2120)
==23637==    by 0x4D52EB: c_write_global_declarations() (c-decl.c:10120)
==23637==


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2012-11-21 17:17 ` markus at trippelsdorf dot de
@ 2012-11-21 17:20 ` jakub at gcc dot gnu.org
  2012-11-23 13:10 ` markus at trippelsdorf dot de
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-21 17:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-21 17:20:02 UTC ---
The ree.c miscompilation tracked in PR55430 now.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2012-11-21 17:20 ` jakub at gcc dot gnu.org
@ 2012-11-23 13:10 ` markus at trippelsdorf dot de
  2012-11-28  8:51 ` markus at trippelsdorf dot de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-23 13:10 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #5 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-23 13:08:54 UTC ---
A new one:

==2442== Invalid write of size 8
==2442==    at 0x672DF6: iterative_hash_canonical_type(tree_node*, unsigned
int) (gimple.c:3170)
==2442==    by 0xD3F4A0: htab_find_slot (hashtab.c:712)
==2442==    by 0x67DEA8: gimple_register_canonical_type(tree_node*)
(gimple.c:3438)
==2442==    by 0x4D25C5: uniquify_nodes(data_in*, unsigned int) (lto.c:2050)
==2442==    by 0x4D3A0A: lto_main() (lto.c:2089)
==2442==    by 0x82195B: compile_file() (toplev.c:545)
==2442==    by 0x8235CF: toplev_main(int, char**) (toplev.c:1881)
==2442==    by 0x4ECD884: (below main) (libc-start.c:258)
==2442==  Address 0x4031e98 is not stack'd, malloc'd or (recently) free'd
==2442==


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2012-11-23 13:10 ` markus at trippelsdorf dot de
@ 2012-11-28  8:51 ` markus at trippelsdorf dot de
  2012-11-28 13:21 ` markus at trippelsdorf dot de
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-28  8:51 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #6 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-28 08:51:26 UTC ---
Created attachment 28818
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28818
stl benchmark

The last issue can be reproduced with an old C++ STL benchmark
from Stepanov and Stroustrup (attached):

markus@x4 ~ % /var/tmp/gcc_valgrind/usr/local/bin/g++ -O2 -fprofile-generate
bench.cpp
markus@x4 ~ % ./a.out
size            array   vector with pointers    vector with iterators   deque  
list            set             multiset
10              0.18            0.18            0.19            0.44           
1.08            0.67            1.08
...
markus@x4 ~ % /var/tmp/gcc_valgrind/usr/local/bin/g++ -O2 -fprofile-use -flto
bench.cpp
==22679== Invalid write of size 8
==22679==    at 0x68007D: iterative_hash_canonical_type(tree_node*, unsigned
int) (gimple.c:3170)
==22679==    by 0xD611C0: htab_find_slot (hashtab.c:712)
==22679==    by 0x68A918: gimple_register_canonical_type(tree_node*)
(gimple.c:3438)
==22679==    by 0x4D093B: lto_file_read(lto_file_struct*, _IO_FILE*, int*)
(lto.c:2050)
==22679==    by 0x4D25EA: lto_main() (lto.c:2966)
==22679==    by 0x82A5B5: compile_file() (toplev.c:545)
==22679==    by 0x82C4D9: toplev_main(int, char**) (toplev.c:1884)
==22679==    by 0x4ECD884: (below main) (libc-start.c:258)
==22679==  Address 0x4031e98 is not stack'd, malloc'd or (recently) free'd
==22679==


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2012-11-28  8:51 ` markus at trippelsdorf dot de
@ 2012-11-28 13:21 ` markus at trippelsdorf dot de
  2012-11-28 14:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-28 13:21 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #7 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-28 13:20:54 UTC ---
The fix for:
==23637== Invalid write of size 8
==23637==    at 0xCF9951: rest_of_handle_dse() (dse.c:2874)
...
seems to be simple. Because of "delete_dead_store_insn (ptr);"
"s_info->redundant_reason" may point into lala land:

(gdb) p *s_info
$3 = {is_set = false, is_large = false, group_id = 0, cse_base =
0xafafafafafafafaf, mem = 0xafafafafafafafaf, mem_addr = 0xafafafafafafafaf,
alias_set = -1347440721, begin = -5787213827046133841, end =
-5787213827046133841, positions_needed = {small_bitmask = 12659530246663417775,
large = {bmap = 0xafafafafafafafaf, count = -1347440721}}, next =
0xafafafafafafafaf, rhs = 0xafafafafafafafaf, const_rhs = 0xafafafafafafafaf,
redundant_reason = 0xafafafafafafafaf}
(gdb) p *ptr
$8 = {cannot_delete = true, wild_read = false, non_frame_wild_read = false,
frame_read = false, stack_pointer_based = false, contains_cselib_groups =
false, insn = 0x0, store_rec = 0x0, read_rec = 0x0, fixed_regs_live =
0x5e34f30, prev_insn = 0x54e9da0, next_local_store = 0x54e9da0}


diff --git a/gcc/dse.c b/gcc/dse.c
index f879adb..8d12e8d 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2869,7 +2869,7 @@ dse_step1 (void)
                                 INSN_UID (s_info->redundant_reason->insn));
                      delete_dead_store_insn (ptr);
                    }
-                 if (s_info)
+                 if (ptr->store_rec && s_info)
                    s_info->redundant_reason = NULL;
                  free_store_info (ptr);
                }


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2012-11-28 13:21 ` markus at trippelsdorf dot de
@ 2012-11-28 14:48 ` jakub at gcc dot gnu.org
  2012-11-28 16:50 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-28 14:48 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-11-28
     Ever Confirmed|0                           |1

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-28 14:47:33 UTC ---
(In reply to comment #7)
> diff --git a/gcc/dse.c b/gcc/dse.c
> index f879adb..8d12e8d 100644
> --- a/gcc/dse.c
> +++ b/gcc/dse.c
> @@ -2869,7 +2869,7 @@ dse_step1 (void)
>                                  INSN_UID (s_info->redundant_reason->insn));
>                       delete_dead_store_insn (ptr);
>                     }
> -                 if (s_info)
> +                 if (ptr->store_rec && s_info)
>                     s_info->redundant_reason = NULL;
>                   free_store_info (ptr);
>                 }

Actually, I fail to see what is that if (s_info) s_info->redundant_reason =
NULL;
good for, the following free_store_info (ptr) should pool_free s_info if
delete_dead_store_insn hasn't already called free_store_info.  And it doesn't
seem that pool_alloced store info recs would rely on the field being cleared,
it seems we initialize it always:
  store_info->redundant_reason = redundant_reason;
Thus, my preference would be just drop the two lines instead.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2012-11-28 14:48 ` jakub at gcc dot gnu.org
@ 2012-11-28 16:50 ` jakub at gcc dot gnu.org
  2012-11-28 19:59 ` markus at trippelsdorf dot de
  2013-10-14  9:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-28 16:50 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-28 16:49:49 UTC ---
Author: jakub
Date: Wed Nov 28 16:49:35 2012
New Revision: 193900

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193900
Log:
    PR other/55358
    * dse.c (rest_of_handle_dse): Remove superfluous clearing.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dse.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2012-11-28 16:50 ` jakub at gcc dot gnu.org
@ 2012-11-28 19:59 ` markus at trippelsdorf dot de
  2013-10-14  9:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: markus at trippelsdorf dot de @ 2012-11-28 19:59 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #10 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-11-28 19:58:43 UTC ---
iterative_hash_canonical_type (type=0x5941dc8, val=0) at
/home/markus/gcc/gcc/gimple.c:3170
3170      *slot = (void *) mp;
(gdb) bt
#0  iterative_hash_canonical_type (type=0x5941dc8, val=0) at
/home/markus/gcc/gcc/gimple.c:3170
#1  0x0000000000d616c1 in htab_find_slot (htab=0x4030850, element=0x5941dc8,
insert=INSERT) at /home/markus/gcc/libiberty/hashtab.c:712
#2  0x000000000068ac99 in gimple_register_canonical_type (t=0x5941dc8) at
/home/markus/gcc/gcc/gimple.c:3438
#3  0x00000000004d09dc in uniquify_nodes (from=3148, data_in=0x5601990) at
/home/markus/gcc/gcc/lto/lto.c:2050
#4  lto_read_decls (resolutions=..., data=0x5d33480, decl_data=0x404a000) at
/home/markus/gcc/gcc/lto/lto.c:2089
#5  lto_file_finalize (file=<optimized out>, file_data=0x404a000) at
/home/markus/gcc/gcc/lto/lto.c:2341
#6  lto_create_files_from_ids (count=0x7fefffd98, file_data=0x404a000,
file=0x5330490) at /home/markus/gcc/gcc/lto/lto.c:2351
#7  lto_file_read (file=<optimized out>,
resolution_file=resolution_file@entry=0x5300020, count=count@entry=0x7fefffd98)
at /home/markus/gcc/gcc/lto/lto.c:2391
#8  0x00000000004d268b in read_cgraph_and_symbols (fnames=<optimized out>,
nfiles=1) at /home/markus/gcc/gcc/lto/lto.c:2966
#9  lto_main () at /home/markus/gcc/gcc/lto/lto.c:3370
#10 0x000000000082aa46 in compile_file () at /home/markus/gcc/gcc/toplev.c:545
#11 0x000000000082c96a in do_compile () at /home/markus/gcc/gcc/toplev.c:1884
#12 toplev_main (argc=17, argv=0x521ab00) at /home/markus/gcc/gcc/toplev.c:1960
#13 0x0000000004ecd885 in __libc_start_main (main=0xd0af50 <main(int, char**)>,
argc=17, ubp_av=0x7feffff18, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7feffff08) at libc-start.c:258
#14 0x00000000004b07e9 in _start () at ../sysdeps/x86_64/start.S:123
(gdb) p *slot
$1 = (void *) 0xa5a5a5a5a5a5a5a5
(gdb) p *mp
$2 = {base = {from = 0x5941dc8}, to = 2655783743}
(gdb) p slot
$3 = (void **) 0x4031e98
(gdb) p mp
$4 = (tree_int_map *) 0x593b620


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug other/55358] Valgrind errors
  2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
                   ` (9 preceding siblings ...)
  2012-11-28 19:59 ` markus at trippelsdorf dot de
@ 2013-10-14  9:24 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-14  9:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55358

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Oct 14 09:24:36 2013
New Revision: 203517

URL: http://gcc.gnu.org/viewcvs?rev=203517&root=gcc&view=rev
Log:
2013-10-14  Richard Biener  <rguenther@suse.de>

    PR middle-end/58712
    PR middle-end/55358
    * gimple.c (iterative_hash_canonical_type): Make sure to
    record the hash into the correct hashtable slot.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimple.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-10-14  9:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-16 18:57 [Bug other/55358] New: Valgrind errors hjl.tools at gmail dot com
2012-11-21 15:31 ` [Bug other/55358] " markus at trippelsdorf dot de
2012-11-21 16:53 ` markus at trippelsdorf dot de
2012-11-21 17:17 ` markus at trippelsdorf dot de
2012-11-21 17:20 ` jakub at gcc dot gnu.org
2012-11-23 13:10 ` markus at trippelsdorf dot de
2012-11-28  8:51 ` markus at trippelsdorf dot de
2012-11-28 13:21 ` markus at trippelsdorf dot de
2012-11-28 14:48 ` jakub at gcc dot gnu.org
2012-11-28 16:50 ` jakub at gcc dot gnu.org
2012-11-28 19:59 ` markus at trippelsdorf dot de
2013-10-14  9:24 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).