From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8EF613858CDB; Mon, 6 Feb 2023 12:29:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8EF613858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675686544; bh=Q8wbCJqbLFkfjcxiAtmP1p1rpQOoIqvxixpzs0cqIqY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mCO++vsomOw+VI7yosKw/tdgHwkn6YBhsuaqPXWRgDJYW3BHWSTMqvqEGNHctR652 WBDkMIOVTRGiUq8Jacg3PdYwaXxgvlohYI4SI+4kOyMGqd2KnfFT3zboACEDC3gRlv WrutWj/1qwWoAEyJ5SYs3Bf/wURQROCg51xh0Tug= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106912] [13 Regression] ICE in vect_transform_loops, at tree-vectorizer.cc:1032 since r13-1575-gcf3a120084e94614 Date: Mon, 06 Feb 2023 12:29:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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=3D106912 --- Comment #10 from Jakub Jelinek --- Also, the other PR is about a function being made const late when it previo= usly wasn't, while in this case it is being made non-const after it has been con= st before. /* Drop pure/const flags from instrumented functions. */ if (profile_arc_flag || flag_test_coverage) FOR_EACH_DEFINED_FUNCTION (node) { if (!gimple_has_body_p (node->decl) || !(!node->clone_of || node->decl !=3D node->clone_of->decl)) continue; /* Don't profile functions produced for builtin stuff. */ if (DECL_SOURCE_LOCATION (node->decl) =3D=3D BUILTINS_LOCATION) continue; node->set_const_flag (false, false); node->set_pure_flag (false, false); } just looks completely wrong to me for const, which unlike pure attribute ca= n be on both function types and on function declarations. If we want calls to c= onst functions to actually not be treated as const when profiling, it can be only done by ignoring const everywhere if profile_arc_flag || flag_test_coverage= .=20 It even can't be just ignored for direct calls to defined functions, because calls can be indirect at first, without vops, and then fndecl propagated and turned into direct. Or for IPA they can be defined in other TUs.=