This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11151] __builtin_return(__builtin_apply(...)) gives wrong result


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]