From patchwork Mon May 27 10:26:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1105728 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-501709-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="MQ6jayfp"; 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 45CCp72n8qz9s5c for ; Mon, 27 May 2019 20:27:08 +1000 (AEST) 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=ZG1cqrM3v4BS5RTp fmw3i+XrM7OXikIcuCSH1nvpqmCa26+VF00h91+/HDdKyLuwDlMbXXXw8RzKmRnP hX1ygu1voI3R7Ypw++f/sQ1HI5pY3SZyLcBiUW0ptDvrgYS2OK4iXRkycdC7pcj8 O0Hzn2eMoLxD1FE0xFG5UsZFP8g= 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=P88jWvwsBW0VmlGNq9LrZb phr30=; b=MQ6jayfpgzVFOTtozLJ6JAa0VSXXZULCyCHvU8lFuiwN7EQH/cPm01 DfE06Fsc7uPPOiVZnZf2QD9jgbKbfgnSA3btHYIIMYqIVGKkmhntNxUV1K0JvNk0 3Ak58cQTsKsdD84qp/kV6TpzfsFnaqSMTT0lKt+evhyJpClq5myZA= Received: (qmail 8815 invoked by alias); 27 May 2019 10:27:01 -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 8807 invoked by uid 89); 27 May 2019 10:27:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=clause, dereference 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; Mon, 27 May 2019 10:27:00 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 18F2181385 for ; Mon, 27 May 2019 12:26:58 +0200 (CEST) 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 maGxKpAFshiL for ; Mon, 27 May 2019 12:26:58 +0200 (CEST) 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 EC12881368 for ; Mon, 27 May 2019 12:26:57 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix spurious error on unchecked conversion to misaligned type Date: Mon, 27 May 2019 12:26:56 +0200 Message-ID: <55679912.TIlmRFJPrb@polaris> MIME-Version: 1.0 This is a regression present on the mainline, 9 and 8 branches. The compiler issues a spurious error on the result of an unchecked conversion used as an actual In parameter in a subprogram call, if the destination type is a scalar type subject to a clause which gives an alignment lower than the natural one. Tested on x86_64-suse-linux, applied on the mainline, 9 and 8 branches. 2019-05-27 Eric Botcazou * gcc-interface/trans.c (Call_to_gnu): Use the unpadded type when putting back an intermediate conversion the type of the actuals. 2019-05-27 Eric Botcazou * gnat.dg/unchecked_convert13.adb: New test. Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 336034) +++ gcc-interface/trans.c (revision 336035) @@ -5354,7 +5354,7 @@ Call_to_gnu (Node_Id gnat_node, tree *gn since the parent is a procedure call, so put it back here. Note that we might have a dummy type here if the actual is the dereference of a pointer to it, but that's OK if the formal is passed by reference. */ - tree gnu_actual_type = gnat_to_gnu_type (Etype (gnat_actual)); + tree gnu_actual_type = get_unpadded_type (Etype (gnat_actual)); if (TYPE_IS_DUMMY_P (gnu_actual_type)) gcc_assert (is_true_formal_parm && DECL_BY_REF_P (gnu_formal)); else if (suppress_type_conversion