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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D92A83858403 for ; Fri, 12 Apr 2024 07:57:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D92A83858403 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 D92A83858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712908681; cv=none; b=vpVCg/GMIHgrF1acIXW9PNgq2/B4JfKHJfABOEr2kFZTuo5ostzQJNrbdS9AlCAS2KXcvmtPK2BEzBSCp7M2yJI38DoTnMksIKWUsOGZWnswRdGXog3wRRx9tsvfySisRECIQQx875F8hfoIg0H+uN68O/wsw9hNkDWB60PeY4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712908681; c=relaxed/simple; bh=k7Ct9ivdEH3uL2tlIoowNfnq/rsrJybDMCQZR4FIw5o=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Lhm0hW9nj1jBV+uVyLJjxlFtv3IKjRx8x3jdr5SoCGeIcdMqyrwyowiCt8gn4i1RR9xI1tR0hB3aH1Gem582U/NbAyZ0eSa4ysEiUru4RxZZNG6MNecRZY6t0wUmSOjxKBCP3RBJSNtuHvEK6rTXR6YrUBq8T5FsV5EMDqAO3fU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712908679; 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=Weh0//klI/zDLpG368PNCs892db/sj8rEUfrFJGWFH8=; b=PPcCxEoG/jvzbrtdTzssjz8peu+17l3TfgbMtA8/oqElxeXv6WTFi1aIAJATU31b62MspK XNDYY453Qrdvqk7PXgvZ/7dHhu7mSbdn1KqdLV8qOqG9rzN0lg8+nJwLf15zHXRIsotCnR SSZ0RxaVEfxiloj22eSfse2tfDh9ZkU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-M5CrTniLPnGRfWPdkYoXgw-1; Fri, 12 Apr 2024 03:57:56 -0400 X-MC-Unique: M5CrTniLPnGRfWPdkYoXgw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 ADE3D805B9D; Fri, 12 Apr 2024 07:57:55 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 739EF492BC7; Fri, 12 Apr 2024 07:57:55 +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 43C7vnOe1725355 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 12 Apr 2024 09:57:49 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 43C7vniN1725354; Fri, 12 Apr 2024 09:57:49 +0200 Date: Fri, 12 Apr 2024 09:57:49 +0200 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-cfg: Make the verifier returns_twice message translatable Message-ID: Reply-To: Jakub Jelinek MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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=-4.5 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 List-Id: Hi! While translation of the verifier messages is questionable, that case is something that ideally should never happen except to gcc developers and so pressumably English should be fine, we use error etc. APIs and those imply translatations and some translators translate it. The following patch adjusts the code such that we don't emit appel returns_twice est not first dans le bloc de base 33 in French (i.e. 2 English word in the middle of a French message). Similarly Swedish or Ukrainian. Note, the German translator did differentiate between these verifier messages vs. normal user facing and translated it to: "Interner Fehler: returns_twice call is %s in basic block %d" so just a German prefix before English message. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2024-04-12 Jakub Jelinek * tree-cfg.cc (gimple_verify_flow_info): Make the misplaced returns_twice diagnostics translatable. --- gcc/tree-cfg.cc.jj 2024-04-10 10:19:04.237471564 +0200 +++ gcc/tree-cfg.cc 2024-04-11 17:18:57.962672110 +0200 @@ -5818,7 +5818,7 @@ gimple_verify_flow_info (void) if (gimple_code (stmt) == GIMPLE_CALL && gimple_call_flags (stmt) & ECF_RETURNS_TWICE) { - const char *misplaced = NULL; + bool misplaced = false; /* TM is an exception: it points abnormal edges just after the call that starts a transaction, i.e. it must end the BB. */ if (gimple_call_builtin_p (stmt, BUILT_IN_TM_START)) @@ -5826,18 +5826,23 @@ gimple_verify_flow_info (void) if (single_succ_p (bb) && bb_has_abnormal_pred (single_succ (bb)) && !gsi_one_nondebug_before_end_p (gsi)) - misplaced = "not last"; + { + error ("returns_twice call is not last in basic block " + "%d", bb->index); + misplaced = true; + } } else { - if (seen_nondebug_stmt - && bb_has_abnormal_pred (bb)) - misplaced = "not first"; + if (seen_nondebug_stmt && bb_has_abnormal_pred (bb)) + { + error ("returns_twice call is not first in basic block " + "%d", bb->index); + misplaced = true; + } } if (misplaced) { - error ("returns_twice call is %s in basic block %d", - misplaced, bb->index); print_gimple_stmt (stderr, stmt, 0, TDF_SLIM); err = true; } Jakub