This is the mail archive of the 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]

ICE in convert_modes called from basic_induction_var


when compiling tcltk with gcc 3.1 on s390x I'm getting an ICE in
convert_modes because it is called with a SFmode destination,
but an DImode source.

The caller is basic_induction_var examining the insn:
  (set (reg:SF 333) (subreg:SF (reg/v:DI 48) 4))

What's happening is that first the subreg is stripped off, and
basic_induction_var is called again with 'x' set to (reg/v:DI 48)
and 'dest_reg' remaining (reg:SF 333).

Because reg 48 happens to be loop-invariant, the line
  *inc_val = convert_modes (GET_MODE (dest_reg), mode, x, 0);
is reached, and convert_modes ICEs.

What would be the right way to fix this?  One possibility would
be to ignore subregs that change the MODE_CLASS when searching
for BIVs; I can't really see how this could be a proper induction
variable anyway.

[I haven't yet bootstrapped/regtested the patch, but provided
that is fine, would it be OK to install this patch, or should
the problem be solved in a different way?]

Index: loop.c
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.389
diff -c -p -r1.389 loop.c
*** loop.c     2002/02/23 08:56:21 1.389
--- loop.c     2002/03/04 18:24:46
*************** basic_induction_var (loop, x, mode, dest
*** 6149,6154 ****
--- 6149,6157 ----
      handle addition of promoted variables.
      ??? The comment at the start of this function is wrong: promoted
      variable increments don't look like it says they do.  */
+       if (GET_MODE_CLASS (GET_MODE (x))
+    return 0;
        return basic_induction_var (loop, SUBREG_REG (x),
                      GET_MODE (SUBREG_REG (x)),
                      dest_reg, p, inc_val, mult_val, location);

Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email:

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