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

ICE in simplify_plus_minus when called from loop.c


Hello,

one more problem found with gcc 3.1 on s390:

when compiling code like this:

 for (i0 = 0; i0 < 5; i0++)
   for (i1 = 0; i1 < 5; i1++)
     for (i2 = 0; i2 < 5; i2++)
       for (i3 = 0; i3 < 5; i3++) {
         ((char *)T1aa_lut)[(((i0 * 5 + i1) * 5 + i2) * 5 + i3) * 4] = gv[i3];
         ((char *)T1aa_lut)[(((i0 * 5 + i1) * 5 + i2) * 5 + i3) * 4 + 1] = gv[i2];
         ((char *)T1aa_lut)[(((i0 * 5 + i1) * 5 + i2) * 5 + i3) * 4 + 2] = gv[i1];
         ((char *)T1aa_lut)[(((i0 * 5 + i1) * 5 + i2) * 5 + i3) * 4 + 3] = gv[i0];
       }

the loop pass builds up quite complex expressions for GIVs.

These GIV expressions are later on used as argument to simplify_gen_binary,
e.g. from within express_from_1.  That in turn calls simplify_plus_minus
with the 'force' parameter set to 1.

However, simplify_plus_minus has a built-in limitation that it can only
accept expressions with up to 8 components.  The GIVs generated from the
code above will violate this assumption, causing simplify_plus_minus to
abort ...

Who's at fault?  Should loop not use simplify_gen_binary, or should the
simplify_plus_minus limitation be lifted?

B.t.w. why does simplify_plus_minus just abort, and not at least return
an un-optimized (but correct) expression?


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: Ulrich.Weigand@de.ibm.com


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