# Intel icc compiler warnings

- Thread: https://externals.io/message/12898
- Original archive: https://news-web.php.net/php.internals/12898
- Started by Rasmus Lerdorf on 2004-09-19T05:34:27+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #12898 — Rasmus Lerdorf — 2004-09-19T05:34:27+00:00

URL: https://externals.io/message/12898#12898

Out of curiosity I built HEAD with Intel's icc 8.1 compiler on my Debian
laptop today.  The full set of warnings (425k worth) are at:

   http://lerdorf.com/icc_warnings.txt

There are some fun ones in there, like these:

/home/rasmus/php-src/Zend/zend_alloc.c(252): warning #186: pointless comparison of unsigned integer with zero
  			&& offset >= 0) {
  			          ^

Zend/zend_execute.h(83): warning #1572: floating-point equality and inequality comparisons are unreliable
  			result = (op->value.dval ? 1 : 0);
  			                           ^

/home/rasmus/php-src/sapi/cli/php_cli.c(773): warning #25: quoted string should contain at least one character
  			case '': /* generate indented source mode*/
  			     ^

/home/rasmus/php-src/ext/session/mod_files.c(332): warning #266: function declared implicitly
  	n = pread(data->fd, *val, sbuf.st_size, 0);
  	    ^

/home/rasmus/php-src/ext/session/mod_files.c(368): warning #266: function declared implicitly
  	n = pwrite(data->fd, val, vallen, 0);
  	    ^

The invalid attribute and unsigned vs. signed warnings really clutter
things up making it hard to find the more interesting warnings.

The icc compiled libphp5.so was 9,816,098 bytes vs. 11,804,220 for gcc.
Other things I compiled also consistently showed icc creating much smaller
binaries.  But that appears to just be due to a lot more symbol info.  If
I strip both I get:

gcc  libphp5.so  2,590,412
icc  libphp5.so  2,793,780

Performance-wise it seems the icc binary is slower, but that is only from
a very unscientific benchmark and I wonder if loading an icc php binary
into a gcc Apache binary might not slow things down a bit.  I haven't
looked into the gcc compatibility libraries icc ships with to understand
that well enough.  But on first glance icc appears to generate a larger
and slower libphp5.so.

-Rasmus

---

## #12899 — Meno Abels — 2004-09-19T08:02:41+00:00

URL: https://externals.io/message/12898#12899 · In reply to: #12898

Hello,

my experiences with performance and icc are, it is only faster
if you use the highest optimization flags and the exact target processor
flags. If you have a amd based notebook you are not in business
with icc. 

-meno

---

## #12918 — Andi Gutmans — 2004-09-21T01:02:52+00:00

URL: https://externals.io/message/12898#12918 · In reply to: #12898

I have done some playing around with Intel compiler.
It usually tends to be faster 10-20% but it depends on the flags you use, 
inlining of the program (Intel compiler seems to optimize inlines much better).

Andi

At 10:34 PM 9/18/2004 -0700, Rasmus Lerdorf wrote:
>Out of curiosity I built HEAD with Intel's icc 8.1 compiler on my Debian
>laptop today.  The full set of warnings (425k worth) are at:
>
>    http://lerdorf.com/icc_warnings.txt
>
>There are some fun ones in there, like these:
>
>/home/rasmus/php-src/Zend/zend_alloc.c(252): warning #186: pointless 
>comparison of unsigned integer with zero
>                         && offset >= 0) {
>                                   ^
>
>Zend/zend_execute.h(83): warning #1572: floating-point equality and 
>inequality comparisons are unreliable
>                         result = (op->value.dval ? 1 : 0);
>                                                    ^
>
>/home/rasmus/php-src/sapi/cli/php_cli.c(773): warning #25: quoted string 
>should contain at least one character
>                         case '': /* generate indented source mode*/
>                              ^
>
>/home/rasmus/php-src/ext/session/mod_files.c(332): warning #266: function 
>declared implicitly
>         n = pread(data->fd, *val, sbuf.st_size, 0);
>             ^
>
>/home/rasmus/php-src/ext/session/mod_files.c(368): warning #266: function 
>declared implicitly
>         n = pwrite(data->fd, val, vallen, 0);
>             ^
>
>The invalid attribute and unsigned vs. signed warnings really clutter
>things up making it hard to find the more interesting warnings.
>
>The icc compiled libphp5.so was 9,816,098 bytes vs. 11,804,220 for gcc.
>Other things I compiled also consistently showed icc creating much smaller
>binaries.  But that appears to just be due to a lot more symbol info.  If
>I strip both I get:
>
>gcc  libphp5.so  2,590,412
>icc  libphp5.so  2,793,780
>
>Performance-wise it seems the icc binary is slower, but that is only from
>a very unscientific benchmark and I wonder if loading an icc php binary
>into a gcc Apache binary might not slow things down a bit.  I haven't
>looked into the gcc compatibility libraries icc ships with to understand
>that well enough.  But on first glance icc appears to generate a larger
>and slower libphp5.so.
>
>-Rasmus
