From patchwork Thu Apr 26 12:09:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 905035 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-476847-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="wFND8sBC"; 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 40WwqH2TB3z9ry1 for ; Thu, 26 Apr 2018 22:09:46 +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:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=EOzI8TjW65E2fszd+GzpGTnBDii5QyTZO1ESHioxvlNVeEdz7Z MyHZ4Eawj/6Mk2g8kNC0afdI8NJRR0ycPzDKmVjSQuyVjF5PgQbS736cVua1jWqn TzCgShJIk/d/zx7moKWrATqvlKAk68uvoRvQfwpME8PrhcaQM9ZNr9gPw= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=1+VM1NYp2y+h3OwbzTtFcFxLYLw=; b=wFND8sBCTUy1ifKn4Do1 KFuKjkbFtVa0P0YRqUCgjo8lv9CEbmqHrP/0qqZJICdOeDS3+2vGpqbx8unHwW5g Dt4+wjBaNM45Cx0zmGmAn2OkR+7SlEUo8yGO69vILvI5mDSkyr8JXOs/c6ttVgac ZB/T/NEWdPmszA6S9cp3yMY= Received: (qmail 92341 invoked by alias); 26 Apr 2018 12:09:39 -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 92320 invoked by uid 89); 26 Apr 2018 12:09:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1064 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Apr 2018 12:09:37 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6F835ACC3; Thu, 26 Apr 2018 12:09:34 +0000 (UTC) Date: Thu, 26 Apr 2018 14:09:34 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: richard.earnshaw@arm.com, james.greenhalgh@arm.com, marcus.shawcroft@arm.com Subject: [PATCH] Fix aarch64 ILP32 ICE with vaarg gimplified code Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Seen by Christophe Lyon, verified with a cross that this fixes the issue. aarch64 people, can you please test & commit this? Thanks, Richard. 2018-04-26 Richard Biener * config/aarch64/aarch64.c: Simplify ap.__stack advance and fix for ILP32. Index: gcc/config/aarch64/aarch64.c =================================================================== --- gcc/config/aarch64/aarch64.c (revision 259669) +++ gcc/config/aarch64/aarch64.c (working copy) @@ -12278,12 +12278,9 @@ aarch64_gimplify_va_arg_expr (tree valis else roundup = NULL; /* Advance ap.__stack */ - t = fold_convert (intDI_type_node, arg); - t = build2 (PLUS_EXPR, TREE_TYPE (t), t, - build_int_cst (TREE_TYPE (t), size + 7)); + t = fold_build_pointer_plus_hwi (arg, size + 7); t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, build_int_cst (TREE_TYPE (t), -8)); - t = fold_convert (TREE_TYPE (arg), t); t = build2 (MODIFY_EXPR, TREE_TYPE (stack), unshare_expr (stack), t); /* String up roundup and advance. */ if (roundup)