From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id C7FF0385AE6C for ; Mon, 12 Sep 2022 08:19:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7FF0385AE6C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x433.google.com with SMTP id k9so14124004wri.0 for ; Mon, 12 Sep 2022 01:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=Mhh6MfwVrnwEUCkbM8neUFKMIXsrYxQXwDQo0ETm+DU=; b=AbEIjL3iYcdRuCGS5oU6ynbKhj6TvP4IR3Djssdrfb/m9thx9K0y5iOOqRg7A/UFh0 72B81PX+BgjO+XA42ez8X1d2Dlvw/tRrZj+BmNZEh0mLt/6ra6E6kLYasAZoEyxLfkOw uujHCGxumFFBRAt7T6PD8+FH3K/VHiI4WR3AI5A+uHK4IarB2YvMGv7Z007vmBMv63/u +1AinU87dmWdmugoiRos6DPCVUEKCjAPv76uuiPJPv7W1J88jcorjziNfnjFT4v+U4LT FfQ3hUbol5cuIcI42yBEi6Y0Om9mRGk9Qg3DJUENbJdS+PuD7Xw01F+/6GrUA63+y7EW QkUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=Mhh6MfwVrnwEUCkbM8neUFKMIXsrYxQXwDQo0ETm+DU=; b=GZKEZ4wviJFf01BTCHtMmMBD1paABG04oLk3sYWFdH1g1etCeKqYYGqNKs0ysTKZ5n Fd5Kc3cVGHM9h/1NYAQbJYp7CtRUa9OAjGvQlKc4WEZCORjiYH8pL5QabWwlUywrcodO 7jacOE+wFx2KYC1MZLIiEIO94maQFLh7Zrcc+rvr3GMPomywSSybPqQvJ7zdvSJT7F8f qd5hJkAt/M+BkuFxHk61/8EkGlDZ2aQM29F0FcGpvJWr4e7K4wyIKr6P+97lMdRgdBfc hfrefTTfIitiQi4lk/9dQPSjqWHS9J6iaaHhW0XK0A6yViOra3qzlRG3LkWTk+Ccr5ji 5EKw== X-Gm-Message-State: ACgBeo2mWHHdUcJfaCtRIb1f3zhabuqlg6uaasxVXYyQELxbjKkUOoDX xl6F0rJlI710Zsb3rjD8PgKms0bvxpIllw== X-Google-Smtp-Source: AA6agR4el4v6QGbCMAKPGXo8hrDp73Z1OiFTyXErU/ZWmfBZXIQT10AleD7ZA2C3ycL5ME3kUOJ/jg== X-Received: by 2002:adf:db44:0:b0:22a:56eb:927f with SMTP id f4-20020adfdb44000000b0022a56eb927fmr4715027wrj.627.1662970787446; Mon, 12 Sep 2022 01:19:47 -0700 (PDT) Received: from poulhies-Precision-5550 (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id b5-20020a5d4b85000000b00223b8168b15sm6602563wrt.66.2022.09.12.01.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 01:19:46 -0700 (PDT) Date: Mon, 12 Sep 2022 10:19:46 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Fix immediate assertion failure with -gnatd.1 Message-ID: <20220912081946.GA1513177@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The switch enables the front-end unnesting pass. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Relax assertion when front-end unnesting is enabled. --r5Pyd7+fXNt84Ff3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -436,7 +436,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If this is a numeric or enumeral type, or an access type, a nonzero Esize must be specified unless it was specified by the programmer. Exceptions are for access-to-protected-subprogram types and all access subtypes, as - another GNAT type is used to lay out the GCC type for them. */ + another GNAT type is used to lay out the GCC type for them, as well as + access-to-subprogram types if front-end unnesting is enabled. */ gcc_assert (!is_type || Known_Esize (gnat_entity) || Has_Size_Clause (gnat_entity) @@ -445,6 +446,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) && (!IN (kind, Access_Kind) || kind == E_Access_Protected_Subprogram_Type || kind == E_Anonymous_Access_Protected_Subprogram_Type + || ((kind == E_Access_Subprogram_Type + || kind == E_Anonymous_Access_Subprogram_Type) + && Unnest_Subprogram_Mode) || kind == E_Access_Subtype || type_annotate_only))); --r5Pyd7+fXNt84Ff3--