This is the mail archive of the gcc-patches@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: [PATCH] Changes in mode switching


> 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


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