|
From: Paul F. <pa...@so...> - 2022-05-27 12:21:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=60d2018d7c2264dd1385f7129b40edf5313017b4 commit 60d2018d7c2264dd1385f7129b40edf5313017b4 Author: Paul Floyd <pj...@wa...> Date: Fri May 27 14:18:18 2022 +0200 Add new expecteds for drd/tests/annotate_trace_memory[_xml] With clang13 x86 there is a code gen difference wrt GCC: gcc: i64 = 9; 8048a6f: c7 05 68 9f 04 08 09 movl $0x9,0x8049f68 8048a76: 00 00 00 8048a79: c7 05 6c 9f 04 08 00 movl $0x0,0x8049f6c 8048a80: 00 00 00 i64 += 0x12345678ULL; 8048a83: a1 68 9f 04 08 mov 0x8049f68,%eax 8048a88: 8b 15 6c 9f 04 08 mov 0x8049f6c,%edx 8048a8e: 05 78 56 34 12 add $0x12345678,%eax 8048a93: 83 d2 00 adc $0x0,%edx 8048a96: a3 68 9f 04 08 mov %eax,0x8049f68 8048a9b: 89 15 6c 9f 04 08 mov %edx,0x8049f6c clang: i64 = 9; 401ae2: c7 05 64 3f 40 00 00 movl $0x0,0x403f64 401ae9: 00 00 00 401aec: c7 05 60 3f 40 00 09 movl $0x9,0x403f60 401af3: 00 00 00 i64 += 0x12345678ULL; 401af6: 8b 15 60 3f 40 00 mov 0x403f60,%edx 401afc: 81 c2 78 56 34 12 add $0x12345678,%edx 401b02: 83 15 64 3f 40 00 00 adcl $0x0,0x403f64 401b09: 89 15 60 3f 40 00 mov %edx,0x403f60 401b0f: 8d 85 1c ff ff ff lea -0xe4(%ebp),%eax This inversion of the order of the low and high 32bits of the 64bit word causes a difference in traced loads and stores reported by DRD. Diff: --- .../annotate_trace_memory.stderr.exp-32bit-clang | 52 ++++ ...nnotate_trace_memory_xml.stderr.exp-32bit-clang | 302 +++++++++++++++++++++ 2 files changed, 354 insertions(+) diff --git a/drd/tests/annotate_trace_memory.stderr.exp-32bit-clang b/drd/tests/annotate_trace_memory.stderr.exp-32bit-clang new file mode 100644 index 0000000000..3e659fbc01 --- /dev/null +++ b/drd/tests/annotate_trace_memory.stderr.exp-32bit-clang @@ -0,0 +1,52 @@ + +float +store 0x........ size 4 val 1065353216/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 4 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +double +store 0x........ size 8 val 4613937818241073152/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 8 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 8 val 4619567317775286272/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +uint8_t +store 0x........ size 1 val 5/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 1 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 1 val 11/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +uint16_t +store 0x........ size 2 val 7/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 2 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 2 val 8/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +uint32_t +store 0x........ size 4 val 8/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 4 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 4 val 9/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +uint64_t +store 0x........ size 4 val 0/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 4 val 9/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 4 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +load 0x........ size 4 (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 4 val 0/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +store 0x........ size 4 val 305419905/0x........ (thread x / vc ...) + at 0x........: main (annotate_trace_memory.c:?) +Done. + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/annotate_trace_memory_xml.stderr.exp-32bit-clang b/drd/tests/annotate_trace_memory_xml.stderr.exp-32bit-clang new file mode 100644 index 0000000000..13c7a9e5a3 --- /dev/null +++ b/drd/tests/annotate_trace_memory_xml.stderr.exp-32bit-clang @@ -0,0 +1,302 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>4</protocolversion> +<protocoltool>drd</protocoltool> + +<preamble> + <line>...</line> + <line>...</line> + <line>...</line> + <line>...</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>drd</tool> + +<args> + <vargv>...</vargv> + <argv> + <exe>./annotate_trace_memory</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +float + <trace><text>store 0x........ size 4 val 1065353216/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 4 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +double + <trace><text>store 0x........ size 8 val 4613937818241073152/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 8 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 8 val 4619567317775286272/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +uint8_t + <trace><text>store 0x........ size 1 val 5/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 1 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 1 val 11/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +uint16_t + <trace><text>store 0x........ size 2 val 7/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 2 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 2 val 8/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +uint32_t + <trace><text>store 0x........ size 4 val 8/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 4 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 4 val 9/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +uint64_t + <trace><text>store 0x........ size 4 val 0/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 4 val 9/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 4 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>load 0x........ size 4 (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 4 val 0/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> + <trace><text>store 0x........ size 4 val 305419905/0x........ (thread x / vc ...)</text> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>annotate_trace_memory.c</file> + <line>...</line> + </frame> + </stack> + </trace> +Done. + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> +</errorcounts> + +<suppcounts>...</suppcounts> + +</valgrindoutput> + |