From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82608 invoked by alias); 13 Dec 2018 19:27:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 82588 invoked by uid 89); 13 Dec 2018 19:27:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=cum, HX-Received:a7b X-HELO: mail-wm1-f67.google.com Received: from mail-wm1-f67.google.com (HELO mail-wm1-f67.google.com) (209.85.128.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Dec 2018 19:27:06 +0000 Received: by mail-wm1-f67.google.com with SMTP id y185so14603446wmd.1 for ; Thu, 13 Dec 2018 11:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Dghuzzs7E3Wqgk4IDLLiS0vzF7YA3coURiUyprVbIc8=; b=pflhj/myX1xqQ7Cz8xeFW1bgDrl8NRzoBViVCVMDnbukaeCc1nj7YYrrijkyua2Vsx IbHouE4SanyFiXVEMUoGGv4nOPioLP4phpa9j7HYafna6dyTLr8k6ym7H7LqFPNaSFs8 +oPvvgT+GFKqc5Ng0IJ9XnbF95LtJulh3aA20OEporN5CbwAKXRb6/EEi3rq4/m5qa4t YOjKd8d2s5FttciMsCmwGP+zliuFla7cMUsXoWyBl6Z3wQsVWv/7ixKYJcOdQyzahss5 OGTRC4svMFohI84DmuPXG6vx5jMaNTQ5RVv9qu/4H4HuWbYuZ4miYv5qvOYp53xtrGZ6 /8Ag== MIME-Version: 1.0 References: <452eaa4b26900f05171ab5b782b3ec8bed216785.1543969053.git.segher@kernel.crashing.org> In-Reply-To: <452eaa4b26900f05171ab5b782b3ec8bed216785.1543969053.git.segher@kernel.crashing.org> From: David Edelsohn Date: Thu, 13 Dec 2018 19:27:00 -0000 Message-ID: Subject: Re: [PATCH] rs6000: Fix AIX aggregate passing fix To: Segher Boessenkool Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-12/txt/msg00972.txt.bz2 On Tue, Dec 4, 2018 at 7:26 PM Segher Boessenkool wrote: > > David's fix for the AIX aggregate passing from yesterday unfortunately > also triggers on powerpc64-linux. This fixes it. > > David, looking at this once more, does this not need a "&& type" test > on AIX? Before the AGGREGATE_TYPE_P test. I suspect it only didn't > crash on AIX because AIX doesn't mind dereferencing address 0? The APIs for the functions explicitly allow type to be NULL for libcalls, so type should be tested. AIX allows dereference of NULL pointer, which explains the lack of symptoms on AIX. As far as I can tell, adding a test for non-NULL type does not cause additional incompatibilities. I am committing the appended patch. Bootstrapped on powerpc-ibm-aix7.2.0.0. Thanks, David * config/rs6000/rs6000.c (rs6000_function_arg): Ensure type is non-NULL. (rs6000_arg_partial_bytes): Same. Index: rs6000.c =================================================================== --- rs6000.c (revision 267103) +++ rs6000.c (working copy) @@ -11999,7 +11999,8 @@ rs6000_function_arg (cumulative_args_t cum_v, mach cum->fregno++; if (USE_FP_FOR_ARG_P (cum, elt_mode) - && !(TARGET_AIX && !TARGET_ELF && AGGREGATE_TYPE_P (type))) + && !(TARGET_AIX && !TARGET_ELF + && type != NULL && AGGREGATE_TYPE_P (type))) { rtx rvec[GP_ARG_NUM_REG + AGGR_ARG_NUM_REG + 1]; rtx r, off; @@ -12136,7 +12137,8 @@ rs6000_arg_partial_bytes (cumulative_args_t cum_v, align_words = rs6000_parm_start (mode, type, cum->words); if (USE_FP_FOR_ARG_P (cum, elt_mode) - && !(TARGET_AIX && !TARGET_ELF && AGGREGATE_TYPE_P (type))) + && !(TARGET_AIX && !TARGET_ELF + && type != NULL && AGGREGATE_TYPE_P (type))) { unsigned long n_fpreg = (GET_MODE_SIZE (elt_mode) + 7) >> 3;