From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 2D0833857C4E for ; Thu, 16 Sep 2021 09:19:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D0833857C4E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-D3lgniOdNFSUTWJcmEur3Q-1; Thu, 16 Sep 2021 05:19:24 -0400 X-MC-Unique: D3lgniOdNFSUTWJcmEur3Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDBFC1084681; Thu, 16 Sep 2021 09:19:22 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57BFE60C81; Thu, 16 Sep 2021 09:19:22 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 18G9JKXC080702 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 16 Sep 2021 11:19:20 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 18G9JHN6080701; Thu, 16 Sep 2021 11:19:17 +0200 Date: Thu, 16 Sep 2021 11:19:17 +0200 From: Jakub Jelinek To: Qing Zhao Cc: Richard Biener , Richard Sandiford , Nick Alcock via Gcc-patches , kees Cook Subject: Re: [PATCH] testsuite: Fix c-c++-common/auto-init-* tests Message-ID: <20210916091917.GF304296@tucnak> Reply-To: Jakub Jelinek References: <1F37A36D-A681-4EA8-B96B-0195AE707C91@oracle.com> <20210911080320.GA304296@tucnak> <9C40E343-B36F-46DC-8A41-383B8EF97A48@oracle.com> MIME-Version: 1.0 In-Reply-To: <9C40E343-B36F-46DC-8A41-383B8EF97A48@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Thu, 16 Sep 2021 09:19:28 -0000 On Wed, Sep 15, 2021 at 05:59:08PM +0000, Qing Zhao wrote: > > Note, the gcc.dg/i386/auto-init* tests fail also, just don't have time to > > deal with that right now, just try > > make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp=auto-init*' > > It’s strange that the above testing on my local x86 machine with the latest gcc had less failure than the following: > > [opc@qinzhao-ol8u3-x86 build-boot]$ make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp=auto-init*' &> log & > [1] 3885164 > [opc@qinzhao-ol8u3-x86 build-boot]$ > [1]+ Done make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} i386.exp=auto-init*' &> log > [opc@qinzhao-ol8u3-x86 build-boot]$ egrep FAIL gcc/testsuite/gcc/gcc.sum > FAIL: gcc.target/i386/auto-init-2.c scan-rtl-dump-times expand "0xfffffffffefefefe" 2 > FAIL: gcc.target/i386/auto-init-2.c scan-rtl-dump-times expand "0xfefefefefefefefe" 3 > FAIL: gcc.target/i386/auto-init-3.c scan-assembler-times pxor\t\\%xmm0, \\%xmm0 3 > FAIL: gcc.target/i386/auto-init-4.c scan-rtl-dump-times expand "0xfffffffffefefefe" 1 > FAIL: gcc.target/i386/auto-init-4.c scan-rtl-dump-times expand "\\[0xfefefefefefefefe\\]" 1 > FAIL: gcc.target/i386/auto-init-4.c scan-rtl-dump-times expand "0xfffffffffffffffe\\]\\) repeated x16" 1 > FAIL: gcc.target/i386/auto-init-5.c scan-assembler-times \\.long\t0 14 > FAIL: gcc.target/i386/auto-init-padding-3.c scan-assembler movl\t\\$16, > FAIL: gcc.target/i386/auto-init-padding-3.c scan-assembler rep stosq > FAIL: gcc.target/i386/auto-init-padding-7.c scan-assembler-times movq\t\\$0, 2 > FAIL: gcc.target/i386/auto-init-padding-8.c scan-assembler-times movq\t\\$0, 2 > FAIL: gcc.target/i386/auto-init-padding-9.c scan-assembler rep stosq Testing for many instructions is always very fragile and dependent on exact compiler flags etc. So, either the test should have a particular -march=/-mtune= options and ideally also -fno-stack-protector -fno-stack-clash-protection etc. if they could change the expected matching, or test it at runtime instead (I know, it is playing with fire, because you are testing the behavior of UB, but perhaps making the functions that use the uninitialized vars __attribute__((noipa)) and checking whether the vars contain the expected values might be ok. Jakub