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 other/25345] redundant opcodes before function call.



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-12-11 04:05 -------
I should note that doing:
static void *a0ra, *a1ra;
void __attribute__((noinline)) a0(void) { a0ra = __builtin_return_address(0); }
void __attribute__((noinline)) a1(void) { a1ra = __builtin_return_address(0); }
int foo(void) { a0(); a1(); return a1ra - a0ra; }
int main()
{
    printf("pd=%d\n", foo());
    return 0;
}

You get the code which you want.


-- 


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


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