From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9857 invoked by alias); 30 Nov 2012 15:11:15 -0000 Received: (qmail 9840 invoked by uid 22791); 30 Nov 2012 15:11:14 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BG X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Nov 2012 15:11:07 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa10so365924pad.20 for ; Fri, 30 Nov 2012 07:11:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.68.189.163 with SMTP id gj3mr6264164pbc.110.1354288266566; Fri, 30 Nov 2012 07:11:06 -0800 (PST) Received: by 10.66.246.232 with HTTP; Fri, 30 Nov 2012 07:11:06 -0800 (PST) In-Reply-To: References: <50B88CDF.6030508@gnu.org> Date: Fri, 30 Nov 2012 15:57:00 -0000 Message-ID: Subject: Re: [PATCH] Fix allocation of reg_known_value From: Uros Bizjak To: Steven Bosscher Cc: Paolo Bonzini , gcc-patches@gcc.gnu.org, Alexandre Oliva Content-Type: multipart/mixed; boundary=e89a8ff1ccd20d5c2704cfb7cf39 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02553.txt.bz2 --e89a8ff1ccd20d5c2704cfb7cf39 Content-Type: text/plain; charset=ISO-8859-1 Content-length: 2158 On Fri, Nov 30, 2012 at 3:51 PM, Steven Bosscher wrote: >>>>> This one-liner causes following runtime test failure [1] for >>>>> alphaev68-linux-gnu: >>>>> >>>>> FAIL: gfortran.fortran-torture/execute/save_1.f90 execution, -O2 >>>>> FAIL: gfortran.fortran-torture/execute/save_1.f90 execution, -O2 >>>>> -fomit-frame-pointer -finline-functions >>>>> FAIL: gfortran.fortran-torture/execute/save_1.f90 execution, -O2 >>>>> -fomit-frame-pointer -finline-functions -funroll-loops >>>>> FAIL: gfortran.fortran-torture/execute/save_1.f90 execution, -O2 >>>>> -fbounds-check >>>>> >>>>> The patch miscompiles libgfortran library. >>>>> >>>>> I will provide more info tomorrow, any hint what/where should I look >>>>> for differences? >>>> >>>> Anywhere. The bug disabled a large part of alias analysis. >>>> >>>> Perhaps you can bisect it and backport the fix along the steps. >>> >>> Or open a PR and assign it to me, ultimately I'm responsible for this breakage. >> >> I have found the problem. Luckily, it is the testcase that is >> miscompiled. The problem is in sched1 pass that moves write to an >> address "addrX" that happens to be aliased with AND mutilated address >> "addrY & -7". The improved alias analysis does not notice that the >> write is inside (addr & -7) region, allowing write to be moved after >> read. > > Based on this description of the problem, I remembered these patches > from Alexandre: > > 2012-07-06 Alexandre Oilva <> > > PR rtl-optimization/53827 > PR debug/53671 > PR debug/49888 > * alias.c (memrefs_conflict_p): Adjust offset and size by the > same amount for alignment ANDs. > > 2012-06-21 Alexandre Oliva <> > > PR debug/53671 > PR debug/49888 > * alias.c (memrefs_conflict_p): Improve handling of AND for alignment. > > > They are r188868 and r189325. Can you try revert these and see if that > fixes your problem (probably at the expense of some other problem > returning, but at least it'd be a good place to start looking > further...). Yes backing out these revisions with attached patch fixes the runtime failure! Uros. --e89a8ff1ccd20d5c2704cfb7cf39 Content-Type: application/octet-stream; name="alias.diff" Content-Disposition: attachment; filename="alias.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ha5g93y50 Content-length: 1656 SW5kZXg6IGFsaWFzLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gYWxp YXMuYwkocmV2aXNpb24gMTkzOTkyKQorKysgYWxpYXMuYwkod29ya2luZyBj b3B5KQpAQCAtMjEwMyw2ICsyMTAzLDEwIEBACiAgICAgIGFsaWdubWVudCBp bnRvIGFjY291bnQuICAqLwogICBpZiAoR0VUX0NPREUgKHgpID09IEFORCAm JiBDT05TVF9JTlRfUCAoWEVYUCAoeCwgMSkpKQogICAgIHsKKyAgICAgIGlm IChHRVRfQ09ERSAoeSkgPT0gQU5EIHx8IHlzaXplIDwgLUlOVFZBTCAoWEVY UCAoeCwgMSkpKQorCXhzaXplID0gLTE7CisgICAgICByZXR1cm4gbWVtcmVm c19jb25mbGljdF9wICh4c2l6ZSwgY2Fub25fcnR4IChYRVhQICh4LCAwKSks IHlzaXplLCB5LCBjKTsKKyNpZiAwCiAgICAgICBIT1NUX1dJREVfSU5UIHNj ID0gSU5UVkFMIChYRVhQICh4LCAxKSk7CiAgICAgICB1bnNpZ25lZCBIT1NU X1dJREVfSU5UIHVjID0gc2M7CiAgICAgICBpZiAoeHNpemUgPiAwICYmIHNj IDwgMCAmJiAtdWMgPT0gKHVjICYgLXVjKSkKQEAgLTIxMTIsOSArMjExNiwx NCBAQAogCSAgcmV0dXJuIG1lbXJlZnNfY29uZmxpY3RfcCAoeHNpemUsIGNh bm9uX3J0eCAoWEVYUCAoeCwgMCkpLAogCQkJCSAgICAgeXNpemUsIHksIGMp OwogCX0KKyNlbmRpZgogICAgIH0KICAgaWYgKEdFVF9DT0RFICh5KSA9PSBB TkQgJiYgQ09OU1RfSU5UX1AgKFhFWFAgKHksIDEpKSkKICAgICB7CisgICAg ICBpZiAoR0VUX0NPREUgKHgpID09IEFORCB8fCB4c2l6ZSA8IC1JTlRWQUwg KFhFWFAgKHksIDEpKSkKKwl5c2l6ZSA9IC0xOworICAgICAgcmV0dXJuIG1l bXJlZnNfY29uZmxpY3RfcCAoeHNpemUsIHgsIHlzaXplLCBjYW5vbl9ydHgg KFhFWFAgKHksIDApKSwgYyk7CisjaWYgMAogICAgICAgSE9TVF9XSURFX0lO VCBzYyA9IElOVFZBTCAoWEVYUCAoeSwgMSkpOwogICAgICAgdW5zaWduZWQg SE9TVF9XSURFX0lOVCB1YyA9IHNjOwogICAgICAgaWYgKHlzaXplID4gMCAm JiBzYyA8IDAgJiYgLXVjID09ICh1YyAmIC11YykpCkBAIC0yMTI0LDYgKzIx MzMsNyBAQAogCSAgcmV0dXJuIG1lbXJlZnNfY29uZmxpY3RfcCAoeHNpemUs IHgsCiAJCQkJICAgICB5c2l6ZSwgY2Fub25fcnR4IChYRVhQICh5LCAwKSks IGMpOwogCX0KKyNlbmRpZgogICAgIH0KIAogICBpZiAoQ09OU1RBTlRfUCAo eCkpCg== --e89a8ff1ccd20d5c2704cfb7cf39--