From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14719 invoked by alias); 20 Aug 2009 16:51:50 -0000 Received: (qmail 14709 invoked by uid 22791); 20 Aug 2009 16:51:49 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate2.de.ibm.com (HELO mtagate2.de.ibm.com) (195.212.17.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Aug 2009 16:51:39 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id n7KGpbOx019178 for ; Thu, 20 Aug 2009 16:51:37 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n7KGpbRF2715702 for ; Thu, 20 Aug 2009 18:51:37 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n7KGpaGo012311 for ; Thu, 20 Aug 2009 18:51:36 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id n7KGpZa4012304; Thu, 20 Aug 2009 18:51:35 +0200 Message-Id: <200908201651.n7KGpZa4012304@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 20 Aug 2009 18:51:35 +0200 Subject: Re: i370 port To: mutazilah@gmail.com (Paul Edwards) Date: Thu, 20 Aug 2009 22:48:00 -0000 From: "Ulrich Weigand" Cc: gcc@gcc.gnu.org In-Reply-To: <5D9A2D00E3CD4B858806C97D60082067@Paullaptop> from "Paul Edwards" at Aug 20, 2009 09:19:51 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00377.txt.bz2 Paul Edwards wrote: > > Hmm, it seems 3.2.x would *always* operate on a function-by-function > > basis. The unit-at-a-time mode was only introduced with 3.4 (I don't > > recall if it was already present in 3.3). I don't think there is any > > way in 3.2.3 to check whether there is a "main" function in the file > > before it is processed ... > > Does that mean I could take advantage of this behaviour? I don't think this would be a good idea. > /* Store in OUTPUT a string (made with alloca) containing an > assembler-name for a local static variable named NAME. > LABELNO is an integer which is different for each call. */ > > #ifdef TARGET_PDPMAC > #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ > { \ > (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10); \ > sprintf ((OUTPUT), "__%d", (LABELNO)); \ > } How does this work? ASM_FORMAT_PRIVATE_NAME is not supposed to completely ignore the NAME argument, the function may well be called with the same LABELNO but different NAME strings, and this must not result in conflicting symbols ... > static void > i370_output_function_prologue (f, l) > FILE *f; > HOST_WIDE_INT l; > { > /* Don't print stack and args in PDPMAC as it makes the > comment too long */ > #ifdef TARGET_PDPMAC > fprintf (f, "* %c-func %s prologue\n", > mvs_need_entry ? 'X' : 'S', > mvs_function_name); > #else At this point, you may refer to "current_function_decl" to retrieve information about the function currently being output. In particular, you can retrieve the original source-level name associated with the routine via DECL_NAME (current_function_decl). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com