From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9BC5E3858C39; Sat, 7 Jan 2023 11:14:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BC5E3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673090091; bh=GQpSyVGEhkJ8V9NTgLkJn4qKKcodt+GWr5ltnzH9sIQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VtydCN9b+J6mcwAc6Gda13CZXKgbY6hw8LGShU9TeS6a7RZ12v5iWpoavXI8+9h9N UK+W/ST8v6Z4MlHvJ/bb/s1IJZccDn3zbXoWJcKu91HnuRkz3bCX94WwOpiM8sHPRf oYFHuLFGP5CW3Sp1btx8eN/0bPyX2zzq0voT5uWI= From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/34678] Optimization generates incorrect code with -frounding-math option (#pragma STDC FENV_ACCESS not implemented) Date: Sat, 07 Jan 2023 11:14:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D34678 --- Comment #48 from Thomas Koenig --- Clang gets this right, even without the pragma; the original test case is compiled to pushq %r14 pushq %rbx subq $24, %rsp movq %rsi, %r14 movq %rdi, %rbx movsd %xmm1, 16(%rsp) # 8-byte Spill movsd %xmm0, 8(%rsp) # 8-byte Spill movl $1024, %edi # imm =3D 0x400 callq fesetround@PLT movsd 8(%rsp), %xmm0 # 8-byte Reload divsd 16(%rsp), %xmm0 # 8-byte Folded Reload movsd %xmm0, (%rbx) movl $2048, %edi # imm =3D 0x800 callq fesetround@PLT movsd 8(%rsp), %xmm0 # 8-byte Reload divsd 16(%rsp), %xmm0 # 8-byte Folded Reload movsd %xmm0, (%r14) addq $24, %rsp popq %rbx popq %r14 retq=