Bug 357035

Summary: Uninitialized variable of type double is reported twice in intel-compiled application.
Product: [Developer tools] valgrind Reporter: Tanya <tatyana.a.volnina>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED NOT A BUG    
Severity: minor CC: tom
Priority: NOR    
Version First Reported In: 3.10 SVN   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: a reproducer application

Description Tanya 2015-12-22 12:13:20 UTC
Created attachment 96257 [details]
a reproducer application

If an application is built with intel compiler, memcheck reports uninitialized variables of type double twice.

Steps to build and run the test:
    icc -O0 double_report.c -o double_report_icc
    valgrind -q ./double_report_icc
A reproducer (double_report.c) is attached.

Expected result (reported for gcc-compiled application):
==xxxx== Conditional jump or move depends on uninitialised value(s)
==xxxx==    at 0xxxxxxx: main (in /<file_path>/double_report_icc)
==xxxx==

Actual result:
==xxxx== Conditional jump or move depends on uninitialised value(s)
==xxxx==    at 0xxxxxxx: main (in /<file_path>/double_report_icc)
==xxxx==
==xxxx== Conditional jump or move depends on uninitialised value(s)
==xxxx==    at 0xxxxxxx: main (in /<file_path>/double_report_icc)
==xxxx==
Comment 1 Tom Hughes 2015-12-22 14:23:51 UTC
Unfortunately because you've blanked out the addresses it's hard to tell what's going on here... If the addresses are different then the answer would seem to be simply that the compiler is generating code that reads the variable twice. Even if they're the same then the only reasonable explanation I can see is that the compiled code is passing through that instruction twice when run.

In short I suspect this is simply an artefact of the code generated by the compiler rather than any bug in valgrind.
Comment 2 Tanya 2015-12-22 14:36:56 UTC
Tom Hughes, yes, you are correct, the variable is actually read twice. Please feel free to close/discard the ticket.
Comment 3 Tom Hughes 2015-12-22 14:46:24 UTC
Thanks for confirming that.