Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

ICC 12.0.4: Bad Code Generation at -O2 with Crypto++ Library

noloader
Beginner
534 Views
Hi All,

I'm compiling Wei Dai's Crypto++ (http://www.cryptopp.com/) using ICPC (ICC) 12.0.4 20110427. At -O1, the self tests run fine. At -O2, one self test fails.

Under other compilers (Visual Studio 2005, 2008, 2010, GCC 4.x, CLang 2.8 and 2.9), the Crypto++ self tests run fine. In addition, I've used John Regehr's Undefined Behavior Checker (UBC, http://embed.cs.utah.edu/ubc/) to verify no funny business with undefined behavior.

Any ideas what might cause ICC to fail at -O2?

Jeffrey Walton
Baltimore, MD, US

$ icpc --version
icpc (ICC) 12.0.4 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
$ uname -a
Linux studio 2.6.32-34-generic #77-Ubuntu SMP Tue Sep 13 19:39:17 UTC 2011 x86_64 GNU/Linux

0 Kudos
11 Replies
noloader
Beginner
534 Views
Forogt to mention.....

Fetch Crypto++:
$ svn checkout https://cryptopp.svn.sourceforge.net/svnroot/cryptopp/trunk/c5 cryptopp

Make Crypto++:
$ cd cryptopp
$ make CXX=icpc

Run Crypto++ self tests:
$ ./cryptest.exe v

					
				
			
			
				
			
			
			
			
			
			
			
		
0 Kudos
TimP
Honored Contributor III
534 Views
That svn command doesn't connect for me here. There have been 2 updates since the icc you quote. It's a long way from gcc 4.1 to current 4.6, and choice of underlying gcc could impact icc. You may need to narrow it down sufficiently yourself to file a bug report.l
0 Kudos
noloader
Beginner
534 Views
Thanks Tim,

> That svn command doesn't connect for me here.
I cannot duplicate the problem at my location (Baltimore, MD, US)

> There have been 2 updates since the compiler you quote.
Arg.... My apologies (I thought it might be the case).

Where is Intel's update program? Nothing was readily apparent when I went hunting.

Jeff

$ ls /opt/intel/bin/
codecov iccvars.csh idbc link_install.sh proforder
compilervars.csh iccvars.sh inspxe-inject map_opts tselect
compilervars.sh icpc inspxe-runsc profdcg xiar
icc idb inspxe-wrap profmerge xild
$
$ find /opt/intel/bin/ -name *update*
$
0 Kudos
TimP
Honored Contributor III
534 Views
If you haven't already done so, register your license at https://registrationcenter.intel.com then log in as registered user and download an updated compiler.
0 Kudos
noloader
Beginner
534 Views
> then log in as registered user and download an updated compiler.
Thanks Tim.

OK. I downloaded the latest version supplied from http://software.intel.com/en-us/articles/non-commercial-software-development/. I installed Studio XE 2011 SP1 by running `sudo ./install.sh`. I took all the defaults (same as last time), including 'use exisiting product key'. The installer removed Update 3 before installing SP1 (or so it claimed).

I now have to work through a linker problem.

Jeff
0 Kudos
noloader
Beginner
534 Views
> There have been 2 updates since the icc you quote.
Out of curiosity, how can you tell? It looks like the latest version of ICC has the same date stamp as the earlier version.

Jeff
0 Kudos
noloader
Beginner
534 Views
> It's a long way from gcc 4.1 to current 4.6, and choice of underlying gcc could impact icc.
Ah, right. Ubuntu is a little buggy with their incessant tinkering with the tool chain [1].

$ gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[1] https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/807156
0 Kudos
noloader
Beginner
534 Views
> You may need to narrow it down sufficiently yourself to file a bug report.l
Yes, I wanted to file a bug report (the experts are the best for this sort of thing once dumb mistakes and illegal programs are ruled out). But I could not find where to do it. I thought I found it, but it appears the web form I filed out was sent to the bit bucket (no responses).

Jeff
0 Kudos
TimP
Honored Contributor III
534 Views
If you would mention the issue number from your filing on premier.intel.com, I would hope that someone with privilege to look it up would do so. I myself haven't been able to get access to those issues this year, even when the customer requested it specifically.
0 Kudos
noloader
Beginner
534 Views
Thanks Tim.

Over the last 15 years, I've watched Crypto++ break both MSVC and GCC on several occasions (it was especially bad when templates were incoroporated in the 1990s). Crypto++ still causes problems every now and then; for example https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/807156.

I've had problems with both Intel compilers I tried when using the library. Perhaps Intel could adopt Crypto++ as a test case.

Jeff

Fetch Crypto++:
$ svn checkout https://cryptopp.svn.sourceforge.net/svnroot/cryptopp/trunk/c5 cryptopp

Make Crypto++:
$ cd cryptopp
$ make CXX=icpc

Run Crypto++ self tests:
$ ./cryptest.exe v
0 Kudos
TimP
Honored Contributor III
534 Views
Many individual test cases mentioned in the forum or in premier.intel.com issues make it permanently into compiler test suite, and many do not.
For sourceforge applications, my own opinion is it's probably more realistic for people working on and familiar with the application to submit issues as appropriate.
0 Kudos
Reply