|
From: Christian B. <bor...@de...> - 2011-03-04 13:40:19
|
Josef,
I had problems with callgrind on s390 from the beginning:
Callgrind: jumps.c:164 (new_jcc): Assertion '(0 <= jmp) && (jmp <= from->bb->cjmp_count)' failed.
==39793== at 0x4010209D4: report_and_quit (m_libcassert.c:209)
==39793== by 0x401020BCB: vgPlain_assert_fail (m_libcassert.c:283)
==39793== by 0x401011159: vgCallgrind_get_jcc (jumps.c:164)
==39793== by 0x401003D49: vgCallgrind_push_call_stack (callstack.c:217)
==39793== by 0x4010024F3: vgCallgrind_setup_bbcc (bbcc.c:844)
==39793== by 0x40394E5C7: ???
[...]
The last fixes, together with the new assert (and some printf debugging)
finally pointed me to a potential problem. In our ld startup code we always
triggered the following case:
if (!skip && CLG_(current_state).nonskipped) {
/* a call from skipped to nonskipped */
CLG_(current_state).bbcc = CLG_(current_state).nonskipped;
}
This changes the current bbcc, but does not adopt the passed value.
What do you think about the following fix? It makes s390x pass a callgrind
tests.If ok, please apply.
Index: src/callgrind/bbcc.c
===================================================================
--- src/callgrind/bbcc.c (revision 1021)
+++ src/callgrind/bbcc.c (working copy)
@@ -841,6 +841,7 @@
if (!skip && CLG_(current_state).nonskipped) {
/* a call from skipped to nonskipped */
CLG_(current_state).bbcc = CLG_(current_state).nonskipped;
+ passed = CLG_(current_state).bbcc->bb->cjmp_count;
}
CLG_(push_call_stack)(CLG_(current_state).bbcc, passed,
bbcc, sp, skip);
|