From patchwork Thu Jun 22 10:00:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 779431 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 3wtcZN0WRxz9sNv for ; Thu, 22 Jun 2017 20:02:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OeJG/kGw"; dkim-atps=neutral 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:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=Wm8bVGG1i8j4rlod Z4eTEMDFHb090iDujlpWupir3p7Ve16ZREQvbeb+WtN0n67KlY7qzgfmN36Tj8Lb RD2CJZyImohr0WuNiams1SnlHw6ckcoHWdSZd5b22ljemgnBTXh5sygKWPnG977v 9MMoVpZOuQZN65CiYWWPGryK9f4= 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:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=A+TeOCvnV53nt1vU/KZv7Y 2HYp0=; b=OeJG/kGwQ86qnelLqSjF1OPjKRxXv6TaM6JiVoJPWknHTW8+v+/6+B sEzrBluxC0iNg6AJD2+FxymVhQqqEGoKwW/v8m7ymP5l4X+acG3QYelaRTOVWRO4 r95cT6SDui/2NuzoGLjsIRnPHvzWmPFZSi8I5PQOME91z4pezpqGc= Received: (qmail 22771 invoked by alias); 22 Jun 2017 10:02:09 -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 22753 invoked by uid 89); 22 Jun 2017 10:02:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MEDICAL_SUBJECT, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*o:Group, Hx-languages-length:2464, numbered X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 10:02:06 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 81D4E20B18; Thu, 22 Jun 2017 10:02:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81D4E20B18 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=aoliva@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 81D4E20B18 Received: from freie.home (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77EF360601; Thu, 22 Jun 2017 10:02:03 +0000 (UTC) Received: from livre (livre.home [172.31.160.2]) by freie.home (8.15.2/8.15.2) with ESMTP id v5MA0xXx017987; Thu, 22 Jun 2017 07:00:59 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: Re: i386/sse.md:round2 skips operands[2] -> -O0 warning References: Date: Thu, 22 Jun 2017 07:00:59 -0300 In-Reply-To: (Uros Bizjak's message of "Thu, 8 Jun 2017 21:31:14 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 [adding the list] On Jun 8, 2017, Uros Bizjak wrote: > On Thu, Jun 8, 2017 at 9:22 PM, Alexandre Oliva wrote: >> I was playing with bootstrap STAGE2_C{,XX}FLAGS='-O0 -fcompare-debug' to >> test some changes I'm working on, and -Werror in stage2 prevented >> compilation of one of the insn-*.c files. That's because round2 >> doesn't have an operand 2. The generated code for round2_sfix >> calls the corresponding gen_round2, and then something in there >> attempts to access the uninitialized operand, which the stage1 GCC warns >> about and errors out because of -Werror. >> >> I'll be glad to test and submit a patch for this, but I thought I'd ask >> whether you'd prefer to leave this alone, to have it fixed it with a >> minimal diff as below, or with a renumbering of all operands >=3 to >=2? > These operands are already pretty weirdly numbered, so the below looks > appropriate as well. > The proposed patch is OK. Thanks, I'm checking this in. Regstrapped on x86_64-linux-gnu. [i386] renumber operands to avoid gap i386's round2 had a gap at operand 2, and so gen_round2 attempted to read from the uninitialized operand. Building stage2 with -O0 errored out, though at higher optimization levels it compiled successfully. Fixed by renumbering the last operand into the gap. for gcc/ChangeLog * config/i386/sse.md (round2): Renumber operand into gap. --- gcc/config/i386/sse.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 29a039d..68c4bbe 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -15644,7 +15644,7 @@ (match_dup 3))) (set (match_operand:VF 0 "register_operand") (unspec:VF - [(match_dup 4) (match_dup 5)] + [(match_dup 4) (match_dup 2)] UNSPEC_ROUND))] "TARGET_ROUND && !flag_trapping_math" { @@ -15668,7 +15668,7 @@ emit_insn (gen_copysign3 (operands[3], vec_half, operands[1])); operands[4] = gen_reg_rtx (mode); - operands[5] = GEN_INT (ROUND_TRUNC); + operands[2] = GEN_INT (ROUND_TRUNC); }) (define_expand "round2_sfix"