PATCH: mips16 function attributes, version N+1

Richard Sandiford richard@codesourcery.com
Sat Sep 1 09:38:00 GMT 2007


Richard Sandiford <richard@codesourcery.com> writes:
> OK with those changes, thanks.  No need for a full retest; just check
> that the error message is still sensible and that the testcase still runs.

Sorry, I obviously did things in the wrong order this morning.
I've just looked into the mips-sdata-1.c failure that you mentioned
internally, and as I suspected, it was caused by TARGET_EXPLICIT_RELOCS
being false.  You need to remove the following bits of code from
override_options, as the associated actions are now (rightly)
done in mips_set_mips16_mode instead:

  if (TARGET_MIPS16)
    {
      /* Don't run the scheduler before reload, since it tends to
         increase register pressure.  */
      flag_schedule_insns = 0;

      /* Don't do hot/cold partitioning.  The constant layout code expects
	 the whole function to be in a single section.  */
      flag_reorder_blocks_and_partition = 0;

      /* Silently disable -mexplicit-relocs since it doesn't apply
	 to mips16 code.  Even so, it would overly pedantic to warn
	 about "-mips16 -mexplicit-relocs", especially given that
	 we use a %gprel() operator.  */
      target_flags &= ~MASK_EXPLICIT_RELOCS;
    }

  /* When using explicit relocs, we call dbr_schedule from within
     mips_reorg.  */
  if (TARGET_EXPLICIT_RELOCS)
    {
      mips_flag_delayed_branch = flag_delayed_branch;
      flag_delayed_branch = 0;
    }

ISTR earlier versions of your patch did this, so I suspect it just
got lost amongst the countless revisions you've had to put up with ;).
I checked the patched override_options and couldn't see anything else
that obviously needed to be changed.  Also -- in case anyone reading
this is unsure -- the patch already sets mips_flag_delayed_branch
later in the function, and the mips_reorg check is also guarded with
TARGET_EXPLICIT_RELOCS:

  if (TARGET_EXPLICIT_RELOCS)
    {
      if (mips_flag_delayed_branch)
	dbr_schedule (get_insns ());

Unfortunately, I think removing the code _will_ need a retest.  OK with
that change on top of the other ones.

Richard



More information about the Gcc-patches mailing list