Re:Re: FW: noreturn atribute and its optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






The noreturn attribute is an indication to the caller that the callee  does not return, and thus it can optimize the caller accordingly, and avoid warnings about missing return values in the caller. It does not direct the compiler to optimize the callee, and even if it  did, with optimizations disabled, it wouldn't. 


But the callee also knows that it will not return so why isn't it optimized. Especially when it is C and no long jump is are used then couldn't it safely reset the stack?
Since it knows it will never use any variables declared on the stack before its call was made. (except maybe with pointers to its own stack...)

Also i even had -O3 to generate the assembly of the noreturn code in mine post which was actually worse than the same code without attributes.  The callee nor the caller where optimized.



     



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux