From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24375 invoked by alias); 22 Apr 2010 08:28:29 -0000 Received: (qmail 23909 invoked by uid 48); 22 Apr 2010 08:28:12 -0000 Date: Thu, 22 Apr 2010 08:28:00 -0000 Message-ID: <20100422082812.23908.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/43841] Missing temporary for ELEMENTAL function call In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" 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-04/txt/msg02317.txt.bz2 ------- Comment #5 from burnus at gcc dot gnu dot org 2010-04-22 08:28 ------- >>From PR 43843: Reported by Kyle Horne at http://gcc.gnu.org/ml/fortran/2010-04/msg00215.html There is a missing temporary for user-defined operators: type(polar_t),dimension(3)::b b = polar_t(1.0,0.5) b(:) = b(:)/b(1) The latter is translated into: struct polar_t * D.1551; D.1551 = &b[0]; S.5 = 1; while (1) { if (S.5 > 3) goto L.3; b[S.5 + -1] = div_pp (&b[S.5 + -1], D.1551); S.5 = S.5 + 1; } L.3:; but that fails as one overrides *D.1551 alias b[0] alias B(1) in the first iteration instead of evaluating first all of the RHS before assigning to the LHS. Work with ifort and NAG, fails with GCC 4.1, 4.2, 4.3, 4.4, 4.5, and 4.6 -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2010-04-22 08:28:12 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43841