From patchwork Fri Mar 22 09:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1914775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AaVdbkZe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V1Gmg1rTTz1yWp for ; Fri, 22 Mar 2024 20:12:03 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E7F6385841A for ; Fri, 22 Mar 2024 09:12:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8C0D43858D28 for ; Fri, 22 Mar 2024 09:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C0D43858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8C0D43858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711098702; cv=none; b=LfsBnpBJgyiJ4aKa7q+QxnqYOBgDKY8dHN92sSbKTNDEOVrI6Qv/MlHFzq/zr4jf8w0xnxl/ubYtEJBdekp+U3t0yxfwFztrpUfv4WH+UxLd1Wkw0pUkzfIznAm9++dmwTK/ee2eEKUi/ZVauuFcDKY3h2WwS4vYKYCFTk3oOw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711098702; c=relaxed/simple; bh=3CeZP2tD/65qcrQBJBf/DcVoCzdzNEUqo/BYluZFVOY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=DzB/1NmgjMiNHYDmlwe5OiqfmQSA6ckMHfzLqm/EcUytWf8Dx5m3ADILlHegbt+LYeBZ+1YEsqA51E48jkYWcF+MMARZd+HktFWRPF0ks1xUoCA5vBt/kY65EUETUJV4gT7s+JRcfUtJJQNMvsyDvL1lAZag1bFyF5HRzS4P7ZE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711098700; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=9rThgFznWgRfULY7x9skDxpdETJ0aSm69QbWr9ZVzaE=; b=AaVdbkZeWGMILgSVauN6J06baxm5AQm7qilK1mT9maPZBUcj6DE4p1GNjPn5fHTYr349Xn QKOQZHhKkIh3rHRy19kDMaeLAVeV51ctp/DoBWirP2p4uXy+eJra3XCDkdOB8mzJaeIby+ DcLlxX0ByuyOGkOB5TxSbwkl4fyH9gE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-442-uM3RPkuVN6qgNssNtqBzhw-1; Fri, 22 Mar 2024 05:11:38 -0400 X-MC-Unique: uM3RPkuVN6qgNssNtqBzhw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6C833C02B82 for ; Fri, 22 Mar 2024 09:11:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A3A21074E; Fri, 22 Mar 2024 09:11:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 42M9BVWd1476121 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 22 Mar 2024 10:11:31 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 42M9BU6D1476120; Fri, 22 Mar 2024 10:11:30 +0100 Date: Fri, 22 Mar 2024 10:11:30 +0100 From: Jakub Jelinek To: "Joseph S. Myers" , Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux: PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15) FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line 37) PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 43 (test for errors, line 41) PASS: c-c++-common/gomp/depobj-3.c -std=c++17 (test for warnings, line 45) FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 (test for excess errors) Excess errors: /home/jakub/src/gcc/gcc/testsuite/c-c++-common/gomp/depobj-3.c:37:38: warning: the 'destroy' expression ''excess_precision_expr' not supported by dump_expr' should be the same as the 'depobj' argument 'obj' [-Wopenmp] The following patch replaces that 'excess_precision_expr' not supported by dump_expr with (float)(((long double)a) + (long double)5) Still ugly and doesn't actually fix the FAIL (will deal with that incrementally), but at least valid C/C++ and shows the excess precision handling in action. Ok for trunk if this passes bootstrap/regtest? 2024-03-22 Jakub Jelinek gcc/c/ * c-pretty-print.cc (pp_c_cast_expression, c_pretty_printer::expression): Handle EXCESS_PRECISION_EXPR like NOP_EXPR. gcc/cp/ * error.cc (dump_expr): Handle EXCESS_PRECISION_EXPR like NOP_EXPR. Jakub --- gcc/c-family/c-pretty-print.cc.jj 2024-01-12 10:07:57.744858004 +0100 +++ gcc/c-family/c-pretty-print.cc 2024-03-22 09:58:56.640001991 +0100 @@ -2327,6 +2327,7 @@ pp_c_cast_expression (c_pretty_printer * case FIX_TRUNC_EXPR: CASE_CONVERT: case VIEW_CONVERT_EXPR: + case EXCESS_PRECISION_EXPR: if (!location_wrapper_p (e)) pp_c_type_cast (pp, TREE_TYPE (e)); pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); @@ -2753,6 +2754,7 @@ c_pretty_printer::expression (tree e) case FIX_TRUNC_EXPR: CASE_CONVERT: case VIEW_CONVERT_EXPR: + case EXCESS_PRECISION_EXPR: pp_c_cast_expression (this, e); break; --- gcc/cp/error.cc.jj 2024-01-20 12:32:34.157939870 +0100 +++ gcc/cp/error.cc 2024-03-22 10:00:38.259610171 +0100 @@ -2662,6 +2662,7 @@ dump_expr (cxx_pretty_printer *pp, tree CASE_CONVERT: case IMPLICIT_CONV_EXPR: case VIEW_CONVERT_EXPR: + case EXCESS_PRECISION_EXPR: { tree op = TREE_OPERAND (t, 0);