From patchwork Tue Jun 8 14:23:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 54985 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 40E1EB7D8C for ; Wed, 9 Jun 2010 00:23:25 +1000 (EST) Received: (qmail 18454 invoked by alias); 8 Jun 2010 14:23:22 -0000 Received: (qmail 18438 invoked by uid 22791); 8 Jun 2010 14:23:20 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BJ X-Spam-Check-By: sourceware.org Received: from c2bthomr14.btconnect.com (HELO c2bthomr14.btconnect.com) (213.123.20.132) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Jun 2010 14:23:13 +0000 Received: from thor.office (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2bthomr14.btconnect.com with ESMTP id FND47896; Tue, 8 Jun 2010 15:23:07 +0100 (BST) X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=0001.0A0B0302.4C0E524B.015B, actions=tag Message-Id: From: IainS To: GCC Patches Mime-Version: 1.0 (Apple Message framework v936) Subject: [Patch][4.5] ObjC/C++ back-port of fix for PR35996 Date: Tue, 8 Jun 2010 15:23:06 +0100 Cc: Richard Guenther , Mike Stump 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 tested on i686-apple-darwin9, i686-pc-linux-gnu, OK for 4.5? Iain gcc/objc/ChangeLog: Backport from mainline: PR objc/35996 * objc-act.c (objc_init): Warn that -fobjc-gc is ignored for -fgnu-runtime and set flag_objc_gc to zero. gcc/testsuite/ChangeLog: Backport from mainline: 2010-04-07 Iain Sandoe PR objc/35996 * objc.dg/objc-gc-4.m: Run for all targets, prune new warning. * obj-c++.dg/objc-gc-3.mm: Ditto. 2010-04-30 Iain Sandoe Index: gcc/objc/objc-act.c =================================================================== --- gcc/objc/objc-act.c (revision 160431) +++ gcc/objc/objc-act.c (working copy) @@ -545,6 +545,13 @@ objc_init (void) structure-returning methods. */ default_constant_string_class_name = "NXConstantString"; flag_typed_selectors = 1; + /* GNU runtime does not need the compiler to change code + in order to do GC. */ + if (flag_objc_gc) + { + warning_at (0, 0, "%<-fobjc-gc%> is ignored for %<-fgnu-runtime%>"); + flag_objc_gc=0; + } } init_objc (); Index: gcc/testsuite/objc.dg/objc-gc-4.m =================================================================== --- gcc/testsuite/objc.dg/objc-gc-4.m (revision 160431) +++ gcc/testsuite/objc.dg/objc-gc-4.m (working copy) @@ -2,8 +2,9 @@ (where component references get rewritten). */ /* Contributed by Ziemowit Laski */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile } */ /* { dg-options "-fobjc-gc" } */ +/* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */ #include "../objc-obj-c++-shared/Object1.h" Index: gcc/testsuite/obj-c++.dg/objc-gc-3.mm =================================================================== --- gcc/testsuite/obj-c++.dg/objc-gc-3.mm (revision 160431) +++ gcc/testsuite/obj-c++.dg/objc-gc-3.mm (working copy) @@ -2,8 +2,9 @@ (where component references get rewritten). */ /* Contributed by Ziemowit Laski */ -/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-do compile } */ /* { dg-options "-fobjc-gc" } */ +/* { dg-prune-output "cc1objplus: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */ #include "../objc-obj-c++-shared/Object1.h"