From patchwork Wed May 22 14:20:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 245639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9B7172C00A5 for ; Thu, 23 May 2013 00:21:14 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=rX+O8l9NNUNIaO0kR8fRqvem2fbg+kS+il15gzv4zmOYdq MD9uTUksFHv/bkffAcaE6h+Pw2Qdjmt4tR/D0VKM2k2nblhbWFZZ+8qE3YFU1GtQ 0TXYYQne/5qz8Gf0FY8gxIgI/HzbFkbP6fUcbIVzLl34RNBI3gYxR1Tcj5fns= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=3ISG33M5IRZQR4RaGrkc2zYhJCY=; b=jUP6PGyX9wXAYgTW77XQ vZyCyMcqbEmWNAY1RhavHrHBxFVtEZFzK8MXHx4toh4VtiqQAzS45HyEmN2uhJRx YNtHvSvUNUJgIgioGq6xvwvYB5IiWdwLuFbfvTm1HSSST0fH1t+sNOBci3AVTI0k I0RQrcClAFMNJ/mW1X6E4zc= Received: (qmail 11538 invoked by alias); 22 May 2013 14:21:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11521 invoked by uid 89); 22 May 2013 14:21:02 -0000 X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 22 May 2013 14:21:01 +0000 Received: from archimedes.net-b.de (port-92-195-69-235.dynamic.qsc.de [92.195.69.235]) by mx01.qsc.de (Postfix) with ESMTP id 7773C3CDD0; Wed, 22 May 2013 16:20:58 +0200 (CEST) Message-ID: <519CD449.6060305@net-b.de> Date: Wed, 22 May 2013 16:20:57 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran] Create valid temporary variable to avoid assembler errors X-Virus-Found: No With one Fortran file, I get the following assembler errors: /tmp/cc28epKK.s:2075: Error: junk `@1.2304+16' after expression That's due to the way a temporary variable is generated. While that variable is local to the procedure, the name somehow escapes into the assembler file. The dump looks as follows. static struct foo DA@0; static struct universal DA@1; static struct universal DA@2; ... class.30._data = &DA@0.foo_parent.universal.counter; I have now changed the mangling, see attached patch. (The test file uses finalization - hence, I do not include it into the patch. I will include it in the FINAL patch.) Build and regtested on x86-64-gnu-linux. OK for the trunk? Tobias 2013-05-22 Tobias Burnus * resolve.c (get_temp_from_expr): Fix temp var mangling. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 6f32df8..5fabc9a 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -9254,7 +9254,7 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace *ns) gfc_array_ref *aref; gfc_ref *ref; - sprintf (name, "DA@%d", serial++); + sprintf (name, "DA" GFC_PREFIX("%d"), serial++); gfc_get_sym_tree (name, ns, &tmp, false); gfc_add_type (tmp->n.sym, &e->ts, NULL);