This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Changes in mode switching
Thank you for testing.
> With commenting out "if (i != mode)" of the hunk
I changed type of transp and added this checking because if we reset
transp[mode], then later in the loop
FOR_EACH_BB (bb)
sbitmap_not (kill[bb->index], transp[i][bb->index]);
we set kill of the bb for that mode and thereby force insertion mode
switching for the mode in succeeding blocks in any case.
Regards,
Vladimir
2012/8/24 Kaz Kojima <kkojima@rr.iij4u.or.jp>:
>> I've tried the patch on sh4-unknown-linux-gnu. I see new failures
>> with it:
>
> Here is a reduced test case for sh4-unknown-linux-gnu.
>
> volatile double gd[32];
> volatile float gf[32];
>
> int main ()
> {
> int i;
>
> for (i = 0; i < 32; i++)
> gd[i] = i * 4, gf[i] = i;
>
> for (i = 0; i < 32; i++)
> if (gd[i] != i * 4
> || gf[i] != i)
> abort ();
> exit (0);
> }
>
> The problem occurs at the second loop. With the patch, the only
> mode switching is done at just before gf[i] != i.
> OTOH the original compiler inserts mode switchings both at before
> gd[i] != i * 4 and gf[i] != i.
> With commenting out "if (i != mode)" of the hunk
>
> @@ -530,10 +535,16 @@ optimize_mode_switching (void)
> last_mode = mode;
> ptr = new_seginfo (mode, insn, bb->index, live_now);
> add_seginfo (info + bb->index, ptr);
> - RESET_BIT (transp[bb->index], j);
> + for (i = 0 ; i < max_num_modes; i++)
> + if (i != mode)
> + RESET_BIT (transp[i][bb->index], j);
> ...
>
> it looks all new failures go away.
>
> Regards,
> kaz