From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id ACF993858CDA for ; Mon, 25 Sep 2023 14:34:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACF993858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3ff1c397405so74425505e9.3 for ; Mon, 25 Sep 2023 07:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695652451; x=1696257251; darn=gcc.gnu.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=JXaQwyAQmsFu6PreaHGQZ4b0xi7OLZzT4XSGXQDZUNo=; b=YM+MgI5oaQM0NuN59fSNAdxjR82zro32V6f9qf743uJOFZaJiX6Rv+mFTYfDY/Z3S+ ujCOzKzG8pSMiKKbXUZsr8PBHEB2Q7EfjaEwnYLFuXtpITZGilEv0QDOQD9NZgUDOwbj chfnO7jJ/yArn6Os/mV9Y/7wSA8Upj1cGgkFx+61lhGEKjszGEVihcn9tVCe/QegP5dc nSOZ/1k+i3fXdnYfTHKj5BITNcC/LlrMjOtRdOvQU4Jye1xW2xaarQuf0d+Rs3k25Sc/ nMuEmFNI9RuDQB0MtKjTHQSEy8kZpeEWKzNhjRrOmOvmGyZkp6LM75EoLznzGH5IUe0j Nb+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695652451; x=1696257251; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JXaQwyAQmsFu6PreaHGQZ4b0xi7OLZzT4XSGXQDZUNo=; b=FWB835scPjUaPvlkbahf2zGaFjQaxv1Hfwbok0V/hjdszac/MCLU8qG51MUwVMmZwK 7eJ6sPXiPmK7hpiL3WMuIgGNU2BBCs/9XrjagP0tqrv5krQEEopz/yMb3UiShrAxs3K6 E/d68SEyWUsxb+qY3oSnaDp3Dptlwcge38R5nomyUFVAh3JYSxUXxMN9mSUQSMh4RhJP 6b9AkcORgbhW5eVgDxXAbg/NJgS5aGktk1FjJHQyWLFQ4uxsmn7ykhT12vqFhuFBL07E Y9ULJhk1aVHWbq0uY9vGFK1gwTztOB6Wr7Um1g2H0AHRtSvw3L7aFU0GloY+4orwp1/B p+Pw== X-Gm-Message-State: AOJu0YyIa/6Wg9T9UVbCAzFSv6k3KsNLNJydoFJmtyisKY4irNqLBvZe J5Qt20XPCLvBCYDvtZ/WQnc= X-Google-Smtp-Source: AGHT+IFpF5rDvR/V3AimpUm0LqngxU8RFJNZB/L+qZnecRAfn3ej1aU948krSyg9g+UNauZ0VT9uxQ== X-Received: by 2002:a05:600c:210d:b0:405:336b:8307 with SMTP id u13-20020a05600c210d00b00405336b8307mr5384162wml.7.1695652450968; Mon, 25 Sep 2023 07:34:10 -0700 (PDT) Received: from smtpclient.apple (dynamic-077-004-047-229.77.4.pool.telefonica.de. [77.4.47.229]) by smtp.gmail.com with ESMTPSA id t24-20020a7bc3d8000000b00401dc20a070sm15301597wmj.43.2023.09.25.07.34.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Sep 2023 07:34:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] [testsuite] Remove undefined behavior from gcc.dg/tree-ssa/pr44306.c Date: Mon, 25 Sep 2023 16:33:59 +0200 Message-Id: <73A94441-533F-4363-A09B-CED3FC250EEF@gmail.com> References: <20230925121800.1117481-1-aldyh@redhat.com> Cc: GCC patches , Andrew MacLeod In-Reply-To: <20230925121800.1117481-1-aldyh@redhat.com> To: Aldy Hernandez X-Mailer: iPhone Mail (20H19) X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: > Am 25.09.2023 um 14:18 schrieb Aldy Hernandez : >=20 > =EF=BB=BFIn 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[]. >=20 > =46rom 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: >=20 > https://github.com/microsoft/test-suite/blob/master/MultiSource/Applicatio= ns/JM/lencod/q_matrix.c >=20 > 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. >=20 > I tried to build the offending commit to see if my adjustments to the > test still caused it to fail: >=20 > commit e1449456c0a88f5b3122db5452f7e91f5a9535f6 (HEAD -> master) > Author: Sebastian Pop > Date: Wed May 26 16:46:59 2010 +0000 >=20 > Reorganize the analysis of basic block predication. >=20 > ...but alas it no longer builds with a recent compiler. Perhaps > someone has a ./cc1 of that revision around to verify? >=20 > OK? Ok > gcc/testsuite/ChangeLog: >=20 > * 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(-) >=20 > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr44306.c b/gcc/testsuite/gcc.d= g/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=3D0; j<8; j++) > for(i=3D0; i<8; i++) > { > --=20 > 2.41.0 >=20