From patchwork Sun Sep 1 10:36:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 1156269 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-508112-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NJtrK53l"; 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 46LqPp6k5gz9sNf for ; Sun, 1 Sep 2019 20:36:12 +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:subject:date:message-id:content-type:mime-version; q=dns; s= default; b=cM4EzOdF0v6HApngBU4xQmG0wYiO5CNhzq4yvrPzZ7cp3f53Gt7Td vMiemfpsYSEXF+XlsaHtVTskXnh9qRQhHwU2PqpJoEyRJhVc4/fGFA7gHanPreps 8eC7GYfIxsOazM7XRki+KsE+gY6NQqKzubaub4b7Gs+l//FzM4RSqo= 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:subject:date:message-id:content-type:mime-version; s= default; bh=st3nx9K7V8zsAZXqdX56lmcP6Lo=; b=NJtrK53lt0hUZ+FqhWZj gqyJPhyCUkJK6urpDZL1t0u+0qg/ZvRlAJF0SE0B1Drstsf6wmWHBiDwnFydQN28 JPiWriWofgbg0kEpYp19XcTypQFRw9slE55n//E7I9uurzbHkno/4ju6R6HAWO3f n7uCMDQPP7n74zAEC/Ztesk= Received: (qmail 58277 invoked by alias); 1 Sep 2019 10:36:05 -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 58257 invoked by uid 89); 1 Sep 2019 10:36:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*MI:COM, H*c:HHH X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-oln040092067021.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.92.67.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Sep 2019 10:36:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjHsIoPftXG6HjR4Em8WZXBsenUjEaQ8mkXNziEO6e7YVj3ooeh6dMrzzD/3HkfSAwrlX7X92//972jxHa6OneWddIJGDbR+dsxJXQvcdsMY2VVP1ln7/3VvTBs540wAwASdlWqv03PbVYAy3FrgtCjcG52G8EacWbXfeJ/shsu9s47qsVRnZweCqSYMI3D/nkzk5WD9USF+J+kYMyBDRw0d/O7uTl9mCHy8nTJRIWHiM61x9jy5UQOcvDKMS+WLQ7pxLtp7525DSRxSZUVOvW1XIR09+WF4NkNYQK+LPAHJxdhnNktdW3o06ZGZkfi/KI1VOYqPakkwYCroKD9XIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tFooEl24PVJuwTtmoAX0a5syFquX+Cj38NKuXKNoOeo=; b=hPhT5bo0ro5lF+HVE7RXHArd/lBWSKWg1857hdpqo3RsLE0LKiM5BcK/0gmn7SSVieufAbTNtSv9DsfwHKEb0k8PaH8w+7ffkY63zFUFCZzTUWvhwxL2N435RDABaZUagfwF5JGwWrEg9EO7vgnFzoGogI7/13X18mj3p1ZqRMFNit3yMbCKjMkxIWcls8a5A2CywzeCBcoN3icCO7PuCCWbDSNMBgg0N8su4Fc4Dx1wQkVX//ZT5uYYLAoSjmkXppeMGLkumBEhukvdLXijhpcyX9xRpT1RiQ6ZJjhHus2qkzipu434QW3xYC0biciEhYgBxGZPKKEpIygHZS8OGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM5EUR02FT041.eop-EUR02.prod.protection.outlook.com (10.152.8.52) by AM5EUR02HT121.eop-EUR02.prod.protection.outlook.com (10.152.9.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2220.16; Sun, 1 Sep 2019 10:36:00 +0000 Received: from AM6PR10MB2566.EURPRD10.PROD.OUTLOOK.COM (10.152.8.60) by AM5EUR02FT041.mail.protection.outlook.com (10.152.9.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2220.16 via Frontend Transport; Sun, 1 Sep 2019 10:36:00 +0000 Received: from AM6PR10MB2566.EURPRD10.PROD.OUTLOOK.COM ([fe80::4056:d9d8:9ce5:1976]) by AM6PR10MB2566.EURPRD10.PROD.OUTLOOK.COM ([fe80::4056:d9d8:9ce5:1976%4]) with mapi id 15.20.2199.021; Sun, 1 Sep 2019 10:36:00 +0000 From: Bernd Edlinger To: "gcc-patches@gcc.gnu.org" , Richard Biener , Jeff Law Subject: [PATCH] Fix PR 91605 Date: Sun, 1 Sep 2019 10:36:00 +0000 Message-ID: x-microsoft-original-message-id: x-ms-exchange-transport-forked: True MIME-Version: 1.0 Hi, this fixes an oversight in r274986. We need to avoid using movmisalign on DECL_P which are not in memory, similar to the !mem_ref_refers_to_non_mem_p which unfortunately can't handle DECL_P. Bootstrapped and reg-tested on x86_64-pc-linux-gnu. Is it OK for trunk? Thanks Bernd. 2019-09-01 Bernd Edlinger PR middle-end/91605 * expr.c (expand_assignment): Avoid DECL_P with DECL_RTL not being MEM_P. testsuite: 2019-09-01 Bernd Edlinger PR middle-end/91605 * g++.target/i386/pr91605.C: New test. Index: gcc/expr.c =================================================================== --- gcc/expr.c (revision 275063) +++ gcc/expr.c (working copy) @@ -5004,7 +5004,8 @@ expand_assignment (tree to, tree from, bool nontem || TREE_CODE (to) == TARGET_MEM_REF || DECL_P (to)) && mode != BLKmode - && (DECL_P (to) || !mem_ref_refers_to_non_mem_p (to)) + && (DECL_P (to) ? MEM_P (DECL_RTL (to)) + : !mem_ref_refers_to_non_mem_p (to)) && ((align = get_object_alignment (to)) < GET_MODE_ALIGNMENT (mode)) && (((icode = optab_handler (movmisalign_optab, mode)) Index: gcc/testsuite/g++.target/i386/pr91605.C =================================================================== --- gcc/testsuite/g++.target/i386/pr91605.C (revision 0) +++ gcc/testsuite/g++.target/i386/pr91605.C (working copy) @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fpack-struct -mavx" } */ + +struct A { + __attribute__((__vector_size__(4 * sizeof(double)))) double data; +}; +struct B { + A operator*(B); +}; +void fn1() { + B x, y; + x *y; +}