From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 2D7253858D3C for ; Mon, 22 Aug 2022 17:16:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D7253858D3C Received: by mail-pf1-x42d.google.com with SMTP id y15so6980452pfr.9 for ; Mon, 22 Aug 2022 10:16:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=wLZu/7nQ4VQf/jL1cHNpcYdEY0mNa4MxKfvD7DEpLmg=; b=6kQLdipA0y0qEWcPy3MNPTW87UrHb3YaGmZmMQX7PVrjSlTqNvUR5pB7GBr1eUEPKB D1r5G8wpLOEEs0QsVdQ5Y9PS8exZjsR7jNdo+iarTmi90IjjiDch1R6WdgilVV/x4vGo /hWWHFnuWCrejT2iMath6JyCVMLR/xreR8FFaSNUCKAJBH9CIy/T6IXnvLMIF2Lrk/5W sRy/EiLSXmGwshDq38HQz6L17a5iF/h/A6QQjTSSsHn3M6kkMgHsOaMQOsfmrX77PDr0 VWPKg/lfvrkHt+Mwwa+l01kS0ctrtZbj0wYGsEWad0tSEGwVf6HjS7SjmSgxy2lB9lx7 6wMQ== X-Gm-Message-State: ACgBeo3IfNTz3s2rDue+mcK7kbY0ouSNpbK15l6WMwhaVWIzLK7eYRCa RtW4iWLxYbe2q06d4y4SQgffzXrbooaNrscCJXE= X-Google-Smtp-Source: AA6agR6xQ/9pIokYlAnPyfc/HRbx0B2wG/CbMJabuFVSkDfS/VwVI+hSwS1qjrZ6YpyfWV0dZVwmqVzOLnyiON7S1b4= X-Received: by 2002:a65:6d8f:0:b0:41b:f0a5:4abf with SMTP id bc15-20020a656d8f000000b0041bf0a54abfmr18173853pgb.277.1661188596037; Mon, 22 Aug 2022 10:16:36 -0700 (PDT) MIME-Version: 1.0 References: <20220822165737.39118-1-polacek@redhat.com> In-Reply-To: <20220822165737.39118-1-polacek@redhat.com> From: Andrew Pinski Date: Mon, 22 Aug 2022 10:16:23 -0700 Message-ID: Subject: Re: [PATCH] testsuite: Add test for r11-4123 To: Marek Polacek Cc: GCC Patches , Richard Biener Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, 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 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-List-Received-Date: Mon, 22 Aug 2022 17:16:39 -0000 On Mon, Aug 22, 2022 at 9:58 AM Marek Polacek via Gcc-patches wrote: > > r11-4123 came without a test but I happened upon a nice test case that > got fixed by that revision. So I think it'd be good to add it. The > ICE was: > > phi-1.C: In constructor 'ElementManager::ElementManager()': > phi-1.C:28:1: error: missing definition > 28 | ElementManager::ElementManager() : array_(makeArray()) {} > | ^~~~~~~~~~~~~~ > for SSA_NAME: _12 in statement: > _10 = PHI <_12(3), _11(5)> > PHI argument > _12 > for PHI node > _10 = PHI <_12(3), _11(5)> > during GIMPLE pass: fixup_cfg > phi-1.C:28:1: internal compiler error: verify_ssa failed > > Incidentally, do you think it's safe to backport r11-4123 to GCC 8 > (downstream)? Thanks. > > Tested on x86_64-pc-linux-gnu, ok for trunk? > > gcc/testsuite/ChangeLog: > > * g++.dg/tree-ssa/phi-1.C: New test. > --- > gcc/testsuite/g++.dg/tree-ssa/phi-1.C | 28 +++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 gcc/testsuite/g++.dg/tree-ssa/phi-1.C > > diff --git a/gcc/testsuite/g++.dg/tree-ssa/phi-1.C b/gcc/testsuite/g++.dg/tree-ssa/phi-1.C > new file mode 100644 > index 00000000000..26cade052e3 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/tree-ssa/phi-1.C > @@ -0,0 +1,28 @@ > +// { dg-do compile { target c++11 } } > +// { dg-options "-O --param early-inlining-insns=14" } It seems better to put it in g++.dg/torture and remove -O part. And then it will be tested for more than before. Maybe even just mark makeArray as always_inline/inline and you might be able to remove the param also. Thanks, Andrew Pinski > + > +struct Element; > +template struct __array_traits { typedef Element _Type[_Nm]; }; > +template struct array { > + typename __array_traits<_Nm>::_Type _M_elems; > +}; > +bool logLevel(); > +struct LogCapture { > + void stream(); > +}; > +struct Element { > + Element(); > + long data_; > +}; > +using ElementArray = array<6>; > +struct ElementManager { > + ElementManager(); > + ElementArray array_; > +}; > +static ElementArray makeArray() { > + if (logLevel()) > + LogCapture().stream(); > + ElementArray foo; > + return foo; > +} > +ElementManager::ElementManager() : array_(makeArray()) {} > > base-commit: b6316324fceaef431799a8b386de5cc9881d6898 > -- > 2.37.2 >