From patchwork Sat Apr 27 13:39:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1091997 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-499788-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="MaXyqFHH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dMJsOWBv"; 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 44rsVs2Ns9z9s47 for ; Sat, 27 Apr 2019 23:40:15 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=cUlYczO4Psp+lXDctknP/Xt5Sd8Po9OghzLNKZ89RMnNrC AptEjEd2r6Um6AXtSfetcQB2xuM0sW8TIK4hbbCcQ7dhXD93U1dpm8o2tOxHSaXZ I+Mue1sv9FRwm+hqIZ8sSrjCVU2VWojURs5pfyuo7rA5cQyo1IWzyHs1AKqRY= 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:from:date:message-id:subject:to:content-type; s= default; bh=q59U1+n8SkLWMpRZFwBViqXcp7U=; b=MaXyqFHHoVPJ7panlfFQ y4ZejX53iNWyePnb8/Yaheww9wNtRH9QhGbehT6PmrPCdFPWbkO9PvezU5u0/Eja nDHBsbdZQJ8tslDzxqXtM9J6NVzQcBhlWsYOU7wb0iXee9zI3DYsE6q5ZEHzSzPp iSwk32UKXySFLu+bV6WFaJY= Received: (qmail 70449 invoked by alias); 27 Apr 2019 13:40:08 -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 70441 invoked by uid 89); 27 Apr 2019 13:40:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=4.8 X-HELO: mail-it1-f175.google.com Received: from mail-it1-f175.google.com (HELO mail-it1-f175.google.com) (209.85.166.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 27 Apr 2019 13:40:06 +0000 Received: by mail-it1-f175.google.com with SMTP id y10so10061607itc.1 for ; Sat, 27 Apr 2019 06:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=FElhcG+BdGEYJMdJUAEbD+GOA8HWuaJUcNwWogXYJWk=; b=dMJsOWBvyw0f4ZjNNHDpuTIQqrSt+c3SGwmUN3OGFYPp3aEe8JXCsT6nw0kWulkwT/ LUqhmZhjbpUezVP6L7CVf8hbr2pg7IQ7dZHn1NAzmOKZ351GP3NTkhfBnJavVO4rrY7h V9qjdU/j2P7LN8hPoH9GJ3CVklkOFGQbERAmrI0xzKr+1bUDmYrYRQmnsm/7Mlc2LGzB f4tVOdY7FHRiqLIif2EjLJ30pT7G8mka3MD8DhSurHhbamVb3nwFKkCMNmEuu+XpYBNC TKAGAgJ4vWbqZpkV/z/ELbs/FQXxASDe+zs/tvIo6uixd1+DEqwznLQth17e/IaNdL6F c52Q== MIME-Version: 1.0 From: Uros Bizjak Date: Sat, 27 Apr 2019 15:39:53 +0200 Message-ID: Subject: [PATCH, i386]: Fix PR89261, ix86_data_alignment has wrong argument type To: "gcc-patches@gcc.gnu.org" 2019-04-27 Uroš Bizjak PR target/89261 * config/i386/i386-protos.h (ix86_data_alignment): Change the second argument type to unsigned int. * config/i386/i386.c (ix86_data_alignment): Change "align" argument type to unsigned int. testsuite/ChangeLog: 2019-04-27 Uroš Bizjak PR target/89261 * gcc.target/i386/pr89261.c: New test. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: config/i386/i386-protos.h =================================================================== --- config/i386/i386-protos.h (revision 270607) +++ config/i386/i386-protos.h (working copy) @@ -207,7 +207,7 @@ extern void init_cumulative_args (CUMULATIVE_ARGS #endif /* RTX_CODE */ #ifdef TREE_CODE -extern int ix86_data_alignment (tree, int, bool); +extern int ix86_data_alignment (tree, unsigned int, bool); extern unsigned int ix86_local_alignment (tree, machine_mode, unsigned int); extern unsigned int ix86_minimum_alignment (tree, machine_mode, Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 270607) +++ config/i386/i386.c (working copy) @@ -29802,7 +29802,7 @@ iamcu_alignment (tree type, int align) instead of that alignment to align the object. */ int -ix86_data_alignment (tree type, int align, bool opt) +ix86_data_alignment (tree type, unsigned int align, bool opt) { /* GCC 4.8 and earlier used to incorrectly assume this alignment even for symbols from other compilation units or symbols that don't need @@ -29810,7 +29810,7 @@ int those compilers, ensure we don't decrease alignment from what we used to assume. */ - int max_align_compat = MIN (256, MAX_OFILE_ALIGNMENT); + unsigned int max_align_compat = MIN (256, MAX_OFILE_ALIGNMENT); /* A data structure, equal or greater than the size of a cache line (64 bytes in the Pentium 4 and other recent Intel processors, including @@ -29817,7 +29817,7 @@ int processors based on Intel Core microarchitecture) should be aligned so that its base address is a multiple of a cache line size. */ - int max_align + unsigned int max_align = MIN ((unsigned) ix86_tune_cost->prefetch_block * 8, MAX_OFILE_ALIGNMENT); if (max_align < BITS_PER_WORD) Index: testsuite/gcc.target/i386/pr89261.c =================================================================== --- testsuite/gcc.target/i386/pr89261.c (nonexistent) +++ testsuite/gcc.target/i386/pr89261.c (working copy) @@ -0,0 +1,9 @@ +/* PR target/89261 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef double __v2df __attribute__ ((__vector_size__ (16), aligned(1 << 28))); + +__v2df foo = { 1.0, 2.0 }; + +/* { dg-final { scan-assembler "\.align\[ \t]+268435456" } } */