From patchwork Fri Jan 12 20:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 860185 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-471050-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mmCIDfp0"; 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 3zJDjc2gvrz9s75 for ; Sat, 13 Jan 2018 07:24:03 +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:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=ffM4S92cXlcBSEau8GeiWbrKFBhZo KpsNVC0GQ1Cv9Uey6We4Urtrj6mLtjq++oh9Rv3t6HiDyL7H20PbScSjiR4QPM6K Hf1mu+G4f2kVcXNZX5he8vo/dgG028+nmOAKq1xsPKuqWzc0Id+708owuXWPJTC7 5tLlUZYDqdoMZE= 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:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=ccflbOzP9/Ped+3rKplDpEN2otM=; b=mmC IDfp0+/mpieMHr7Ve3UD94MxJ/SxVg6DUnyQ/uNrr5tGKQE+ZN8cNnJ3slsamypQ Rq6yNgJLCfGMEWplzrv+JAi0QbPHZeHrJgG/LB06M0YiNgWlXBJWFdj2sRc6Wjjw XfNXQ53OkEyp1VkJ1up/0TkPfXvzVm18NwaIHVYU= Received: (qmail 122988 invoked by alias); 12 Jan 2018 20:23:55 -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 122974 invoked by uid 89); 12 Jan 2018 20:23:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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; Fri, 12 Jan 2018 20:23:54 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 30B617C840; Fri, 12 Jan 2018 20:23:53 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-22.ams2.redhat.com [10.36.117.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9B5D60C4D; Fri, 12 Jan 2018 20:23:52 +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 w0CKNoDh027933; Fri, 12 Jan 2018 21:23:50 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w0CKNnZN027879; Fri, 12 Jan 2018 21:23:49 +0100 Date: Fri, 12 Jan 2018 21:23:49 +0100 From: Jakub Jelinek To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, David Malcolm Subject: [PATCH] Fix altivec-cell-2.C test regression (PR c++/83778) Message-ID: <20180112202349.GJ2063@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes Hi! After the addition of location wrappers the targetm.resolve_overloaded_builtin target hook is called with parameters that may have those location wrappers in it. Seems generic code has been changed to fold_for_warn fold it away when looking for something that should be e.g. INTEGER_CST. Fixed thusly, bootstrapped/regtested on powerpc64le-linux, ok for trunk? 2018-01-12 Jakub Jelinek PR c++/83778 * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Call fold_for_warn before checking if arg2 is INTEGER_CST. Jakub --- gcc/config/rs6000/rs6000-c.c.jj 2018-01-12 11:36:02.016223839 +0100 +++ gcc/config/rs6000/rs6000-c.c 2018-01-12 17:45:13.294256181 +0100 @@ -6496,6 +6496,8 @@ altivec_resolve_overloaded_builtin (loca tree call = NULL_TREE; int nunits = GET_MODE_NUNITS (mode); + arg2 = fold_for_warn (arg2); + /* If the second argument is an integer constant, if the value is in the expected range, generate the built-in code if we can. We need 64-bit and direct move to extract the small integer vectors. */ @@ -6640,7 +6642,7 @@ altivec_resolve_overloaded_builtin (loca arg0 = (*arglist)[0]; arg1 = (*arglist)[1]; arg1_type = TREE_TYPE (arg1); - arg2 = (*arglist)[2]; + arg2 = fold_for_warn ((*arglist)[2]); if (TREE_CODE (arg1_type) != VECTOR_TYPE) goto bad;