From patchwork Thu Aug 15 11:38:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1147553 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-507045-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="V//+i2hU"; 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 468PcX5WVjz9sN1 for ; Thu, 15 Aug 2019 21:39:24 +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:cc:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=uYGIuYUcfBQZ7hc8 9c07WWYnY18ll1av70UcVbr+yOC9yKtO2EFs1c+9d6afCeT9C+t8CzBYuWgvmFdZ uByAC4kZna2HSZurApi8wl0Or2Z6RaWELyIQw8DVhJULelsTJCScaeD9+wKYcfdR TBNzv/nSLLZG7WuJpUjSjZU0vPM= 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:cc:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=As42ZwqRjXed2ZmnWH5bw3 CX6gA=; b=V//+i2hUXZJpOyJ2wjTAtPcxbuHkuUeX/XSYchGfkYEo41twUblGkh 3yckrNzKTF3ykg6qeaFhZTGUZNHwUcgObYX7nBMVhTEE5CZ+gXKzlbQsAC1/okRP sye5kI6dLK7D4r1ooI3hYEonp3uFueujnJnAP0pKVoFMORr1StJWc= Received: (qmail 66401 invoked by alias); 15 Aug 2019 11:39: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 66392 invoked by uid 89); 15 Aug 2019 11:39:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Aug 2019 11:39:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C822D56093; Thu, 15 Aug 2019 07:39:14 -0400 (EDT) X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Cc" Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NoPMM-T1OfCz; Thu, 15 Aug 2019 07:39:14 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 8F9A956056; Thu, 15 Aug 2019 07:39:13 -0400 (EDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id x7FBcwb2042051 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 15 Aug 2019 08:39:01 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka , Uros Bizjak Cc: Rainer Orth , Mike Stump Subject: i386/asm-4 test: use amd64's natural addressing mode on all OSs Date: Thu, 15 Aug 2019 08:38:58 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 gcc.target/i386/asm-4.c uses amd64's natural PC-relative addressing mode on a single platform, using the 32-bit absolute addressing mode elsewhere. There's no point in giving up amd64's natural addressing mode and insisting on the 32-bit one when we're targeting amd64, and having to make explicit exceptions for systems where that's found not to work for whatever reason. If we just use the best-suited way to take the address of a function behind the compiler's back on each target variant, we're less likely to hit unexpected failures. Tested on x86_64-linux-gnu with unix{,-m32}. Ok to install? for gcc/testsuite/ChangeLog * gcc.target/i386/asm-4.c: Use amd64 natural addressing mode on all __LP64__ targets. --- gcc/testsuite/gcc.target/i386/asm-4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.target/i386/asm-4.c b/gcc/testsuite/gcc.target/i386/asm-4.c index b86801032bc4..69dd1d3df0bf 100644 --- a/gcc/testsuite/gcc.target/i386/asm-4.c +++ b/gcc/testsuite/gcc.target/i386/asm-4.c @@ -29,7 +29,7 @@ baz (void) { /* Darwin loads 64-bit regions above the 4GB boundary so we need to use this instead. */ -#if defined (__LP64__) && defined (__MACH__) +#if defined (__LP64__) __asm ("leaq foo(%%rip), %0" : "=r" (fn)); #else __asm ("movl $foo, %k0" : "=r" (fn));