From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2F693855004; Fri, 18 Jun 2021 16:23:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2F693855004 From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101123] [11/12 Regression] Invalid code for MAX0 with -fdefault-integer-8 Date: Fri, 18 Jun 2021 16:23:19 +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.0 X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf 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: 11.2 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2021 16:23:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101123 --- Comment #2 from anlauf at gcc dot gnu.org --- Why on Earth would somebody really want to combine legacy MAX0 with IMPLICIT INTEGER*4 and -fdefault-integer-8? Reduced testcase: SUBROUTINE TEST IMPLICIT INTEGER*4 (I-N) MAXMN=3DMAX0(M,N) END Dump tree: __attribute__((fn spec (". "))) void test () { integer(kind=3D4) m; integer(kind=3D4) maxmn; integer(kind=3D4) n; { integer(kind=3D4) M.0; M.0 =3D m; M.0 =3D MAX_EXPR ; maxmn =3D (integer(kind=3D4)) (integer(kind=3D8)) M.0; } } Is the dump tree inaccurate? It matches my expectation. Note: the code compiles with MAX0 replaced by (the generic) MAX.=