This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11151] __builtin_return(__builtin_apply(...)) gives wrong result
- From: "gcczilla at achurch dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jun 2003 07:56:17 -0000
- Subject: [Bug c/11151] __builtin_return(__builtin_apply(...)) gives wrong result
- References: <20030611065926.11151.gcczilla@achurch.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11151
------- Additional Comments From gcczilla@achurch.org 2003-06-11 07:56 -------
The following construct seems to work around the problem for GCC 3.2, though
it's potentially very dependent on compiler version, optimization and whatnot:
int foo(...) { ... }
int bar(...) { __builtin_return(__builtin_apply(foo,...)); }
becomes
int foo(...) { ... }
int bar1(...) { __builtin_return(__builtin_apply(foo,...)); }
void bar2(...) {
__builtin_apply(bar_tmp,...);
asm("ld [%sp-128],%i0"); /* %i0 is the SPARC return register */
}
int (*bar)(...) = (void *)bar2;