Bug 357010 - drd regression tests fail to compile with Intel compiler
Summary: drd regression tests fail to compile with Intel compiler
Status: RESOLVED INTENTIONAL
Alias: None
Product: valgrind
Classification: Developer tools
Component: drd (show other bugs)
Version: 3.10 SVN
Platform: RedHat Enterprise Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Bart Van Assche
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-21 18:23 UTC by Tanya
Modified: 2018-05-16 19:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed workaround (585 bytes, patch)
2015-12-21 18:25 UTC, Tanya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tanya 2015-12-21 18:23:28 UTC
File drd/tests/std_string.cpp fails to compile with Intel compiler (versions 15.0.3, 16.0.0)

Reproducible: Always

Steps to Reproduce:
1. Configure Valgrind to be built with Intel compiler
2. Build regression tests (make regtest)

Actual Results:  
File drd/tests/std_string.cpp fails to compile

Expected Results:  
Regression tests are built and run

The reason is a known bug of Intel compiler. If gcc 5.2.0 headers are used, in certain cases integers are misinterpreted as iterators: https://software.intel.com/en-us/forums/intel-c-compiler/topic/565143 . The compiler bug has high priority, but it is difficult to fix. The workaround is to change argument type from integer to double for Intel compilation.
Comment 1 Tanya 2015-12-21 18:25:14 UTC
Created attachment 96238 [details]
Proposed workaround
Comment 2 Tanya 2015-12-21 18:27:59 UTC
Comment on attachment 96238 [details]
Proposed workaround

>--- valgrind-3.11.0/drd/tests/std_string.cpp	2015-09-08 16:23:31.000000000 +0300
>+++ valgrind-3.11.0/drd/tests/std_string.cpp	2015-12-15 21:47:14.114795475 +0300
>@@ -35,7 +35,13 @@
> {
>   for (int i = 0; i < 100; i++) {
>     std::string id("000");
>+#ifdef __INTEL_COMPILER
>+// Intel compiler (version 15.0.3 - 16.0.0) fails to compile the following line due to a compiler bug
>+// A known workaround is to use double instead of int
>+    id.append(1.0, 'a' + i);
>+#else
>     id.append(1, 'a' + i);
>+#endif
>     std::list<std::string> record;
>     record.push_back("some data");
>     addRecord();
Comment 3 Bart Van Assche 2018-05-16 19:56:15 UTC
Please reopen this bug if this behavior is reproducible with the latest version of the Intel compiler.