From patchwork Sat Feb 19 01:06:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 83670 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]) by ozlabs.org (Postfix) with SMTP id 06283B711B for ; Sat, 19 Feb 2011 12:06:29 +1100 (EST) Received: (qmail 31473 invoked by alias); 19 Feb 2011 01:06:28 -0000 Received: (qmail 31461 invoked by uid 22791); 19 Feb 2011 01:06:27 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, TW_BJ, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Feb 2011 01:06:22 +0000 Received: from eggs.gnu.org ([140.186.70.92]:34460) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PqbHA-0006O2-Pr for gcc-patches@gnu.org; Fri, 18 Feb 2011 20:06:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqbH8-0008AW-Ua for gcc-patches@gnu.org; Fri, 18 Feb 2011 20:06:20 -0500 Received: from smtp181.iad.emailsrvr.com ([207.97.245.181]:46490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqbH8-0008AK-S1 for gcc-patches@gnu.org; Fri, 18 Feb 2011 20:06:18 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp48.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 43CF51685FF; Fri, 18 Feb 2011 20:06:18 -0500 (EST) Received: from dynamic4.wm-web.iad.mlsrvr.com (dynamic4.wm-web.iad1a.rsapps.net [192.168.2.153]) by smtp48.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 1FD9A16829E; Fri, 18 Feb 2011 20:06:18 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic4.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id EE3731D4A2AE; Fri, 18 Feb 2011 20:06:17 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Sat, 19 Feb 2011 02:06:17 +0100 (CET) Date: Sat, 19 Feb 2011 02:06:17 +0100 (CET) Subject: Re: PATCH committed: 64-bit Apple Objective-C runtime support From: "Nicola Pero" To: "Alexandre Oliva" , "Iain Sandoe" , "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain In-Reply-To: <1298074875.877730216@192.168.4.58> References: <1297987740.839215263@192.168.4.58> <1298070074.20434549@192.168.4.58> <1298074875.877730216@192.168.4.58> Message-ID: <1298077577.9744989@192.168.4.58> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 207.97.245.181 X-IsSubscribed: yes 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 > I'm not entirely sure why it does that Upon reflection, it is fairly obvious. It does that to prevent duplicate output from -print-runtime-info. ;-) Here is a patch that adds explanationatory comments for this so we don't have to rediscover these details next time we look at the code. Ok to commit ? Thanks Index: ChangeLog =================================================================== --- ChangeLog (revision 170297) +++ ChangeLog (working copy) @@ -1,5 +1,10 @@ 2011-01-19 Nicola Pero + * objc-act.c (objc_init, generate_struct_by_value_array): Updated + comments. + +2011-01-19 Nicola Pero + * objc-gnu-runtime-abi-01.c (objc_generate_v1_gnu_metadata): Do not generate metadata if there is nothing to put into it. Index: objc-act.c =================================================================== --- objc-act.c (revision 170297) +++ objc-act.c (working copy) @@ -330,8 +330,9 @@ int aggregate_in_mem[32]; int found = 0; - /* ??? as an example, m64/ppc/Darwin can pass up to 8*long+13*double in regs. - Presumably no platform passes 32 byte structures in a register. */ + /* Presumably no platform passes 32 byte structures in a register. */ + /* ??? As an example, m64/ppc/Darwin can pass up to 8*long+13*double + in registers. */ for (i = 1; i < 32; i++) { char buffer[5]; @@ -379,8 +380,24 @@ #endif return false; + /* print_struct_values is triggered by -print-runtime-info (used + when building libobjc, with an empty file as input). It does not + require any ObjC setup, and it never returns. + + -fcompare-debug is used to check the compiler output; we are + executed twice, once with flag_compare_debug set, and once with + it not set. If the flag is used together with + -print-runtime-info, we want to print the runtime info only once, + else it would be output in duplicate. So we check + flag_compare_debug to output it in only one of the invocations. + + As a side effect, this also that means -fcompare-debug + -print-runtime-info will run the compiler twice, and compare the + generate assembler file; the first time the compiler exits + immediately (producing no file), and the second time it compiles + an empty file. This checks, as a side effect, that compiling an + empty file produces no assembler output. */ if (print_struct_values && !flag_compare_debug) - /* This routine does not require any ObjC set-up and never returns. */ generate_struct_by_value_array (); /* Set up stuff used by FE parser and all runtimes. */