[Bug libc/6522] abort should not be marked noreturn

schwab at suse dot de sourceware-bugzilla@sourceware.org
Tue Jun 17 11:41:00 GMT 2008


------- Additional Comments From schwab at suse dot de  2008-06-17 11:41 -------
Removing noreturn from abort will not eliminate the problem, the compiler will 
still combine two calls if they appear in similar enough contexts.  In the 
following example the compiler will still generate only a single call to abort, 
no matter how it is declared.

#include <stdlib.h>

int bar (int);
#ifdef USE_ABORT1
void abort1 (void);
#define abort abort1
#endif

int
foo (int a)
{
  int b;

  if (a == 1)
    {
      b = bar (a);
      if (!b) abort ();
    }
  else if (a == 2)
    {
      b = bar (a + 1);
      if (!b) abort ();
    }
  else
    b = a;
  return b;
}

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6522

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Glibc-bugs mailing list