From patchwork Wed May 24 08:12:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 766367 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wXlWl3RNTz9sNb for ; Wed, 24 May 2017 18:13:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="CQm5KXjJ"; dkim-atps=neutral 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=dVWeoebdS8L926Le SIa2idPMaD14p+OmTi91G7CzYKcLgt6joejwxXfr/KsWkjUMLIcsCsMWqeT8viFP rX8HFA5xiMArTNf7MdPDXEFweLn51RniiSJSgoEsm5z4Sg+N1h5jpizrR9pRFHo4 tjhuy8iqmzJpQsuFwZaPkV3BIO4= 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=EQoVF1Dc9Wz6xWRVZr4gSK M5AHo=; b=CQm5KXjJ22aBmArATvffnOEtuDkSf5Qz3fNfA6xN/eVOLM0c2Fh9MF Xq+MWn/rfaZTZWKe2KkLRGtGv9hjrmZRQhMf9ZNhPil9fHnCcs1RPiZTWkMQ6abX rCEF1NA1nd/tw3JXNTzfKiZS+AGkGxXCCmnxNDihn9zKzgID5a6+M= Received: (qmail 9748 invoked by alias); 24 May 2017 08:12:55 -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 9715 invoked by uid 89); 24 May 2017 08:12:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.9 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=provision 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; Wed, 24 May 2017 08:12:53 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1E16D8135D for ; Wed, 24 May 2017 10:12:55 +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 An7pC_pAyLjT for ; Wed, 24 May 2017 10:12:55 +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 ED64481352 for ; Wed, 24 May 2017 10:12:54 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix var-tracking for special record parameters passed indirectly Date: Wed, 24 May 2017 10:12:54 +0200 Message-ID: <2244478.hX7oRJZ8It@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 var-tracking doesn't track structures and arrays as a whole because it cannot track values for multiple-part variables, but it has a special provision for Ada fat pointer types, which are structures with integral mode containing a pair of pointers and are pervasive in the language (see param-[123].c in the guality testsuite). This works fine e.g. on x86 or x86-64, but not on SPARC or Visium which pass these structures indirectly as per their ABI. Tested on x86_64-suse-linux and visium-elf, applied on mainline as obvious. 2017-05-24 Eric Botcazou * var-tracking.c (track_expr_p): Do not return 0 for tracked record parameters passed indirectly. Index: var-tracking.c =================================================================== --- var-tracking.c (revision 248140) +++ var-tracking.c (working copy) @@ -5220,8 +5220,9 @@ track_expr_p (tree expr, bool need_rtl) if (decl_rtl && MEM_P (decl_rtl)) { /* Do not track structures and arrays. */ - if (GET_MODE (decl_rtl) == BLKmode - || AGGREGATE_TYPE_P (TREE_TYPE (realdecl))) + if ((GET_MODE (decl_rtl) == BLKmode + || AGGREGATE_TYPE_P (TREE_TYPE (realdecl))) + && !tracked_record_parameter_p (realdecl)) return 0; if (MEM_SIZE_KNOWN_P (decl_rtl) && MEM_SIZE (decl_rtl) > MAX_VAR_PARTS)