From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23853 invoked by alias); 28 Apr 2016 14:03:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23794 invoked by uid 89); 28 Apr 2016 14:03:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=rationale, convinced, habit X-HELO: mail-oi0-f49.google.com Received: from mail-oi0-f49.google.com (HELO mail-oi0-f49.google.com) (209.85.218.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 28 Apr 2016 14:03:25 +0000 Received: by mail-oi0-f49.google.com with SMTP id v145so51156221oie.0 for ; Thu, 28 Apr 2016 07:03:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=16AnXUtCAV/b0yo3aH9xMk5/313MC3vXF5XQ7aXNba8=; b=N4+Fu3jMQ3PACEDJIGqpLYnk3RYAQxjvTT0J4LVoSP+dZ2uSAZrNgGYcwh38pxHri+ m9MQbgS81ajOIFZcdtVbVtBY0xSIqLdO8V9SX8FhRaMz+o30F1WMVpGYV0hMdvs1q9UG ghDW8MMgWgfkZERchZ9RkvaB7wIB4dC4NaDCrrrg+H1V6b59MyTcWyTcHE+rl8p54nE5 FINFYEZhzGLEcKeN4csLM0PiU7KaXQhuuP9ctKrT1jVdxh30JRk8p5QDY9uZbzJwmFW9 IZKizVd4ZHd62DCgmE7FjZkY1QqD8pQZXyNpMwAFUid0rT6ptW+8ZCCWxnq6C2Zt4Ub9 4eSg== X-Gm-Message-State: AOPr4FXYOXweDsyYHCq2Kbnl81+yh1rwTndxvmwaj28oHjtCtgbCCS6RHNEw70/gOt4OhQmEJ2Kpc4peyUE4mw== X-Received: by 10.157.48.98 with SMTP id w31mr6250382otd.61.1461852203624; Thu, 28 Apr 2016 07:03:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.102.105 with HTTP; Thu, 28 Apr 2016 07:03:04 -0700 (PDT) In-Reply-To: <75b51453-cac0-0d8f-2bfa-9a0cabca6e9b@redhat.com> References: <1457653131-32296-1-git-send-email-patrick@parcs.ath.cx> <75b51453-cac0-0d8f-2bfa-9a0cabca6e9b@redhat.com> From: Patrick Palka Date: Thu, 28 Apr 2016 14:03:00 -0000 Message-ID: Subject: Re: [PATCH] Turn some compile-time tests into run-time tests To: Jeff Law Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2016-04/txt/msg01831.txt.bz2 On Wed, Apr 27, 2016 at 5:36 PM, Jeff Law wrote: > On 03/10/2016 04:38 PM, Patrick Palka wrote: >> >> I ran the command >> >> git grep -l "dg-do compile" | xargs grep -l __builtin_abort | xargs grep >> -lw main >> >> to find tests marked as compile-time tests that likely ought to instead >> be marked as run-time tests, by the rationale that they use >> __builtin_abort and they also define main(). (I also then confirmed that >> they >> compile, link and run cleanly on my machine.) >> >> After this patch, the remaining test files reported by the above command >> are: >> >> These do not define all the functions they use: >> gcc/testsuite/g++.dg/ipa/devirt-41.C >> gcc/testsuite/g++.dg/ipa/devirt-44.C >> gcc/testsuite/g++.dg/ipa/devirt-45.C >> gcc/testsuite/gcc.target/i386/pr55672.c >> >> These are non-x86 tests so I can't confirm that they run cleanly: >> gcc/testsuite/gcc.target/arm/pr58041.c >> gcc/testsuite/gcc.target/powerpc/pr35907.c >> gcc/testsuite/gcc.target/s390/dwarfregtable-1.c >> gcc/testsuite/gcc.target/s390/dwarfregtable-2.c >> gcc/testsuite/gcc.target/s390/dwarfregtable-3.c >> >> These use dg-error: >> libstdc++-v3/testsuite/20_util/forward/c_neg.cc >> libstdc++-v3/testsuite/20_util/forward/f_neg.cc >> >> Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK to >> commit? Does anyone have another heuristic one can use to help find >> these kinds of typos? >> >> gcc/testsuite/ChangeLog: >> >> * g++.dg/cpp0x/constexpr-aggr2.C: Make it a run-time test. >> * g++.dg/cpp0x/nullptr32.C: Likewise. >> * g++.dg/cpp1y/digit-sep-cxx11-neg.C: Likewise. >> * g++.dg/cpp1y/digit-sep.C: Likewise. >> * g++.dg/ext/flexary13.C: Likewise. >> * gcc.dg/alias-14.c: Likewise. >> * gcc.dg/ipa/PR65282.c: Likewise. >> * gcc.dg/pr69644.c: Likewise. >> * gcc.dg/tree-ssa/pr38533.c: Likewise. >> * gcc.dg/tree-ssa/pr61385.c: Likewise. > > My worry with the 38533 test is that while the ASM defines "f" from the > standpoint of dataflow, it does not actually emit any code to ensure "f" is > actually defined. This could lead to spurious aborts due to use of an > uninitialized value at runtime. Similarly for alias-14.c > > I'd be worried that we don't necessarily have sync_bool_compare_and_swap on > all targets for 69644. Ah yeah, good points.. > > flexary13.C probably won't link on a cross target unless the cross libraries > are available. But that's probably OK. > > The rest seem OK to me. Note that I'm not convinced all these tests were > designed to be execution tests, even though they use __builtin_abort and > friends. Though it's a good marker of something that can/should be looked > at. True.. What made me look into this in the first place is that I caught myself making a similar mistake, i.e. marking an execution test case as dg-do compile instead of dg-do run out of habit. But I suppose it's worth looking at the context of each of these tests to see if they were not actually intended to be execution tests. I'll double check this and report back; in the meantime I also found some more tests that ought to be looked at. > > > jeff >