From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Wilson To: gcc@gcc.gnu.org Cc: Mark Mitchell , Bernd Schmidt , Franz.Sirl-kernel@lauterbach.com, hzoli@hzoli.2y.net Subject: Re: Loop unroll fixes Date: Thu, 04 Oct 2001 20:46:00 -0000 Message-id: <200110050346.UAA19385@rtl.cygnus.com> References: <5.1.0.14.2.20011004153251.054de990@mail.lauterbach.com> X-SW-Source: 2001-10/msg00293.html In article < 5.1.0.14.2.20011004153251.054de990@mail.lauterbach.com > you write: >Mark, Bernd, what about this for mainline and 3.0.2? Somehow the patch >never made it past an half-approved state. I stumbled over this while >tracking another (unfortunately unrelated, more info later today) loop bug. This is partly my fault. I was supposed to finish the patch review that Bernd started. There are three testcases for Zoltan's 3 patches. Two of these testcases are not regressions. They fail at -O2 -funroll-loops in both gcc-2.95.2 and gcc-3.0.1. The bugs should be fixed in mainline of course, but I see no critical need to include them in gcc 3.0.2. The third one is a regression. It fails at -O2 -funroll-loops in gcc-3.0.1, but works with the same options in gcc-2.95.2. This testcase is void do_loop(unsigned long c, char *m) { unsigned long i = 0; do { m[i] = 0; } while (++i != c); } This one is fixed by the small doloop.c patch, which happens to be the one patch that Bernd did review. There is a rather nice review in http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00596.html I agree with Bernd's analysis. The submitted patch doesn't fix the underlying problem, but it does have value since it optimizes away unnecessary code, and this optimization helps workaround the underlying bug for some testcases. As such, I think it has enough value, and is safe enough, to be included in gcc-3.0.2. I am willing to approve this patch for mainline and gcc-3.0.2. This is the patch in http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00554.html I need to spend more time looking at the other two patches. If we still want these patches in gcc-3.0.2, then the review will take longer than if putting them in mainline is OK, since I need to be more careful with patches for gcc-3.0.2. Jim PS The testcase from Franz Sirl is a regressison at -O2, and hence is a more important problem than any of the 3 testcases from Zoltan which all require -O2 -funroll-loops to trigger. However, the Zoltan patches are already 3 months old, so I don't want to delay their review any longer.