From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25249 invoked by alias); 12 Feb 2011 19:24:36 -0000 Received: (qmail 25239 invoked by uid 22791); 12 Feb 2011 19:24:35 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Sat, 12 Feb 2011 19:24:31 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47674] gfortran.dg/realloc_on_assign_5.f03: Segfault at run time X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Sat, 12 Feb 2011 19:28: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: 2011-02/txt/msg01536.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47674 --- Comment #1 from Tobias Burnus 2011-02-12 19:24:21 UTC --- The file was added for PR 47523. The issue is that there is no temporary generated - but the LHS is dependent on the LHS. This should only occur for "LHS = LHS(substring)" where no temporary is needed for the RHS expression but where a reallocation happens. If no reallocation happens, memmove takes care of possibly overlapping memory. And if there is a more complicated expression on the RHS, a temporary should always be present. Thus, the issue should only occur for a = a(1:2) or a = (((( a(1:2) ))))