From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12986 invoked by alias); 9 Dec 2010 13:43:09 -0000 Received: (qmail 12977 invoked by uid 22791); 9 Dec 2010 13:43:08 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Dec 2010 13:43:02 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/46842] [4.6 Regression] 465.tonto test run miscompares (even with -O0) X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 09 Dec 2010 13:43:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg00968.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46842 --- Comment #12 from Tobias Burnus 2010-12-09 13:42:57 UTC --- The following is wrongly compiled - however, it is not a regression as it occurs since GCC 4.1. The solution is the same as for gfc_trans_arrayfunc_assign, where the same issue can occur. Cf. PR 44582. Due to the missing temporary, the array contains 88 88 88 88 instead of 88 1 88 3; the test case works with ifort, NAG and g95. (There is a slim chance that this is also the problem for Tonto as there was a time window in 4.6 where this optimization was never applied; it should have then also failed with 4.1 to 4.6.) integer :: a(2,2) a = reshape([1,2,3,4], [2,2]) call sub(transpose(a)) contains subroutine sub(x) integer :: x(:,:) a(1,:) = 88 a(2,:) = x(:,1) if ( any (a(:,1) /= [88, 1]) & .or.any (a(:,2) /= [88, 3])) then print *, a call abort() end if end subroutine sub end