From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 013853858C32; Sun, 7 Apr 2024 18:30:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 013853858C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712514619; bh=Ne4qmcTNSn+/tXa/rqQBe06og67zff723KFqhKiMUjI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p1dBA8VY69LoM5kqHfAjvLI410hVXW8wEQBJjWf1VsZ5Qpz5B4f4sQt4cYodIXgy5 jg435mrbqmJyf2W/GwM31a1uQIVAaEBcRBCkzXLwZnWqCUt6um8ji2EiueG/Rhfjdq Yoyo0L6HI2UFohe1kuGfZb/FzLKnMf87f0311sgQ= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114626] Very long time for compilation the attached program, depends on value of a parameter Date: Sun, 07 Apr 2024 18:30:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also priority 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=3D114626 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D97571 Priority|P3 |P4 --- Comment #1 from anlauf at gcc dot gnu.org --- Note that pack( [ (k, k =3D 1,max_sum)], & [ ( count( [((i**3+j**3, i =3D 1,j), j =3D 1,max_ij)] =3D=3D k ) > 1, k =3D= 1,max_sum )] ) is a constant expression that the frontend tries to simplify at compile tim= e. I assume that most of the time goes into handling of the array constructors. There's no limit implemented that checks the complexity of such expressions and to give up if that limit is reached. An expression like the above could occur in a parameter definition, and a limit then might terminate the compilation with an error. Fortunately, you've already found a workaround. For a related PR see pr97571.=