From patchwork Wed Oct 9 19:43:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maya Rashish X-Patchwork-Id: 1173986 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510563-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sdf.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="AwHxH9tG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46pPlj37C1z9s7T for ; Thu, 10 Oct 2019 06:43:27 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; q=dns; s= default; b=VtpDVFqp7ztZxc2yIVyh2Aaod6p36tc6xSA26zSFhw8O4TxdifNa5 hci+FoKEZshm7AkGAHdQPDABI8NwJk8jzbZ4rWNUNZ2o77kMdWcYRrZVLoS32YhT GoMlmT9nIq95l/+BDs2jpzaaeuebJ1Q30vEBHAqPOB5/OR6JpHTcuo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=default; bh=Apd3jqwcSq71hlj623JzAwsztaY=; b=AwHxH9tGpdFnTO3Yf0beaCudr+84 oTLn3eEldWITxjKxQn7FV9Af/1cKlwmRFv+V6xiFwEZ6Gg16sO0dAt6v15joIi/t vmY1ugrbujrgOSq1f4QwwkYDGjd11kBQjSMjgpp/uAnacwHdLh9IThrQZGk4pVxk DRoGZFS72o9Qvqk= Received: (qmail 63186 invoked by alias); 9 Oct 2019 19:43:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 63178 invoked by uid 89); 9 Oct 2019 19:43:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=test-cases, HContent-Transfer-Encoding:8bit X-HELO: mx.sdf.org Received: from mx.sdf.org (HELO mx.sdf.org) (205.166.94.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Oct 2019 19:43:17 +0000 Received: from sdf.org (IDENT:coypu@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id x99JhFbe017303 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Wed, 9 Oct 2019 19:43:15 GMT Received: (from coypu@localhost) by sdf.org (8.15.2/8.12.8/Submit) id x99JhFth005874; Wed, 9 Oct 2019 19:43:15 GMT Date: Wed, 9 Oct 2019 19:43:15 +0000 From: coypu@sdf.org To: Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [PR target/85401][v2] Add test-cases Message-ID: <20191009194315.GA4882@SDF.ORG> References: <20190914151504.GA21805@SDF.ORG> <20190928095200.GA20382@SDF.ORG> <5a279dc6-3707-5a85-d089-02f3c25965a4@redhat.com> <20190930204543.GA1144@SDF.ORG> <63790bcb-4e52-f428-41cb-6160195b4f0f@redhat.com> <20191004194333.GA3137@SDF.ORG> <5f046779-35ae-4c78-d488-ce36119dde6e@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5f046779-35ae-4c78-d488-ce36119dde6e@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) On Fri, Oct 04, 2019 at 02:28:55PM -0600, Jeff Law wrote: > On 10/4/19 1:43 PM, coypu@sdf.org wrote: > > On Tue, Oct 01, 2019 at 01:26:16PM -0600, Jeff Law wrote: > >> On 9/30/19 2:45 PM, coypu@sdf.org wrote: > >>> On Mon, Sep 30, 2019 at 11:46:24AM -0400, Vladimir Makarov wrote: > >>>> Yes, the patch is mostly ok.  You can commit it into the trunk after > >>>> applying changes mentioned below. If you do not have a write access, let me > >>>> know I'll commit the patch by myself. > >>> > >>> I don't have commit access. It would be nice if you committed it :) > >> I took care of the nits and committed the patch. > >> > >> > >>> > >>>> It would be nice to add a small test too.  But it is not obligatory for this > >>>> case as the patch is obvious and it might be hard to create a small test to > >>>> reproduce the bug. > >>> > >>> I have the C code that produces this failure. I can creduce it, but I'm > >>> not sure there's a relationship between it and the bug. > >>> Doing unrelated changes (adding instruction scheduling) to vax also hid it. > >>> > >>> Is this kind of test still valuable? > >> Often they are. > >> > >> jeff > > > > Here's the two tests I used. It might be too machine-made. > > One is in the vax specific directory since it needed -fno-pic. > > > > > > 2019-10-04 Maya Rashish > > * gcc.c-torture/compile/pr85401-2.c: New test. > > * gcc.target/vax/pr85401-1.c: New test. > ISTM that both should be in c-torture. We can use dg-* things in there too. > > jeff Sorry. I didn't realize while sending that they both produce the same crash. I was trying to produce test cases that don't produce warnings, and didn't notice the change. The original second test case has an unintialized variable use, so I am omitting it. 2019-10-09 Maya Rashish * gcc.c-torture/compile/pr85401: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c b/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c new file mode 100644 index 0000000..1d68d0b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int h(void); +int i(int); + +struct a b; +struct a { + unsigned c : 4; +} d() { + int e, f = b.c << 2, g = h(); + for (; g;) + ; + if (e == 0) + if (f) + i(f); + return b; +}