From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18662 invoked by alias); 12 Aug 2009 13:49:12 -0000 Received: (qmail 18459 invoked by uid 22791); 12 Aug 2009 13:49:10 -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 mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Aug 2009 13:49:03 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n7CDn0X5031488 for ; Wed, 12 Aug 2009 13:49:00 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 n7CDmsc32629700 for ; Wed, 12 Aug 2009 15:49:00 +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 n7CDmsD7012037 for ; Wed, 12 Aug 2009 15:48:54 +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 n7CDmrV1012019; Wed, 12 Aug 2009 15:48:53 +0200 Message-Id: <200908121348.n7CDmrV1012019@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 12 Aug 2009 15:48:53 +0200 Subject: Re: i370 port To: mutazilah@gmail.com (Paul Edwards) Date: Wed, 12 Aug 2009 16:35:00 -0000 From: "Ulrich Weigand" Cc: gcc@gcc.gnu.org In-Reply-To: from "Paul Edwards" at Aug 12, 2009 10:59:46 AM 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/msg00194.txt.bz2 Paul Edwards wrote: > > That depends a bit on the compiler version and optimization level, > > but (in particular in the 3.x time frame) GCC may output assembler > > code on a function-by-function basis, without necessarily reading > > in the whole source file first. > > Ok, actually it doesn't matter if it doesn't work all the time. I'll > always be compiling with -Os anyway, so it sounds like I'm in > with a chance of the whole file being read first? > > If so, where is my first opportunity, in 3.2.3, to see if there's a > "main" function in this file? 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 ... > > I don't know exactly how your port handles this on MVS, but usually > > GCC itself will invoke the linker, and will itself prepare an > > appropriate command linker for the linker. > > GCC on MVS *only* outputs assembler. ie you always have to > use the "-S" option. > > By doing so, it turns GCC into a pure text-processing application, > which will thus work in any C90 environment. Huh. So the user will always have to invoke the linker manually, and pass all the correct options (libraries etc.)? What is the problem with having GCC itself invoke the linker, just like it does on other platforms? > > In current GCC, every insn contains "location" information pointing > > back to source code line (and column) numbers. However, in GCC 3.x > > I think this wasn't yet present, but you had to rely on line number > > notes interspersed with the insn stream. > > > > In any case, if you build with -g and use in addition the "debug > > assembler output" flag -dA the assembler output should contain > > human-readable comments containing line number information. > > The GCC assembler is never invoked. After getting the assembler > output from the -S option, this is fed into IFOX00/IEV90/ASMA90. As Paolo mentioned, the -dA flag is an option to the *compiler* that causes it to place additional information into its output stream (the assembler source code). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com