patch to reduce register pressure from strength reduction

Graham grahams@rcp.co.uk
Thu Jan 28 04:26:00 GMT 1999


Joern

There is a problem with this patch.

The modifications to the setting of giv_inc in copy_loop_body()
unroll.c may result in a NULL_RTX giv_inc being used in the
INTVAL() macro to calculate this_giv_inc (see code extract below)

        case INSN:
          pattern = PATTERN (insn);
          copy = 0;
          giv_inc = 0;

          ---  REMOVED SOME CODE --

              /* Although the giv_inc amount is not needed here, we must
call
                 calculate_giv_inc here since it might try to delete the
                 last insn emitted.  If we wait until later to call it,
                 we might accidentally delete insns generated
immediately
                 below by emit_unrolled_add.  */

              if (! derived_regs[regno])
                 giv_inc = calculate_giv_inc (set, insn, regno);

              /* Now find all address giv's that were combined with this
                 giv 'v'.  */
              for (tv = bl->giv; tv; tv = tv->next_iv)
                if (tv->giv_type == DEST_ADDR && tv->same == v)
                  {
                    int this_giv_inc;

                    /* If this DEST_ADDR giv was not split, then ignore
it.  */
                    if (*tv->location != tv->dest_reg)
                      continue;

                    /* Scale this_giv_inc if the multiplicative factors
of
                       the two givs are different.  */
                    this_giv_inc = INTVAL (giv_inc);      ???? giv_inc
maybe 0
                    if (tv->mult_val != v->mult_val)
                      this_giv_inc = (this_giv_inc / INTVAL
(v->mult_val)
                                      * INTVAL (tv->mult_val));

I came across this problem trying to bootstrap on x86-linux with the
following
flags "-O9 -march=pentiumpro -mcpu=pentiumpro -funroll-loops
-fomit-frame-pointer".
The bootstrap fails when compiling gcc/reload1.c using the stage1/cc1
compiler 
due to access violation caused by a giv_inc being 0 when passed to
INTVAL() macro.

Graham



More information about the Gcc-patches mailing list