This is the mail archive of the gcc@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]

Re: __builtin_expect (setjmp (buf) == 0, 1)) generates broken code


Hi Ulrich,

On Wed, 19 Mar 2003, Ulrich Weigand wrote:

> temp = 0;
> if (setjmp (buf) == 0)
>   temp = 1;
>
> The question is, what's broken here.

The above transformation.  setjmp() conceptually returns twice, and
therefore needs special handling.  The code emitted should look like:

if (setjmp (buf) == 0)
  temp = 1;
else
  temp = 0;
fi

Which also executes less insns.  This would fix the issue you see, if I
don't miss anything.


Ciao,
Michael.


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