From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id C06603858039 for ; Sat, 27 Feb 2021 09:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C06603858039 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-328-7hHzSQ0SN4W7ftB5OzKhXQ-1; Sat, 27 Feb 2021 04:46:21 -0500 X-MC-Unique: 7hHzSQ0SN4W7ftB5OzKhXQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E51228030B7 for ; Sat, 27 Feb 2021 09:46:19 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-197.ams2.redhat.com [10.36.112.197]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92A645D9CA for ; Sat, 27 Feb 2021 09:46:19 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 11R9kGHi447043 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Sat, 27 Feb 2021 10:46:16 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 11R9kGMx447042 for gcc-patches@gcc.gnu.org; Sat, 27 Feb 2021 10:46:16 +0100 Date: Sat, 27 Feb 2021 10:46:15 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] gcse, ipa-devirt: Use %wd/%wu instead of HOST_WIDE_INT_PRINT* in diagnostics [PR99288] Message-ID: <20210227094615.GC4020736@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Feb 2021 09:46:25 -0000 Hi! HOST_WIDE_INT_PRINT* in the string literals of warning/error/inform etc. make those messages non-translatable, and we have a perfectly fine alternative when not using system *printf - %w{d,u}. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2021-02-27 Jakub Jelinek PR other/99288 * gcse.c (gcse_or_cprop_is_too_expensive): Use %wu instead of HOST_WIDE_INT_PRINT_UNSIGNED in warning format string. * ipa-devirt.c (ipa_odr_read_section): Use %wd instead of HOST_WIDE_INT_PRINT_DEC in inform format string. Fix comment typos. --- gcc/gcse.c.jj 2021-01-29 15:18:07.997293117 +0100 +++ gcc/gcse.c 2021-02-26 17:03:23.174388798 +0100 @@ -4011,8 +4011,7 @@ gcse_or_cprop_is_too_expensive (const ch { warning (OPT_Wdisabled_optimization, "%s: %d basic blocks and %d registers; " - "increase %<--param max-gcse-memory%> above " - HOST_WIDE_INT_PRINT_UNSIGNED, + "increase %<--param max-gcse-memory%> above %wu", pass, n_basic_blocks_for_fn (cfun), max_reg_num (), memory_request / 1024); --- gcc/ipa-devirt.c.jj 2021-01-04 10:25:38.196241037 +0100 +++ gcc/ipa-devirt.c 2021-02-26 17:05:11.904182848 +0100 @@ -4261,13 +4261,12 @@ ipa_odr_read_section (struct lto_file_de " in another translation unit", this_enum.vals[j].name, warn_name); /* FIXME: In case there is easy way to print wide_ints, - perhaps we could do it here instead of overlfow checpl. */ + perhaps we could do it here instead of overflow check. */ else if (wi::fits_shwi_p (this_enum.vals[j].val) && wi::fits_shwi_p (warn_value)) inform (this_enum.vals[j].locus, - "name %qs is defined to " HOST_WIDE_INT_PRINT_DEC - " while another translation unit defines " - "it as " HOST_WIDE_INT_PRINT_DEC, + "name %qs is defined to %wd while another " + "translation unit defines it as %wd", warn_name, this_enum.vals[j].val.to_shwi (), warn_value.to_shwi ()); else Jakub