Message ID | 20121112164404.GP1886@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
Jakub Jelinek <jakub@redhat.com> writes: > The bug is elsewhere, the following patch should fix this > (and I've reordered the assignments according to the call arg > number, so that it is more readable at the same time). > Ok for trunk? > > 2012-11-12 Jakub Jelinek <jakub@redhat.com> > > * asan.c (instrument_builtin_call) <case BUILT_IN_BCOPY>: Fix up > dest assignment. > > --- gcc/asan.c.jj 2012-11-12 17:16:16.000000000 +0100 > +++ gcc/asan.c 2012-11-12 17:39:19.673022734 +0100 > @@ -1044,16 +1044,16 @@ instrument_builtin_call (gimple_stmt_ite > /* (s, s, n) style memops. */ > case BUILT_IN_BCMP: > case BUILT_IN_MEMCMP: > - len = gimple_call_arg (call, 2); > source0 = gimple_call_arg (call, 0); > source1 = gimple_call_arg (call, 1); > + len = gimple_call_arg (call, 2); > break; > > /* (src, dest, n) style memops. */ > case BUILT_IN_BCOPY: > - len = gimple_call_arg (call, 2); > source0 = gimple_call_arg (call, 0); > - dest = gimple_call_arg (call, 2); > + dest = gimple_call_arg (call, 1); > + len = gimple_call_arg (call, 2); > break; > > /* (dest, src, n) style memops. */ Indeed. I was about to send a similar patch after Tobias' report. Thanks.
Another ICE: % cat test.ii int i; % g++ -faddress-sanitizer -c -g -O1 test.ii test.ii:1:7: internal compiler error: Segmentation fault int i; ^ 0xa5cb5f crash_signal /home/markus/gcc/gcc/toplev.c:334 inconsistent DWARF line number info 0x4cf588 cp_classify_record /home/markus/gcc/gcc/cp/cp-lang.c:131 0x7ee7e3 record_type_tag /home/markus/gcc/gcc/dwarf2out.c:16914 0x7ee7e3 gen_struct_or_union_type_die /home/markus/gcc/gcc/dwarf2out.c:19078 0x7ee7e3 gen_tagged_type_die /home/markus/gcc/gcc/dwarf2out.c:19303 0x7ee7e3 gen_tagged_type_die /home/markus/gcc/gcc/dwarf2out.c:19246 0x7f5dce gen_type_die_with_usage /home/markus/gcc/gcc/dwarf2out.c:19450 0x7f6b9c modified_type_die /home/markus/gcc/gcc/dwarf2out.c:10180 0x7f68c5 modified_type_die /home/markus/gcc/gcc/dwarf2out.c:10238 0x7f8cd0 add_type_attribute /home/markus/gcc/gcc/dwarf2out.c:16486 0x7f4bf1 gen_formal_parameter_die /home/markus/gcc/gcc/dwarf2out.c:17079 0x7f520b gen_formal_types_die /home/markus/gcc/gcc/dwarf2out.c:17175 0x7f181c gen_subprogram_die /home/markus/gcc/gcc/dwarf2out.c:17909 0x7f8075 force_decl_die /home/markus/gcc/gcc/dwarf2out.c:19733 0x7f8721 resolve_addr /home/markus/gcc/gcc/dwarf2out.c:22661 0x7f83f9 resolve_addr /home/markus/gcc/gcc/dwarf2out.c:22683 0x7f83f9 resolve_addr /home/markus/gcc/gcc/dwarf2out.c:22683 0x807392 dwarf2out_finish /home/markus/gcc/gcc/dwarf2out.c:23305 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
--- gcc/asan.c.jj 2012-11-12 17:16:16.000000000 +0100 +++ gcc/asan.c 2012-11-12 17:39:19.673022734 +0100 @@ -1044,16 +1044,16 @@ instrument_builtin_call (gimple_stmt_ite /* (s, s, n) style memops. */ case BUILT_IN_BCMP: case BUILT_IN_MEMCMP: - len = gimple_call_arg (call, 2); source0 = gimple_call_arg (call, 0); source1 = gimple_call_arg (call, 1); + len = gimple_call_arg (call, 2); break; /* (src, dest, n) style memops. */ case BUILT_IN_BCOPY: - len = gimple_call_arg (call, 2); source0 = gimple_call_arg (call, 0); - dest = gimple_call_arg (call, 2); + dest = gimple_call_arg (call, 1); + len = gimple_call_arg (call, 2); break; /* (dest, src, n) style memops. */