From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 153EB3858425; Fri, 13 Jan 2023 11:51:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 153EB3858425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673610712; bh=igzHVsYp8ZrDpu8Tq7rfIV3gQjoory2I3x5HB5kdi78=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L0cuYlsqbDrQXcG3b91anYHHgaHUHlpyAkEIUROoXzlu/QPft8G8dsyRM6WtfPop5 WrymQ2Muy617CZL3OUQnwodsNYgGSkXTZO3Z8p8O+ZQmFQziObHvDzwGTfjrH5Mfpj R3/K6vuBzNOnDQDwljcnyAedHOq8Xvy4rdvDHzhI= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107424] [13 Regression] ICE in gfc_trans_omp_do, at fortran/trans-openmp.cc:5397 - and wrong code - with non-rectangular loops Date: Fri, 13 Jan 2023 11:51:51 +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: 13.0 X-Bugzilla-Keywords: accepts-invalid, ice-on-valid-code, openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 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=3D107424 --- Comment #8 from Jakub Jelinek --- For the non-simple loops, I guess the questions are if do i =3D x, y, 10000 is equivalent to for (i =3D x; i <=3D y; i +=3D 10000) or not (especially regarding the in C UB cases of y being above INT_MAX - 10000), and also what to do about do i =3D x, y, z where the step is variable - in C/C++, we always know if the iterator is increasing or decreasing from the condition, except for !=3D condition but = in that case OpenMP requires the step to be compile time known 1 or -1. I'm afraid for Fortran we have = no idea. And for non-rectangular loops like: !$omp do collapse(2) do i =3D x, y, s1 do j =3D z, 2 * i + w, s2 that is quite important...=