g++ 4.8 fails with -Ox option

Patrick Begou Patrick.Begou@legi.grenoble-inp.fr
Fri Jul 19 17:39:00 GMT 2013


I get a strange problem with g++ 4.8. My server has gcc44-c++-4.4.1 installed.
I've installed gcc4.8 in my home from gcc-4.8-20130711.tar.gz 
PATH, LD_LIBRARY_PATH are setup to reach first this 4.8 install.

Initially I get the error runing the configure script to build OpenMPI, so I 
extract the small peace of test code in "prog.C" file for testing and:

g++ -o conftest -DNDEBUG -finline-functions prog.C
Is working but:
g++ -o conftest -O3 -DNDEBUG -finline-functions prog.C

In file included from /usr/include/stdio.h:909:0,
from prog.C:141:
/usr/include/bits/stdio.h: In function ‘__ssize_t getline(char**, size_t*, FILE*)’:
/usr/include/bits/stdio.h:118:52: error: ‘__getdelim’ was not declared in this scope
return __getdelim (__lineptr, __n, '\n', __stream);

Same behavior with -O2 or -O1.
g++ 4.8 works with -O0.

I've no idea about this problem. Thanks for your advices.


|  Equipe M.O.S.T.         |                                      |
|  Patrick BEGOU           | mailto:Patrick.Begou@grenoble-inp.fr |
|  LEGI                    |                                      |
|  BP 53 X                 | Tel 04 76 82 51 35                   |
|  38041 GRENOBLE CEDEX    | Fax 04 76 82 52 71                   |

More information about the Gcc-help mailing list