From patchwork Thu Mar 7 19:53:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1053241 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-497523-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="JpfK4vBm"; 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 44FhCZ3Mq6z9sBp for ; Fri, 8 Mar 2019 06:53:58 +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=CHIga0wi2LvWhKaeHlxb8cROd2OSW 2SxGFSgIeXI9jYN9aOjAhbu7zG2GPubFnAJn7JkIyZn8brQLlvCuLZz692JyLnak SQ+WwMeNXdJGNrq0e4ILhOJy1Oj88jDigLqSIjybqckiV9M5QoL4tC3ryG4jkWqo ytjXMOf9Pnb5hk= 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=M7vKiI4CqbqHR0xfNwgxJFoZE+g=; b=Jpf K4vBmqeekkv/+6f7YVFuYgbKEhlESg5QzV91GgG8SUX0Wzlr9qcTAE4g2+lNkRMP vcsfk5NlIVeR7Wwjy8COLkpKFKQzYlHFG5+tYE6toAxVwKZDOXl5knHo5Zr/xguF sNEPYaKvm3SB6iixNIGuCItXkgwtDv/kBt6p1ilE= Received: (qmail 74955 invoked by alias); 7 Mar 2019 19:53:51 -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 74622 invoked by uid 89); 7 Mar 2019 19:53:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=msgid, s390, HX-Languages-Length:2060, tree_to_uhwi 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, 07 Mar 2019 19:53:49 +0000 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 mx1.redhat.com (Postfix) with ESMTPS id 174C4C4ED3; Thu, 7 Mar 2019 19:53:48 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-64.ams2.redhat.com [10.36.117.64]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2F2E5C545; Thu, 7 Mar 2019 19:53:47 +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 x27Jrifi029722; Thu, 7 Mar 2019 20:53:44 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x27JrgUl029721; Thu, 7 Mar 2019 20:53:42 +0100 Date: Thu, 7 Mar 2019 20:53:41 +0100 From: Jakub Jelinek To: Andreas Krebbel Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix a config/s390/s390.c diagnostics bug (PR target/79846) Message-ID: <20190307195341.GI7611@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi! As mentioned in the PR, using HOST_WIDE_INT_PRINT_* in the middle of translatable message is highly undesirable, we end up with: #: config/s390/s390.c:737 #, gcc-internal-format msgid "constant argument %d for builtin %qF is out of range (0.." msgstr "" #: config/s390/s390.c:754 #, gcc-internal-format msgid "constant argument %d for builtin %qF is out of range (" msgstr "" in gcc.pot that way and nothing is translated. The following patch should fix that by using proper %wu/%wd. Tested by building a cross-compiler to s390x-linux, ok for trunk? 2019-03-07 Jakub Jelinek PR target/79846 * config/s390/s390.c (s390_const_operand_ok): Use %wu instead of HOST_WIDE_INT_PRINT_UNSIGNED and %wd instead of HOST_WIDE_INT_PRINT_DEC. Formatting fixes. Jakub --- gcc/config/s390/s390.c.jj 2019-02-18 20:48:32.873728534 +0100 +++ gcc/config/s390/s390.c 2019-03-07 18:13:44.757949114 +0100 @@ -734,10 +734,9 @@ s390_const_operand_ok (tree arg, int arg if (!tree_fits_uhwi_p (arg) || tree_to_uhwi (arg) > (HOST_WIDE_INT_1U << bitwidth) - 1) { - error("constant argument %d for builtin %qF is out of range (0.." - HOST_WIDE_INT_PRINT_UNSIGNED ")", - argnum, decl, - (HOST_WIDE_INT_1U << bitwidth) - 1); + error ("constant argument %d for builtin %qF is out of range " + "(0..%wu)", argnum, decl, + (HOST_WIDE_INT_1U << bitwidth) - 1); return false; } } @@ -751,12 +750,10 @@ s390_const_operand_ok (tree arg, int arg || tree_to_shwi (arg) < -(HOST_WIDE_INT_1 << (bitwidth - 1)) || tree_to_shwi (arg) > ((HOST_WIDE_INT_1 << (bitwidth - 1)) - 1)) { - error("constant argument %d for builtin %qF is out of range (" - HOST_WIDE_INT_PRINT_DEC ".." - HOST_WIDE_INT_PRINT_DEC ")", - argnum, decl, - -(HOST_WIDE_INT_1 << (bitwidth - 1)), - (HOST_WIDE_INT_1 << (bitwidth - 1)) - 1); + error ("constant argument %d for builtin %qF is out of range " + "(%wd..%wd)", argnum, decl, + -(HOST_WIDE_INT_1 << (bitwidth - 1)), + (HOST_WIDE_INT_1 << (bitwidth - 1)) - 1); return false; } }