From patchwork Sat Oct 2 02:33:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 45738 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1CCB3857436 for ; Sat, 2 Oct 2021 02:34:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1CCB3857436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633142057; bh=Ze7waRsLzQCTteaXhGBD/qriVzy7eM4IhywplFyLBw8=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Sa51C/+BLRtC7gjhG1RYJGtEFEM05fIfFNZ9w8QP8S49R/ht/7KCfP3mFivrsiTB1 S76LV45AfKoZDVM0BhwbxWZLsAv2/TOZB8xLJTQgva21xanIPnBIUujG6wHKAyKxke aQRUNZ6EJaUXSz9q24zzwMOrpL1TQ49wCuQOc6bM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 03AFE3858438 for ; Sat, 2 Oct 2021 02:33:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 03AFE3858438 Received: by mail-pg1-x529.google.com with SMTP id a73so8137548pge.0 for ; Fri, 01 Oct 2021 19:33:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ze7waRsLzQCTteaXhGBD/qriVzy7eM4IhywplFyLBw8=; b=FS8/GhjnsRkO6f3RUqON7l2mjGzGaayzFcGub2VtVKatkbgHZicsJmkGxKxgUXhCJU d6L3GIRM8FeX57fxbyaMqj0jR80590kpyRqICc7aLXn0TG8ebbAVs8M2wfgtj0Gh33dR 86CemJF4qGeTQtZf+osCaqJbiDOkp/RQr2u3pe1D40bmWTHgrOLlRuob8X8/aKYTYoLm BF7uIJB42d5k5ie6jWkdHD4SWBCD7n5t6GEFBEtJJUNzabe10qyKDLYUDA/WMqLS4/Ek eNAjn6jG8/Xbr78qdhAO922obCkQK4vNvztHd8mynXyaPHbNhedQvGqDOsbDVSZH56Ur 4vEw== X-Gm-Message-State: AOAM531POGwmlIw4SCzX/O4/m9t8JFvWwZce+yHEgNreHWGmWPk3WZMA AzVKIhgcjOh7+eDd8uYHiFSp/9sg89WBxzZRzWs= X-Google-Smtp-Source: ABdhPJxMU/w5Qs2Ufue1BxlZrLkuVkzHQn61DOVzWbJhC+J7Vv9T6Ck2fjElAJHODJWnHcE/L94AgEvxp5leqZc9uK4= X-Received: by 2002:a63:1656:: with SMTP id 22mr1158981pgw.20.1633142026814; Fri, 01 Oct 2021 19:33:46 -0700 (PDT) MIME-Version: 1.0 References: <20210804222612.1463583-1-dmalcolm@redhat.com> In-Reply-To: <20210804222612.1463583-1-dmalcolm@redhat.com> Date: Fri, 1 Oct 2021 19:33:10 -0700 Message-ID: Subject: [PATCH] Use unsigned long long in asm-x86-linux-rdmsr.c To: David Malcolm X-Spam-Status: No, score=-3030.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: GCC Patches Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" On Wed, Aug 4, 2021 at 3:26 PM David Malcolm via Gcc-patches wrote: > > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. > Pushed to trunk as r12-2749-gded2c2c068f6f2825474758cb03a05070a5837e8. > > gcc/ChangeLog: > PR analyzer/101570 > * Makefile.in (ANALYZER_OBJS): Add analyzer/region-model-asm.o. > > gcc/analyzer/ChangeLog: > PR analyzer/101570 > * analyzer.cc (maybe_reconstruct_from_def_stmt): Add GIMPLE_ASM > case. > * analyzer.h (class asm_output_svalue): New forward decl. > (class reachable_regions): New forward decl. > * complexity.cc (complexity::from_vec_svalue): New. > * complexity.h (complexity::from_vec_svalue): New decl. > * engine.cc (feasibility_state::maybe_update_for_edge): Handle > asm stmts by calling on_asm_stmt. > * region-model-asm.cc: New file. > * region-model-manager.cc > (region_model_manager::maybe_fold_asm_output_svalue): New. > (region_model_manager::get_or_create_asm_output_svalue): New. > (region_model_manager::log_stats): Log m_asm_output_values_map. > * region-model.cc (region_model::on_stmt_pre): Handle GIMPLE_ASM. > * region-model.h (visitor::visit_asm_output_svalue): New. > (region_model_manager::get_or_create_asm_output_svalue): New decl. > (region_model_manager::maybe_fold_asm_output_svalue): New decl. > (region_model_manager::asm_output_values_map_t): New typedef. > (region_model_manager::m_asm_output_values_map): New field. > (region_model::on_asm_stmt): New. > * store.cc (binding_cluster::on_asm): New. > * store.h (binding_cluster::on_asm): New decl. > * svalue.cc (svalue::cmp_ptr): Handle SK_ASM_OUTPUT. > (asm_output_svalue::dump_to_pp): New. > (asm_output_svalue::dump_input): New. > (asm_output_svalue::input_idx_to_asm_idx): New. > (asm_output_svalue::accept): New. > * svalue.h (enum svalue_kind): Add SK_ASM_OUTPUT. > (svalue::dyn_cast_asm_output_svalue): New. > (class asm_output_svalue): New. > (is_a_helper ::test): New. > (struct default_hash_traits): New. > > gcc/testsuite/ChangeLog: > PR analyzer/101570 > * gcc.dg/analyzer/asm-x86-1.c: New test. > * gcc.dg/analyzer/asm-x86-lp64-1.c: New test. > * gcc.dg/analyzer/asm-x86-lp64-2.c: New test. > * gcc.dg/analyzer/pr101570.c: New test. > * gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c: > New test. > * gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c: New > test. > * gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c: New > test. > * gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c: New test. > * gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c: New > test. > * gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c: New test. > * gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c: > New test. > * gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c: > New test. > > Signed-off-by: David Malcolm > --- > gcc/Makefile.in | 1 + > gcc/analyzer/analyzer.cc | 1 + > gcc/analyzer/analyzer.h | 2 + > gcc/analyzer/complexity.cc | 16 + > gcc/analyzer/complexity.h | 1 + > gcc/analyzer/engine.cc | 2 + > gcc/analyzer/region-model-asm.cc | 303 +++++++++++++++++ > gcc/analyzer/region-model-manager.cc | 48 +++ > gcc/analyzer/region-model.cc | 5 +- > gcc/analyzer/region-model.h | 13 + > gcc/analyzer/store.cc | 17 + > gcc/analyzer/store.h | 1 + > gcc/analyzer/svalue.cc | 89 +++++ > gcc/analyzer/svalue.h | 145 +++++++- > gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c | 69 ++++ > .../gcc.dg/analyzer/asm-x86-lp64-1.c | 131 +++++++ > .../gcc.dg/analyzer/asm-x86-lp64-2.c | 34 ++ > gcc/testsuite/gcc.dg/analyzer/pr101570.c | 5 + > .../asm-x86-linux-array_index_mask_nospec.c | 74 ++++ > .../torture/asm-x86-linux-cpuid-paravirt-1.c | 81 +++++ > .../torture/asm-x86-linux-cpuid-paravirt-2.c | 135 ++++++++ > .../analyzer/torture/asm-x86-linux-cpuid.c | 46 +++ > .../torture/asm-x86-linux-rdmsr-paravirt.c | 210 ++++++++++++ > .../analyzer/torture/asm-x86-linux-rdmsr.c | 33 ++ > .../asm-x86-linux-wfx_get_ps_timeout-full.c | 319 ++++++++++++++++++ > ...asm-x86-linux-wfx_get_ps_timeout-reduced.c | 77 +++++ > 26 files changed, 1855 insertions(+), 3 deletions(-) > create mode 100644 gcc/analyzer/region-model-asm.cc > create mode 100644 gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/pr101570.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c > create mode 100644 gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c I am checking in this. Use unsigned long long for 64-bit integer since unsigned long is 32 bits for x32. * gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c (DECLARE_ARGS): Use unsigned long long for x86-64. --- gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c index 0a1c48f5800..69d0165aefe 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c @@ -6,7 +6,7 @@ /* Adapted from Linux: arch/x86/include/asm/msr.h (GPL-2.0) */ #ifdef __x86_64__ -#define DECLARE_ARGS(val, low, high) unsigned long low, high +#define DECLARE_ARGS(val, low, high) unsigned long long low, high #define EAX_EDX_VAL(val, low, high) ((low) | (high) << 32) #define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high) #else