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.129.124]) by sourceware.org (Postfix) with ESMTPS id ECDEC385B524 for ; Mon, 25 Sep 2023 12:18:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECDEC385B524 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695644286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ojqmq9o6OoMGTuydOJUAEi7skBKPeYqZPfwy1+RzNFw=; b=SoS2uuNoN/4yLQh8szQ6fFECItZS5Yg4iq7QMTZlg7axXWU6FZM/0Y+MZSLMTqiDSOsPRL zB3se8Z/qNhtdDMplm89Ho1VGE6nlp+PfBN5x12JWUgtcXYs5tM2kvWyVUqcNMdqa37MHW neyPm/TYO8R85MNheCIW8O0RosLuAUI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-191-BskW4x8oPfiueUY7wH0nbA-1; Mon, 25 Sep 2023 08:18:05 -0400 X-MC-Unique: BskW4x8oPfiueUY7wH0nbA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1B3D381CBFD; Mon, 25 Sep 2023 12:18:04 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.22.32.171]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5BA5C15BB8; Mon, 25 Sep 2023 12:18:03 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 38PCI2BL1117498 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 25 Sep 2023 08:18:02 -0400 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 38PCI2Z71117497; Mon, 25 Sep 2023 08:18:02 -0400 From: Aldy Hernandez To: GCC patches Cc: Richard Biener , Andrew MacLeod , Aldy Hernandez Subject: [PATCH] [testsuite] Remove undefined behavior from gcc.dg/tree-ssa/pr44306.c Date: Mon, 25 Sep 2023 08:17:47 -0400 Message-ID: <20230925121800.1117481-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: In auditing the DOM code to see what the scoped tables catch that ranger doesn't, I've run accross this test, which seems to have uninitialized reads from both j and present[]. >From the original PR, it looks like this came from a reduction of a failing test in SPEC's 464.h264ref. A google search of the CalculateQuant8Param() in the test yields: https://github.com/microsoft/test-suite/blob/master/MultiSource/Applications/JM/lencod/q_matrix.c Assuming the above source is similar to the original testcase, it looks like both "j" and "present" were initialized before use, so our testcase just got reduced a bit too far. I tried to build the offending commit to see if my adjustments to the test still caused it to fail: commit e1449456c0a88f5b3122db5452f7e91f5a9535f6 (HEAD -> master) Author: Sebastian Pop Date: Wed May 26 16:46:59 2010 +0000 Reorganize the analysis of basic block predication. ...but alas it no longer builds with a recent compiler. Perhaps someone has a ./cc1 of that revision around to verify? OK? gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr44306.c: Remove undefined behavior. --- gcc/testsuite/gcc.dg/tree-ssa/pr44306.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c b/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c index 1ea04ce3a98..d322fe048b5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c @@ -8,10 +8,10 @@ int LevelScale8x8Luma_Inter[6][8][8]; int InvLevelScale8x8Luma_Intra[6][8][8]; int InvLevelScale8x8Luma_Inter[6][8][8]; short UseDefaultScalingMatrix8x8Flag[2]; -void CalculateQuant8Param() +int present[2]; +void CalculateQuant8Param(int j) { - int i, j, k, temp; - int present[2]; + int i, k, temp; for(k=0; j<8; j++) for(i=0; i<8; i++) { -- 2.41.0