From patchwork Mon Aug 11 13:49:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Tocar X-Patchwork-Id: 378995 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 1B5CF14013A for ; Mon, 11 Aug 2014 23:50:05 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=PztziKoGQIFKlOH0iaKRQ+X4R/6SWb/VibVH7N44meHt4tjyGuwmP yh8r1WM0L6qpPPaV2sZM1kxcGp6MHJCzj5ZHqUyb9GgURqoRjQTP7MzAKyZQvEdl OiD3lXoz4Xxv/txgzMxuu/2kU5vL3QJbiKIPrCR3jl/cvkkTNiy/Gk= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=DH7WtptTSqISYodUGbj5E7VKLtI=; b=nRHiYbPEIlhYVM099Mck FuW23oqcKe9y8wmSEq6dm6A6WreVdj2yltYwJwI50xfJiPwvrr7NBTCmgquMPe2R s9o5BQxwZtSunP2ib8j5GrXtRHdQcQZue55pX0iiCGrLPQPKtZ5txw8Hpg39PTpC gfKxpt+MEBgkizr63AC1QfU= Received: (qmail 6635 invoked by alias); 11 Aug 2014 13:49:58 -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 6625 invoked by uid 89); 11 Aug 2014 13:49:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 11 Aug 2014 13:49:56 +0000 Received: by mail-pa0-f45.google.com with SMTP id eu11so11169252pac.32 for ; Mon, 11 Aug 2014 06:49:54 -0700 (PDT) X-Received: by 10.66.150.37 with SMTP id uf5mr42246240pab.36.1407764994383; Mon, 11 Aug 2014 06:49:54 -0700 (PDT) Received: from msticlxl7.ims.intel.com (jfdmzpr06-ext.jf.intel.com. [134.134.137.75]) by mx.google.com with ESMTPSA id nh16sm5050669pdb.9.2014.08.11.06.49.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 06:49:53 -0700 (PDT) Date: Mon, 11 Aug 2014 17:49:37 +0400 From: Ilya Tocar To: gcc-patches@gcc.gnu.org Subject: [PATCH] fix hardreg_cprop to honor HARD_REGNO_MODE_OK. Message-ID: <20140811134937.GA95937@msticlxl7.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, I've observed SPEC2006 failure on avx512-vlbwdq branch. It was caused by hardreg_cprop. In maybe_mode_change it was assumed, that all values of the same register class and same mode. are ok. This is not the case for i386/avx512. We need to honor HARD_REGNO_MODE_OK. Patch bellow does it. Ok for trunk? 2014-08-11 Ilya Tocar * regcprop.c (maybe_mode_change): Honor HARD_REGNO_MODE_OK. --- gcc/regcprop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/regcprop.c b/gcc/regcprop.c index 932037d..694deb2 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -410,7 +410,7 @@ maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode, && GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (new_mode)) return NULL_RTX; - if (orig_mode == new_mode) + if (orig_mode == new_mode && HARD_REGNO_MODE_OK (regno, new_mode)) return gen_rtx_raw_REG (new_mode, regno); else if (mode_change_ok (orig_mode, new_mode, regno)) {