From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by sourceware.org (Postfix) with ESMTPS id D77513858D28 for ; Tue, 27 Jun 2023 16:06:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D77513858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-40152377912so14740041cf.1 for ; Tue, 27 Jun 2023 09:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687881977; x=1690473977; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ZrrarJwRIPSZKo6QdmLeJazG7k8HQkdCnf3EqdP1S1Q=; b=N/X1sDSoWY/KJdgz05uN5x4udqikpFftwiGj5fQA0FaSDTa38AebDVzqnhpaLgCYnH zXkGpt2/FDt77ye8hI3JMie5kN1M91tbK9X9iqqhSlgmUD13vYeg2yPKs/hdDhK0D/gN cxrRkxaY5IC6l7qMjdeNqFlD8CuFBZvWjiDSHj9PCr7GQ2UxUekOBirCnTlG6SQHQ2Qk VyrDqmeIS7YKrDG+sDMB7KlUlkkeQ1/zCRI1w9lghBGVZOzUkejRK7agAFi126BDs5oE rFRMK4pQCM+nMFmscC2toWSERIKjg5PgIoBcS0q8HBATkfHzNZ6pG7M3tWqR/XU48VNa Tviw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687881977; x=1690473977; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZrrarJwRIPSZKo6QdmLeJazG7k8HQkdCnf3EqdP1S1Q=; b=bCljBaEgbfQ/pWXbgFVnAxrdBiF5BEUNRXdUWHJ2aVn6m+tMcB0e0EYcN7EW8ueiEz 2xzVaOai4jp0GZjh6M2CiCuxsv30N5Hynw2TRuZqf90pjUBMcu74Lb6XwJR63eBoZUZu RK6rihrTZWkFXW5QhdMrmqWxNuZ+S51SLwL1hISOLslCzvb1IQW6bdhbu4YDZQsXsmlo I+L1oHMj9YzcGKOuUCOyJs5Po/Q90Ixrv9qy3VJeMGO+SAFSukDkXi8dOj84MUl8TNai roKEsI7ZtWR/Ha9ZVMUoAc5+J7pv7cMv1ICvAPM9ioQWQTuUSEK5FK2H5dsvvOig0LEv sR8A== X-Gm-Message-State: AC+VfDzmXgRW46tNKxq/WRjDG7gly2kFkXserI4CEQnELjDMIBMvUDSB LWPcyJCa8rKJVulsXndZWE/DgW8c3WzKZsL39xkLPVBjdVY= X-Google-Smtp-Source: ACHHUZ5GFi1EXlNpPkWCn5JmCsibmyNoFb6m46gzRUO9Yusi2H1aDLKHnha7wK7iRqbhuRi2Ir94L4PaFTnwYlRhlQ0= X-Received: by 2002:a05:622a:1214:b0:401:e2b1:d28d with SMTP id y20-20020a05622a121400b00401e2b1d28dmr4166171qtx.20.1687881976851; Tue, 27 Jun 2023 09:06:16 -0700 (PDT) MIME-Version: 1.0 From: Julian Waters Date: Wed, 28 Jun 2023 00:05:40 +0800 Message-ID: Subject: [PATCH] Basic asm blocks should always be volatile To: gcc-patches@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000a7324b05ff1ea566" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,HTML_OBFUSCATE_05_10,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: --000000000000a7324b05ff1ea566 Content-Type: text/plain; charset="UTF-8" gcc's documentatation mentions that all basic asm blocks are always volatile, yet the parser fails to account for this by only ever setting volatile_p to true if the volatile qualifier is found. This patch fixes this by adding a special case check for extended_p before finish_asm_stmt is called >From 3094be39e3e65a6a638f05fafd858b89fefde6b5 Mon Sep 17 00:00:00 2001 From: TheShermanTanker Date: Tue, 27 Jun 2023 23:56:38 +0800 Subject: [PATCH] asm not using extended syntax should always be volatile --- gcc/cp/parser.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index a6341b9..ef3d06a 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -22355,6 +22355,9 @@ cp_parser_asm_definition (cp_parser* parser) /* Create the ASM_EXPR. */ if (parser->in_function_body) { + if (!extended_p) { + volatile_p = true; + } asm_stmt = finish_asm_stmt (asm_loc, volatile_p, string, outputs, inputs, clobbers, labels, inline_p); /* If the extended syntax was not used, mark the ASM_EXPR. */ -- 2.35.1.windows.2 --000000000000a7324b05ff1ea566--