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: revised PATCH: per-function back end reinitialization, part 1/2


Sandra Loosemore <sandra@codesourcery.com> writes:
> When last we left this patch, the general consensus seemed to be that
> it needed to be cleaned up to enforce better separation of the
> one-time versus target-specific initialization parts during regular
> startup, and to use the same function for target initialization during
> startup as during subsequent calls for re-initialization to avoid
> bit-rot.  See, for instance, previous discussion here:
>
> http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00763.html
> http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00850.html
>
> I've now done that rewrite.  This is the non-MIPS-specific part of the
> patch -- the MIPS-specific part, to implement selecting
> mips16/nomips16 on a per-function basis, is almost unchanged from the
> previous version, and I'll repost that in a separate message.  Besides
> the MIPS testing (both with and without -mflip-mips16), I also tried
> to bootstrap on i686, but that's been dying for me with some unrelated
> error while building libjava.  I did, however, verify that there are
> no regressions in the gcc testsuite on i686.

Thanks.  FWIW, having complained before, this looks really good to me.
It certainly addresses my concerns.  Just a couple of very minor niggles:

> + /* Default the algn_* variables to 1 if they're still unset, and
> +    set up the align_*_log variables.  */
> + static void
> + init_alignments (void)
> + {
> +   if (align_loops <= 0) align_loops = 1;
> +   if (align_loops_max_skip > align_loops || !align_loops)
> +     align_loops_max_skip = align_loops - 1;
> +   align_loops_log = floor_log2 (align_loops * 2 - 1);
> +   if (align_jumps <= 0) align_jumps = 1;
> +   if (align_jumps_max_skip > align_jumps || !align_jumps)
> +     align_jumps_max_skip = align_jumps - 1;
> +   align_jumps_log = floor_log2 (align_jumps * 2 - 1);
> +   if (align_labels <= 0) align_labels = 1;
> +   align_labels_log = floor_log2 (align_labels * 2 - 1);
> +   if (align_labels_max_skip > align_labels || !align_labels)
> +     align_labels_max_skip = align_labels - 1;
> +   if (align_functions <= 0) align_functions = 1;
> +   align_functions_log = floor_log2 (align_functions * 2 - 1);

Not your fault, but seeing as you're moving this code, could you
reformat it to follow coding conventions?  No "if (...) foo;" lines.

> ! /* This function can be called multiple times to reinitialize the compiler
> !    back end when register classes or instruction sets have changed,
> !    before each function.  */
> ! static void
> ! backend_init_target (void)
> ! {
> ! 

Stray line.  A couple of other instances too.

> +   /* Assign register numbers to the globally defined register rtx.
> +      This must be done at runtime because the register number field
> +      is in a union and some compilers can't initialize unions.  */

I think the second sentence is redundant now; we have to initialize
it at run time because the values may depend on the mode, and because
the function may be called by target_reinit.

Richard


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