From mboxrd@z Thu Jan 1 00:00:00 1970 From: Franz Sirl To: Mark Mitchell Cc: Wolfgang Bangerth , "gcc@gcc.gnu.org" , gcc-patches@gcc.gnu.org Subject: Re: Loop unroll fixes Date: Wed, 10 Oct 2001 05:14:00 -0000 Message-id: <5.1.0.14.2.20011010134053.04e57e78@mail.lauterbach.com> References: <36070000.1002701777@warlock.codesourcery.com> X-SW-Source: 2001-10/msg00655.html Content-type: multipart/mixed; boundary="----------=_1583532990-674-59" This is a multi-part message in MIME format... ------------=_1583532990-674-59 Content-length: 1659 At 10:16 10.10.2001, Mark Mitchell wrote: >--On Wednesday, October 10, 2001 10:12:38 AM +0200 Wolfgang Bangerth > wrote: > >> >>>I anticipate those being the last changes for GCC 3.0.2. >> >>Not arguing for this just because it happened to bite me, but it might be >>worth to also look at c++/4512, which is a regression w.r.t. 3.0.1. Franz >>said he'll look into it. > >Thank you for pointing this out. We need to identify this problem, fix >it, or remove the patch that is causing it. Regressions from previous >3.0 releases are very, very bad. I already tracked down what's happening and produced a simple fix. Bootstrapped and regtested on x86 so far. The problem here is that if a loop gets unrolled, the uid_luid array doesn't get updated. In the testcase the loop getting unrolled is part of the loop exit tests of another loop. So when the loop exit insns are scanned as in the last change to loop_iterations, we get an abort as soon as we hit an insn that was generated by loop unrolling :-(. Probably the cleanest solution would be to recalculate uid_luid after each call to scan_loop. Since this wasn't done so far, I guess this has either compile time impacts or would confuse other parts of the loop code. Fortunately, in this case we can just ignore the insns generated by loop unrolling, cause they will contain the same insns than the original loop body and it's enough if we test for back edges only in the original ones. So I suggest the appended patch. OK to commit? Franz. PR c++/4512 * unroll.c (loop_iterations): Ignore insns generated by loop unrolling. ------------=_1583532990-674-59 Content-Type: text/x-diff; charset=us-ascii; name="gcc3-loop-2.patch" Content-Disposition: inline; filename="gcc3-loop-2.patch" Content-Transfer-Encoding: base64 Content-Length: 907 SW5kZXg6IGdjYy91bnJvbGwuYwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJD UyBmaWxlOiAvY3ZzL2djYy9lZ2NzL2djYy91bnJvbGwuYyx2CnJldHJpZXZp bmcgcmV2aXNpb24gMS4xMjUuNC4yCmRpZmYgLXUgLXAgLXIxLjEyNS40LjIg dW5yb2xsLmMKLS0tIGdjYy91bnJvbGwuYwkyMDAxLzEwLzA4IDIxOjMzOjE2 CTEuMTI1LjQuMgorKysgZ2NjL3Vucm9sbC5jCTIwMDEvMTAvMTAgMTI6MDg6 MDUKQEAgLTM1MDYsNiArMzUyMywxMSBAQCBsb29wX2l0ZXJhdGlvbnMgKGxv b3ApCiAKICAgICAgIGRvCiAJeworCSAgLyogUHJldmlvdXMgdW5yb2xsaW5n IG1heSBoYXZlIGdlbmVyYXRlZCBuZXcgaW5zbnMgbm90IGNvdmVyZWQKKwkg ICAgIGJ5IHRoZSB1aWRfbHVpZCBhcnJheS4gICovCisJICBpZiAoSU5TTl9V SUQgKHRlbXApID49IG1heF91aWRfZm9yX2xvb3ApCisJICAgIGNvbnRpbnVl OworCiAJICBpZiAoR0VUX0NPREUgKHRlbXApID09IEpVTVBfSU5TTgogCSAg ICAgICYmIElOU05fTFVJRCAoSlVNUF9MQUJFTCAodGVtcCkpID4gSU5TTl9M VUlEIChsb29wLT50b3ApCiAJICAgICAgJiYgSU5TTl9MVUlEIChKVU1QX0xB QkVMICh0ZW1wKSkgPCBJTlNOX0xVSUQgKGxvb3AtPmNvbnQpKQo= ------------=_1583532990-674-59--