From patchwork Fri Feb 9 08:55:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 871247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-472926-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="UD6cf7S0"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zd8634t99z9s72 for ; Fri, 9 Feb 2018 19:55:22 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=ez7YX1YNX4gyolWf xCl2R3b8DDGdlq39mClZbDhHj5N8FGzUydI1gQONuk4VAYSWkriZd7D9uBFeQj3w z/HVEn5i0/34U0lgjlRF73gR8PcB6FS5uvrP8yPR9O6Q6ZsjjSwbv6EKpLosBkN3 /6CVob2YGLIoUnKO9kNJAD7PpqQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=VyxTEXA4GfRPZyj8AGXJrc pAliM=; b=UD6cf7S0CKqa2u79P8XMwtK1bIhEL1VI4CmZivFjDNCrshxNbyrYio hDVYhSfz94N6mSr3Ly+KpeVAXeLMjQAWEUaaJaM9kQ5wGKkEOX2rR6Q8lR3V7k5S /XlMVW76aAA20PxEMlU7AdddJPdATx3HAxU3j0AogGdb0oswew0Ik= Received: (qmail 118337 invoked by alias); 9 Feb 2018 08:55:10 -0000 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 Received: (qmail 118311 invoked by uid 89); 9 Feb 2018 08:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Feb 2018 08:55:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id CAB9C8138C for ; Fri, 9 Feb 2018 09:55:05 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3c3TZZEoDWPC for ; Fri, 9 Feb 2018 09:55:05 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id AE28481387 for ; Fri, 9 Feb 2018 09:55:05 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix small regression in -fdump-ada-spec Date: Fri, 09 Feb 2018 09:55:03 +0100 Message-ID: <3583644.mhZvfOyiAA@polaris> MIME-Version: 1.0 We cannot generate the 'constant' keyword for components in Ada, it's illegal. Tested on x86_64-suse-linux, applied on the mainline. 2018-02-09 Eric Botcazou c-family/ * c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant' keyword for components. Index: c-family/c-ada-spec.c =================================================================== --- c-family/c-ada-spec.c (revision 257404) +++ c-family/c-ada-spec.c (working copy) @@ -3131,7 +3131,7 @@ dump_ada_declaration (pretty_printer *bu { pp_string (buffer, "aliased "); - if (TREE_READONLY (t)) + if (TREE_READONLY (t) && TREE_CODE (t) != FIELD_DECL) pp_string (buffer, "constant "); if (TYPE_NAME (TREE_TYPE (t))) @@ -3147,7 +3147,7 @@ dump_ada_declaration (pretty_printer *bu || TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE)) pp_string (buffer, "aliased "); - if (TREE_READONLY (t)) + if (TREE_READONLY (t) && TREE_CODE (t) != FIELD_DECL) pp_string (buffer, "constant "); dump_generic_ada_node