From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by sourceware.org (Postfix) with ESMTPS id D2FFC3858D37 for ; Sat, 22 Aug 2020 17:11:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D2FFC3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f66.google.com with SMTP id g75so4573260wme.4 for ; Sat, 22 Aug 2020 10:11:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CmiKW7f51sdWy0NpZB8ftkF4LrrEIRMNApdnP4ahQkI=; b=ZjM/B0QfuTsyMsATXoU43lskg1iI1I/+V5R5tpnBUWTH/miAFrpqoZ8ZAy/dAEzYtU Utp8C02l2WiDDuazUAyS8B8HxWEWrgrfPe/R1wjduLmxrmlG08HCdPvLJTpXhNtd+NEQ 7hjmDTLNJSm2y/S8eariaIxC7foak5rtcGtR6mLOUtHoL4MYYdoPvJgD8L0gUAw1R0q2 NgTIc5L1s5HSPXSuDn1UJPh8xGMR4L2WBEHitmAbqUvNk+Plp86w9wsBba/i+QJ8DoLf 2xhLLL7JaVs1HLYMk3O1nZ5DSyJ1jkCR7zBORXZls+v8rU1GipFa2zf3vHYbphfBTI1/ 1AzA== X-Gm-Message-State: AOAM533KeuGu8QPS/jXCkD4AdfdXjuxMRszNEroBPC6VS9mGkmcCipYS HxIJr/hzf7I99h4blCqidyxV531larSR+Q== X-Google-Smtp-Source: ABdhPJy19Fz3/j0tJcCXVn4Dp+01TjcalCIaSzz4PlUpP4Sj6Bpj10XS/qK/LF51QRv13SbJ86tWcw== X-Received: by 2002:a05:600c:2281:: with SMTP id 1mr4355422wmf.84.1598116311175; Sat, 22 Aug 2020 10:11:51 -0700 (PDT) Received: from ?IPv6:2001:8a0:f905:5600:56ee:75ff:fe8d:232b? ([2001:8a0:f905:5600:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id d14sm12285996wre.44.2020.08.22.10.11.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Aug 2020 10:11:50 -0700 (PDT) Subject: [PATCH] Remove stale "register" bits from gdb.cp/misc.cc (Re: [PATCH] Move "register" test out of classes.exp to a separate testcase) From: Pedro Alves To: Simon Marchi , Mark Wielaard , gdb-patches@sourceware.org References: <20200822121935.6086-1-mark@klomp.org> <4a45bd6b-2d4c-10c9-03af-2a8be5e37783@palves.net> Message-ID: <9ed2dbe1-9f38-7035-9cbc-457d2f0c7889@palves.net> Date: Sat, 22 Aug 2020 18:11:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <4a45bd6b-2d4c-10c9-03af-2a8be5e37783@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Aug 2020 17:11:54 -0000 On 8/22/20 6:08 PM, Pedro Alves wrote: > See patch below. I propose we push this in instead. And then this on top. >From 4b75bb6d0a2d171f3a1531de2e820c7e32c2ca72 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sat, 22 Aug 2020 18:00:55 +0100 Subject: [PATCH] Remove stale "register" bits from gdb.cp/misc.cc gdb.cp/misc.cc seems to have been originally copied from gdb.cp/classes.cc. The testcases that use it, misc.exp and inherit.exp don't reference the "register" bits anywhere. Remove them, since they trigger warnings with newer GCCs, given "register" is being removed in C++17. gdb/testsuite/ChangeLog: * gdb.cp/inherit.exp: No longer pass -Wno-deprecated-register. * gdb.cp/misc.exp: No longer pass -Wno-deprecated-register. * gdb.cp/misc.cc (class small, small::method, marker_reg1) (register_class): Delete. (main): Don't call register_class. --- gdb/testsuite/gdb.cp/inherit.exp | 3 +-- gdb/testsuite/gdb.cp/misc.cc | 37 ------------------------------------- gdb/testsuite/gdb.cp/misc.exp | 3 +-- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/gdb/testsuite/gdb.cp/inherit.exp b/gdb/testsuite/gdb.cp/inherit.exp index 2d4635c96ad..e9549d3ebe0 100644 --- a/gdb/testsuite/gdb.cp/inherit.exp +++ b/gdb/testsuite/gdb.cp/inherit.exp @@ -26,8 +26,7 @@ load_lib "cp-support.exp" standard_testfile misc.cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ - {debug c++ additional_flags=-Wno-deprecated-register}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } diff --git a/gdb/testsuite/gdb.cp/misc.cc b/gdb/testsuite/gdb.cp/misc.cc index 41fb9d2f2db..24d40c461ae 100644 --- a/gdb/testsuite/gdb.cp/misc.cc +++ b/gdb/testsuite/gdb.cp/misc.cc @@ -511,42 +511,6 @@ typedef struct { } tagless_struct; tagless_struct v_tagless; -/* Try to get the compiler to allocate a class in a register. */ -class small { - public: - int x; - int method (); -}; - -int -small::method () -{ - return x + 5; -} - -void marker_reg1 () {} - -int -register_class () -{ - /* We don't call any methods for v, so gcc version cygnus-2.3.3-930220 - might put this variable in a register. This is a lose, though, because - it means that GDB can't call any methods for that variable. */ - register small v; - - int i; - - /* Perform a computation sufficiently complicated that optimizing compilers - won't optimized out the variable. If some compiler constant-folds this - whole loop, maybe using a parameter to this function here would help. */ - v.x = 0; - for (i = 0; i < 13; ++i) - v.x += i; - --v.x; /* v.x is now 77 */ - marker_reg1 (); - return v.x + 5; -} - void dummy() { v_bool = true; @@ -574,7 +538,6 @@ main() inheritance1 (); inheritance3 (); enums1 (); - register_class (); /* FIXME: pmi gets optimized out. Need to do some more computation with it or something. (No one notices, because the test is xfail'd anyway, diff --git a/gdb/testsuite/gdb.cp/misc.exp b/gdb/testsuite/gdb.cp/misc.exp index 61034bf8088..cd6f0f7070a 100644 --- a/gdb/testsuite/gdb.cp/misc.exp +++ b/gdb/testsuite/gdb.cp/misc.exp @@ -19,8 +19,7 @@ if { [skip_cplus_tests] } { continue } standard_testfile .cc -if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ - {debug c++ additional_flags=-Wno-deprecated-register}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return -1 } base-commit: 33bf4c5c10d246543c7a9a8ba4bbbe173d7f3367 prerequisite-patch-id: 3b9e228c420206fff81de20b3f1eb0e11f6a210b -- 2.14.5