[Bug c/27308] Compiler generates incorrect code when calling a function with the result of an inline function as parameter
--- Comment #1 from rguenth at gcc dot gnu dot org 2006-04-25 12:38 --- *** Bug 27305 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27308
[Bug c/27308] Compiler generates incorrect code when calling a function with the result of an inline function as parameter
--- Comment #2 from rguenth at gcc dot gnu dot org 2006-04-25 12:49 --- This is probably a problem with the inline asm constraints. Try removing the __asm__(r0) from the __res variable. Also try simplifying the testcase by storing the result of BIOS_ContainerUsage(1) to memory rather than calling printf. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27308
[Bug c/27308] Compiler generates incorrect code when calling a function with the result of an inline function as parameter
--- Comment #3 from Eric dot Doenges at betty-tv dot com 2006-04-25 14:37 --- Storing the result to memory generates correct code -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27308
[Bug c/27308] Compiler generates incorrect code when calling a function with the result of an inline function as parameter
--- Comment #4 from Eric dot Doenges at betty-tv dot com 2006-04-25 14:43 --- Removing the __asm__ (r0) from __res works around the bug - but then I cannot depend on gcc always allocating r0 for __res, can I ? I found no other way to tell gcc which registers it must use. I'm assuming this is a bug in gcc, not the asm constraint, because the same code works flawlessly with gcc-3.4.3. As to simplifying the testcase - storing the result of BIOS_ContainerUsage to memory generates correct code regardless of wether __res is forced to r0 or not, making it worthless as a test case. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27308
[Bug c/27308] Compiler generates incorrect code when calling a function with the result of an inline function as parameter
--- Comment #5 from rguenth at gcc dot gnu dot org 2006-04-25 15:45 --- __res should be allocated to the same register as __r0 due to the '0' constraint which tells gcc to use the same register as for =r (__res). Whoops - I obviously meant to remove the __asm__(r0) from the __r0 variable... But maybe it works vice-versa, too. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27308