[Bug middle-end/36008] Function produces wrong results when inlined.

xavier at tddft dot org gcc-bugzilla@gcc.gnu.org
Tue Apr 22 22:52:00 GMT 2008



------- Comment #6 from xavier at tddft dot org  2008-04-22 22:51 -------
I have managed to create a test case:

Correct case:

xavier@corvo:~$ gcc-4.3 bravais.c mathfunc.c -O3 -fno-inline
bravais.c: In function ‘main’:
bravais.c:83: warning: incompatible implicit declaration of built-in function
‘printf’
xavier@corvo:~$ ./a.out 
0 

Wrong case:

xavier@corvo:~$ gcc-4.3 bravais.c mathfunc.c -O3
bravais.c: In function ‘main’:
bravais.c:83: warning: incompatible implicit declaration of built-in function
‘printf’
xavier@corvo:~$ ./a.out 
-1 

Sorry for using two files, but the problem disappears if all functions are in a
single file.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36008



More information about the Gcc-bugs mailing list