From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3D225385B535; Thu, 16 Feb 2023 14:35:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D225385B535 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676558147; bh=HQiggtTB3xSdtf+20+fih2+d/bQ9FxM9Sd8e14e/1AU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oYAW1lfekrGzz8ssr2TUgSR8gXVV9yA78IrlFyMzto+4/8Yato8kmfXmgcFHqzAfq yPk4iM/4kAF8HL4gCWXkbi9fHwvQzU0gUL9Ykb+///msw3x1yRRiWabH9v2c3Ax6dp fn2KebAe1WJfN1frC8lnd3G1qQL0yhig/0+QmurY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108657] [13 Regression] csmith: possible wrong checksum with -O3 and -ftrivial-auto-var-init=zero Date: Thu, 16 Feb 2023 14:35:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108657 --- Comment #22 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:866555b170016c49beb869a78cbecdeb07c63135 commit r13-6083-g866555b170016c49beb869a78cbecdeb07c63135 Author: Jakub Jelinek Date: Thu Feb 16 15:35:05 2023 +0100 tree-ssa-dse: Fix up handling of lhs of internal calls [PR108657] The r13-1778 PR106378 tree-ssa-dse change didn't just add special suppo= rt for IFN_LEN_STORE and IFN_MASK_STORE internal function calls as I belie= ve was intended, but given that the function was if (is builtin) { ... } else if (lhs present and non-SSA_NAME) { ... } return false; and it added a new else if (is internal builtin) { ... } in between the two, the last if used to be done before on all stmts with non-SSA_NAME lhs except for calls to builtin functions, but newly isn't done also for calls to internal functions. In the testcase the important internal function is .DEFERRED_INIT, which often has non-SSA_NAME lhs, and the change resulted in them no longer being DSEd, so a block with nothing in it left but var =3D .DEFERRED_INIT () and var =3D {CLOBBER} was unrolled several times. The following patch does the lhs handling for all stmts with non-SSA_NA= ME lhs unless initialize_ao_ref_for_dse handled those specially already and returned (which is the case for various mem* builtins which don't have such lhs, for some cases of calloc which again is fine,and since r13-17= 78 also for IFN_LEN_STORE call and some IFN_MASK_STORE calls. As IFN_MASK_STORE doesn't have a lhs, the break for the !may_def_ok case doesn't seem to change anything, and because we've handled internal fns that way in the past, I think it is the right thing to do that again. That said, if it is inappropriate for some new ifn, I guess it could be added to the switch and just return false; for it instead of break;. 2023-02-16 Jakub Jelinek PR tree-optimization/108657 * tree-ssa-dse.cc (initialize_ao_ref_for_dse): If lhs of stmt exists and is not a SSA_NAME, call ao_ref_init even if the stmt is a call to internal or builtin function. * gcc.dg/pr108657.c: New test.=