This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: jump bypass confuses noce_try_minmax
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 23 Nov 2003 21:21:20 +0100
- Subject: Re: jump bypass confuses noce_try_minmax
- References: <200311220144.hAM1ikM0029192@greed.delorie.com>
>
> Consider this test case:
>
> int foo(int a)
> {
> if (a >= 7)
> a = 7;
> if (a < -8)
> a = -8;
> return a;
> }
>
> On a target with smin/smax insns, it can be coded trivially:
>
> a = smin(a,7);
> a = smax(a,-8);
> return a;
>
> However, the "jump bypass" optimization changes it to this:
>
> int foo(int a)
> {
> if (a >= 7)
> a = 7;
> else if (a < -8)
> a = -8;
> return a;
> }
>
> And now noce_try_minmax cannot match the min operation, and you end up
> with conditional branches and such. Note that adding asm("") between
> the conditionals yields the expected output.
>
> Should jump bypassing be deferred until after ifcvt?
>
> Or could bypassing be skipped on targets with min/max operations?
Perhaps noce_try_minmax can be told to match the case of conditional
min/conditional max?
I would expect jump bypassing to be more important than min/max
discovery in this special case.
Honza