This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __builtin_expect (setjmp (buf) == 0, 1)) generates broken code
- From: Michael Matz <matz at suse dot de>
- To: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Wed, 19 Mar 2003 21:06:06 +0100 (CET)
- Subject: 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.