From patchwork Mon Nov 11 20:09:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1193109 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512999-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kVVhMqEr"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Tvl9/byw"; 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 47Bhn95CMNz9s4Y for ; Tue, 12 Nov 2019 07:10:04 +1100 (AEDT) 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:reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=NXl5fnXrmBGXv0DL L5Ij8jwulJEuUai7vm/5zTJ9JqoWIJc+bNipnFwaR8VhRS8aiAHq4QR1S2ZkSTjy 4wWtS59JP9z3TQ34joaBH2CpNpDBalAyqDAwZuXQEUNE20LQ+oKFCNr0AAw0B1lS jtx+Wyc+Wh0oNnNVxqAnBttbNfs= 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:reply-to:mime-version:content-type :content-transfer-encoding; s=default; bh=VoGVm24vDdq76OeQNQjg4S zTsu0=; b=kVVhMqEr2akVXcXnzesElXUIvZj/SyxQz9JlCjoKMOM67GukwBgn5r F6cbKMF2sF1RoHLIQYmxR4AJsiffuezzGCm7j++vaJxg5XOiVWtX3JojixtSqOJr ePoczvnnLqX4CCQLsca6Q8J3fkuh7wVsUO1M+kKyhXxg9ALUakTN4= Received: (qmail 107601 invoked by alias); 11 Nov 2019 20:09:57 -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 107588 invoked by uid 89); 11 Nov 2019 20:09:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Nov 2019 20:09:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573502994; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dk98QH3+ekfRvYsoLfyHI8ERzPad0e8ZJ0FVkyu1s+Y=; b=Tvl9/byw74DOwrMmhnC2ikHkBkC44WZMW1i9hTHC1tEIf9OdSk5zWvyAsm0hv+IxLYh4Va jhGvkjuyGWDOMApunMgBgUbw6nLteAKwgLvUr2kjvmTeBNp/d4a8l2ZjLFgFzaTD3UWQqP 52M/XdLzreZJxyzEgfW883l7wDrFbX8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-dTwpy5fMNqqQMgC2LX2z3w-1; Mon, 11 Nov 2019 15:09:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7F6C0477 for ; Mon, 11 Nov 2019 20:09:52 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.36.118.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BD535C1D8 for ; Mon, 11 Nov 2019 20:09:51 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id xABK9nKu026590 for ; Mon, 11 Nov 2019 21:09:50 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id xABK9mbW026589 for gcc-patches@gcc.gnu.org; Mon, 11 Nov 2019 21:09:48 +0100 Date: Mon, 11 Nov 2019 21:09:48 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Unbreak powerpc* bootstrap (PR bootstrap/92433) Message-ID: <20191111200948.GZ4650@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 Content-Disposition: inline X-IsSubscribed: yes Hi! A recent unroller change results in the arg_types array initializing loop in altivec_build_resolved_builtin being completely unrolled. The callers ensure that for ALTIVEC_BUILTIN_VEC_VCMPGE_P all the 3 arguments are provided (i.e. n == 3), but the compiler doesn't know that and emits -Wmaybe-uninitialized warning. Fixed thusly, additionally simplified the code/made it more readable with std::swap. Bootstrapped/regtested on powerpc64le-linux, preapproved by Segher on IRC, committed to trunk. 2019-11-11 Jakub Jelinek PR bootstrap/92433 * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Guard ALTIVEC_BUILTIN_VEC_VCMPGE_P argument swapping with n == 3 check. Use std::swap. Jakub --- gcc/config/rs6000/rs6000-c.c.jj 2019-08-27 12:26:30.115019661 +0200 +++ gcc/config/rs6000/rs6000-c.c 2019-11-11 10:12:00.954282097 +0100 @@ -6076,14 +6076,14 @@ altivec_build_resolved_builtin (tree *ar condition (LT vs. EQ, which is recognizable by bit 1 of the first argument) is reversed. Patch the arguments here before building the resolved CALL_EXPR. */ - if (desc->code == ALTIVEC_BUILTIN_VEC_VCMPGE_P + if (n == 3 + && desc->code == ALTIVEC_BUILTIN_VEC_VCMPGE_P && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P && desc->overloaded_code != VSX_BUILTIN_XVCMPGEDP_P) { - tree t; - t = args[2], args[2] = args[1], args[1] = t; - t = arg_type[2], arg_type[2] = arg_type[1], arg_type[1] = t; - + std::swap (args[1], args[2]); + std::swap (arg_type[1], arg_type[2]); + args[0] = fold_build2 (BIT_XOR_EXPR, TREE_TYPE (args[0]), args[0], build_int_cst (NULL_TREE, 2)); }