From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3A2FD3860C3A; Mon, 17 Aug 2020 18:03:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A2FD3860C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597687411; bh=d9/3ucfk32XFgD7/Ro4iYWzztZZep67CQ7AJZ4bjqHY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MTDQIUxOom4R1dT5LP/CN266DlejWBB35Tygw6JLWGUIyf4wCc157UueTj17aDmDD Ychjfb45ft9fuk1Attc5mN5FK4dXgcRHz1JpK7sjkBuEaXZMdNgOPFnNoz5xmnBBtV UkmHzBx7+hMGjY/Gvk4fpfoeHZVb9EBS3WqHr9Ts= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96613] SIGFPE on min1() with -ffpe-trap=invalid switch Date: Mon, 17 Aug 2020 18:03:31 +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: 10.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: anlauf at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Mon, 17 Aug 2020 18:03:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96613 --- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to kargl from comment #4) > I thought that this might be a good candidate for frontend fix.=20=20 > Similar to thomas's frontend optimizations except except the=20 > transformation is always done. That is, we should be able to do > substitutions based on Table 16.3 before we even get to backend. If frontend optimization is preferred, I'll step out of the way. Nevertheless, one also need to address issues like: % cat maxmin.f90 program p implicit none print *, min (2.0, 1.d0) print *, min (2.d0, 1.0) print *, kind (min (2.0, 1.d0)) print *, kind (min (2.d0, 1.0)) end program p % gfc-11 maxmin.f90 && ./a.out=20 1.00000000=20=20=20=20 1.0000000000000000=20=20=20=20=20 4 8 The only compiler I found having the same is PGI/NVIDIA. OTOH ifort (and similarly sunf95, g95(!)) result in the expected: 1.00000000000000=20=20=20=20=20 1.00000000000000=20=20=20=20=20 8 8=