From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4CF67385E00F; Sun, 22 Mar 2020 18:30:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CF67385E00F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584901849; bh=8h+AyNpBr0UhkqZC+wuTBUKrRmOegSu1mXgiZ8asTI0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hl9C138ePcugYBVh7YkUdu2XXc9tbDh57HizgoSAFKLCNqjhPZRnDjaiV+2PNx4Kn o7MJKLH8xPa9iJpZZK6OekQq3+tdXWxiNUr1zjiO6k913stCXPnDv6QBN/dmisraV8 5b5B8ghzgjBcHGyharIWqoKys7gZhaBSvmQ953Ig= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94254] [10 regression] r10-7312 causes compiler hangs Date: Sun, 22 Mar 2020 18:30:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo 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: Sun, 22 Mar 2020 18:30:49 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94254 --- Comment #4 from rsandifo at gcc dot gnu.org --- The cycling comes from reloading: (insn 7 6 8 2 (set (reg:SD 122 [ a32 ]) (mem/c:SD (reg/f:DI 120) [1 a32+0 S4 A32])) "gcc/testsuite/gcc.target/powerpc/pr39902-2.c":15:13 516 {movsd_hardfloat} (expr_list:REG_DEAD (reg/f:DI 120) (nil))) r122 is assigned an FPR, and the power6 pattern doesn't provide any alternatives that load from memory into FPRs, so we convert this into a secondary memory reload. Doing that for SDmode memory would cycle, but the rs6000 port has: /* Implement TARGET_SECONDARY_RELOAD_NEEDED_MODE. For SDmode values we=20= =20=20=20=20=20=20=20=20 need to use DDmode, in all other cases we can use the same mode. */ static machine_mode rs6000_secondary_memory_needed_mode (machine_mode mode) { if (lra_in_progress && mode =3D=3D SDmode) return DDmode; return mode; } which says that the move should happen in DDmode instead. This means that the eventual FPR reload will happen in DDmode rather than SDmode. The problem is that rs6000_can_change_mode_class doesn't allow FPRs to change from SDmode to DDmode: if (from_size < 8 || to_size < 8) return false; So there seems to be a contradiction here: secondary memory reloads for FPRs have to happen in DDmode rather than SDmode, but FPRs aren't allowed to change to DDmode from SDmode. Previously this worked because LRA ignored rs6000_can_change_mode_class and changed the mode of the FPR regardless. I guess that must have been the right thing to do in context, but it would be good to pin down exactly why the SD->DD mode change is OK for rs6000 in the specific context of secondary memory reloads but not otherwise.=