From patchwork Mon Jun 1 20:33:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1301933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=gStFQZI4; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49bRj50tkGz9sWr for ; Tue, 2 Jun 2020 06:33:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F2E03870911; Mon, 1 Jun 2020 20:33:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F2E03870911 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591043635; bh=8erwhDgrab7wkhmeyNASX7tbHFxNQSU4O/yv0KcGvU0=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=gStFQZI4XbsvpBAHiG3sl+YpWSN20ONxMTECsZuM4+ZjQP3sfkdSrJmqizT0tvFT+ Bu1m6DZlZ7TMtt3OAA8OWUE7rjgAND1egIF8Sk7uRvdDIw013hU9o6OUwBmpr2o8aJ 80PLJVkiHk07HLcJUNCn89zsm2DzJO/gNqzMOo+w= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id AEB46386F829; Mon, 1 Jun 2020 20:33:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AEB46386F829 Received: by mail-qt1-x829.google.com with SMTP id x29so8864875qtv.4; Mon, 01 Jun 2020 13:33:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=8erwhDgrab7wkhmeyNASX7tbHFxNQSU4O/yv0KcGvU0=; b=om5BX4oyZKNXEWbMIRcDQX3HzwXNUHaPTHWQMAdEJTtMH9x6kjmoY3C+BkwzOwD1iv fvsQPDwJPbD0FpfXgLZSHtLqdATit/DjzUbjVZc0CoPU5B9NmDNjWHZMCuF8qaIXurpS NKTHpbAipMyQe5gvi0wiRR9lT4v8VD9bw3PxrqqqiP5nzsfO+tzCmpyg5TrYU/ZpS8+K Q5a4komdLSiEiiFZNFzcf/L1h/oQJH2DUzH0MWYfb5YE7/73FEY5KXugVTU+DU1hzA94 StvIMYYpQsHZDiqGAv+9ku34tL2n8D8BWfTwpljkgnzopQh0BDogIV2wiqR3s9j0zaAE MHbw== X-Gm-Message-State: AOAM5330fc1OmbcovDl/f449RQ0VJqotszpjrC3m357JuKi8XrVtzbwY MyGavHeXtuDrr/VwQu3Mh5jPW4aHtQraw0IAsKUxVx3QQ0s= X-Google-Smtp-Source: ABdhPJyeyTe4GUl1iQq4Eq3t9WiB9vLEw2st8LLdKzVSatCkGVvo5u6KiPnbQfJE7t7suYnY4GgdiwA/VVzu+2/4kg8= X-Received: by 2002:ac8:1c71:: with SMTP id j46mr24306138qtk.60.1591043631049; Mon, 01 Jun 2020 13:33:51 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 1 Jun 2020 22:33:39 +0200 Message-ID: Subject: [committed] i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418] To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Cc: Fortran List Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved. The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order to match the layout of x87 state image in memory. 2020-06-01 Uroš Bizjak libatomic/ChangeLog: * config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)). libgcc/ChangeLog: * config/i386/sfp-exceptions.c (struct fenv): Add __attribute__ ((gcc_struct)). libgfortran/ChangeLog: PR libfortran/95418 * config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)). Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}, and as stated in the PR, also tested by Markus on MinGW. Uros. diff --git a/libatomic/config/x86/fenv.c b/libatomic/config/x86/fenv.c index 88622c613f3..138a67ff217 100644 --- a/libatomic/config/x86/fenv.c +++ b/libatomic/config/x86/fenv.c @@ -45,7 +45,7 @@ struct fenv unsigned int __data_offset; unsigned short int __data_selector; unsigned short int __unused5; -}; +} __attribute__ ((gcc_struct)); #ifdef __SSE_MATH__ # define __math_force_eval_div(x, y) \ diff --git a/libgcc/config/i386/sfp-exceptions.c b/libgcc/config/i386/sfp-exceptions.c index 72cb0f4d3bb..3aed0af7c46 100644 --- a/libgcc/config/i386/sfp-exceptions.c +++ b/libgcc/config/i386/sfp-exceptions.c @@ -39,7 +39,7 @@ struct fenv unsigned int __data_offset; unsigned short int __data_selector; unsigned short int __unused5; -}; +} __attribute__ ((gcc_struct)); #ifdef __SSE_MATH__ # define __math_force_eval_div(x, y) \ diff --git a/libgfortran/config/fpu-387.h b/libgfortran/config/fpu-387.h index 8b5e758c2ca..7ff5acdc933 100644 --- a/libgfortran/config/fpu-387.h +++ b/libgfortran/config/fpu-387.h @@ -85,7 +85,7 @@ struct fenv unsigned short int __data_selector; unsigned short int __unused5; unsigned int __mxcsr; -}; +} __attribute__ ((gcc_struct)); /* Check we can actually store the FPU state in the allocated size. */ _Static_assert (sizeof(struct fenv) <= (size_t) GFC_FPE_STATE_BUFFER_SIZE,