From patchwork Wed Nov 30 11:02:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 128479 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 06187B6F62 for ; Wed, 30 Nov 2011 22:02:34 +1100 (EST) Received: (qmail 15511 invoked by alias); 30 Nov 2011 11:02:32 -0000 Received: (qmail 15502 invoked by uid 22791); 30 Nov 2011 11:02:31 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 30 Nov 2011 11:02:17 +0000 Received: by yenr11 with SMTP id r11so398178yen.20 for ; Wed, 30 Nov 2011 03:02:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.193.68 with SMTP id j44mr2466961yhn.97.1322650936620; Wed, 30 Nov 2011 03:02:16 -0800 (PST) Received: by 10.146.137.4 with HTTP; Wed, 30 Nov 2011 03:02:16 -0800 (PST) Date: Wed, 30 Nov 2011 12:02:16 +0100 Message-ID: Subject: [PATCH, lto]: Handle *tm regparm attribute From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! Attached patch handles "*tm regparm" attribute, to avoid "*tm regparm" attribute ignored warnings in lto compile on non-x86 targets. 2011-11-30 Uros Bizjak * lto-lang.c (lto_attribute_table): Handle *tm regparm. (ignore_attribute): New. Tested on alphaev68-pc-linux-gnu and x86_64-pc-linux-gnu {,-m32}. OK for mainline? Uros. Index: lto-lang.c =================================================================== --- lto-lang.c (revision 181835) +++ lto-lang.c (working copy) @@ -47,6 +47,8 @@ static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *); static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *); static tree handle_transaction_pure_attribute (tree *, tree, tree, int, bool *); +static tree ignore_attribute (tree *, tree, tree, int, bool *); + static tree handle_format_attribute (tree *, tree, tree, int, bool *); static tree handle_format_arg_attribute (tree *, tree, tree, int, bool *); @@ -78,6 +80,10 @@ handle_type_generic_attribute, false }, { "transaction_pure", 0, 0, false, true, true, handle_transaction_pure_attribute, false }, + /* For internal use only. The leading '*' both prevents its usage in + source code and signals that it may be overridden by machine tables. */ + { "*tm regparm", 0, 0, false, true, true, + ignore_attribute, false }, { NULL, 0, 0, false, false, false, NULL, false } }; @@ -419,6 +425,18 @@ return NULL_TREE; } +/* Ignore the given attribute. Used when this attribute may be usefully + overridden by the target, but is not used generically. */ + +static tree +ignore_attribute (tree * ARG_UNUSED (node), tree ARG_UNUSED (name), + tree ARG_UNUSED (args), int ARG_UNUSED (flags), + bool *no_add_attrs) +{ + *no_add_attrs = true; + return NULL_TREE; +} + /* Handle a "format" attribute; arguments as in struct attribute_spec.handler. */