------- Comment #7 from steven at gcc dot gnu dot org 2008-03-01 10:50 ------- With trunk as of today, the test case of comment #0 does trap if optimization is disabled. At -O, the libcall is optimized away, but the call to iaddv() from main() is also optimized away because iaddv is found to be pure. You must use the result of iaddv() to avoid this:
#include <limits.h> int __attribute__((noinline)) iaddv (int a, int b) { return a + b; } int main(void) { return iaddv (INT_MAX, 1); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19020