From patchwork Mon Feb 9 05:41:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 437784 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 BF09714012A for ; Mon, 9 Feb 2015 16:41:48 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=n9EV4HJPAkPJipBUmDJNp+BEi+eUukK33JO9+pqX667aAJ ZlhWzmqNH8O3TSdeyhZsazyhqtUgFd7FIXU3wAr0wCiI9zFGNf2mhMJlcvm8OLTx qsA3/t5bYEYVYpOY63fZfpvV+OlVxJyac5CE0OYX03SQvLOhJV9MkNWQrEOSk= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=mOSS5idh7PJjPTGp8OFfs1Wa0UE=; b=PZ+76oBGKz0PZc/CEQCr SYBPHigLmwMs0m68KjmEtaxcTFAS5fUe2K/Jt8Fki5nVOulGJN28edNBVn/EKb0O ue+yJLPZ3PmCE6IBkvslYAZOItwwS3YXZOrL9Nj4iWGj1Sf7b+xhxNc5QeCsxAZl OLD5V6M3/cSKyzM3+DAEwR4= Received: (qmail 22289 invoked by alias); 9 Feb 2015 05:41:18 -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 22279 invoked by uid 89); 9 Feb 2015 05:41:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oi0-f44.google.com Received: from mail-oi0-f44.google.com (HELO mail-oi0-f44.google.com) (209.85.218.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 09 Feb 2015 05:41:16 +0000 Received: by mail-oi0-f44.google.com with SMTP id a3so10150449oib.3 for ; Sun, 08 Feb 2015 21:41:14 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.149.232 with SMTP id ud8mr10500106oeb.51.1423460474311; Sun, 08 Feb 2015 21:41:14 -0800 (PST) Received: by 10.60.93.230 with HTTP; Sun, 8 Feb 2015 21:41:14 -0800 (PST) Date: Sun, 8 Feb 2015 21:41:14 -0800 Message-ID: Subject: [PATCH/AARCH64] Fix gcc.c-torture/compile/pr37433.c for AARCH64:ILP32. From: Andrew Pinski To: GCC Patches X-IsSubscribed: yes The problem here is that we get a symbol_ref which is SImode but for the sibcall patterns we only match symbol_refs which use DImode. I added a new testcase that tests the non-value sibcall pattern too. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. Thanks, Andrew Pinski ChangeLog: * config/aarch64/aarch64.md (sibcall): Force call address to be DImode for ILP32. (sibcall_value): Likewise. testsuite/ChangeLog: * gcc.c-torture/compile/pr37433-1.c: New testcase. commit e72320f54d1c6ed6f2324a3faaad02175c83887b Author: Andrew Pinski Date: Sun Feb 8 23:05:01 2015 +0000 Fix gcc.c-torture/compile/pr37433.c for AARCH64:ILP32. The problem here is that we get a symbol_ref which is SImode but for the sibcall patterns we only match symbol_refs which use DImode. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. Thanks, Andrew Pinski * config/aarch64/aarch64.md (sibcall): Force operands[0]'s address to be DImode for ILP32. (sibcall_value): Likewise. * gcc.c-torture/compile/pr37433-1.c: New testcase. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 1f4169e..05240ba 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -687,6 +687,11 @@ && (GET_CODE (XEXP (operands[0], 0)) != SYMBOL_REF)) XEXP (operands[0], 0) = force_reg (Pmode, XEXP (operands[0], 0)); + if (TARGET_ILP32 + && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF + && GET_MODE (XEXP (operands[0], 0)) == SImode) + XEXP (operands[0], 0) = convert_memory_address (DImode, + XEXP (operands[0], 0)); if (operands[2] == NULL_RTX) operands[2] = const0_rtx; @@ -717,6 +722,12 @@ && (GET_CODE (XEXP (operands[1], 0)) != SYMBOL_REF)) XEXP (operands[1], 0) = force_reg (Pmode, XEXP (operands[1], 0)); + if (TARGET_ILP32 + && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF + && GET_MODE (XEXP (operands[1], 0)) == SImode) + XEXP (operands[1], 0) = convert_memory_address (DImode, + XEXP (operands[1], 0)); + if (operands[3] == NULL_RTX) operands[3] = const0_rtx; diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c b/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c new file mode 100644 index 0000000..322c167 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr37433-1.c @@ -0,0 +1,11 @@ +void regex_subst(void) +{ + const void *subst = ""; + (*(void (*)(int))subst) (0); +} + +void foobar (void) +{ + int x; + (*(void (*)(void))&x) (); +}