Summary: | arm: ICE (unrecognizable insn) with CMSE nonsecure call and -march=armv8.1-m.main | ||
---|---|---|---|
Product: | gcc | Reporter: | Alex Coplan <acoplan> |
Component: | target | Assignee: | Alex Coplan <acoplan> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | ice-on-valid-code, patch |
Priority: | P3 | ||
Version: | 12.0 | ||
Target Milestone: | 10.4 | ||
URL: | https://gcc.gnu.org/pipermail/gcc-patches/2021-April/569261.html | ||
Host: | Target: | arm-eabi | |
Build: | Known to work: | ||
Known to fail: | 12.0 | Last reconfirmed: | 2021-04-29 00:00:00 |
Description
Alex Coplan
2021-04-29 11:33:14 UTC
Taking a look at this. The master branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>: https://gcc.gnu.org/g:5b953740da1976d90d974055c6d825c509c6e654 commit r12-923-g5b953740da1976d90d974055c6d825c509c6e654 Author: Alex Coplan <alex.coplan@arm.com> Date: Wed May 19 15:52:45 2021 +0100 arm: Fix ICE with CMSE nonsecure calls on Armv8.1-M [PR100333] As the PR shows, we ICE shortly after expanding nonsecure calls for Armv8.1-M. For Armv8.1-M, we have TARGET_HAVE_FPCXT_CMSE. As it stands, the expander (arm.md:nonsecure_call_internal) moves the callee's address to a register (with copy_to_suggested_reg) only if !TARGET_HAVE_FPCXT_CMSE. However, looking at the pattern which the insn appears to be intended to match (thumb2.md:*nonsecure_call_reg_thumb2_fpcxt), it requires the callee's address to be in a register. This patch therefore just forces the callee's address into a register in the expander. gcc/ChangeLog: PR target/100333 * config/arm/arm.md (nonsecure_call_internal): Always ensure callee's address is in a register. gcc/testsuite/ChangeLog: PR target/100333 * gcc.target/arm/cmse/pr100333.c: New test. Fixed on trunk for now. The releases/gcc-11 branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>: https://gcc.gnu.org/g:e58539d965059994ebac606ae7533e857bbe199f commit r11-8506-ge58539d965059994ebac606ae7533e857bbe199f Author: Alex Coplan <alex.coplan@arm.com> Date: Wed May 19 15:52:45 2021 +0100 arm: Fix ICE with CMSE nonsecure calls on Armv8.1-M [PR100333] As the PR shows, we ICE shortly after expanding nonsecure calls for Armv8.1-M. For Armv8.1-M, we have TARGET_HAVE_FPCXT_CMSE. As it stands, the expander (arm.md:nonsecure_call_internal) moves the callee's address to a register (with copy_to_suggested_reg) only if !TARGET_HAVE_FPCXT_CMSE. However, looking at the pattern which the insn appears to be intended to match (thumb2.md:*nonsecure_call_reg_thumb2_fpcxt), it requires the callee's address to be in a register. This patch therefore just forces the callee's address into a register in the expander. gcc/ChangeLog: PR target/100333 * config/arm/arm.md (nonsecure_call_internal): Always ensure callee's address is in a register. gcc/testsuite/ChangeLog: PR target/100333 * gcc.target/arm/cmse/pr100333.c: New test. (cherry picked from commit 5b953740da1976d90d974055c6d825c509c6e654) The releases/gcc-10 branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>: https://gcc.gnu.org/g:fe28b9da8f81c678bf5807eba413fae09ac36e72 commit r10-9889-gfe28b9da8f81c678bf5807eba413fae09ac36e72 Author: Alex Coplan <alex.coplan@arm.com> Date: Wed May 19 15:52:45 2021 +0100 arm: Fix ICE with CMSE nonsecure calls on Armv8.1-M [PR100333] As the PR shows, we ICE shortly after expanding nonsecure calls for Armv8.1-M. For Armv8.1-M, we have TARGET_HAVE_FPCXT_CMSE. As it stands, the expander (arm.md:nonsecure_call_internal) moves the callee's address to a register (with copy_to_suggested_reg) only if !TARGET_HAVE_FPCXT_CMSE. However, looking at the pattern which the insn appears to be intended to match (thumb2.md:*nonsecure_call_reg_thumb2_fpcxt), it requires the callee's address to be in a register. This patch therefore just forces the callee's address into a register in the expander. gcc/ChangeLog: PR target/100333 * config/arm/arm.md (nonsecure_call_internal): Always ensure callee's address is in a register. gcc/testsuite/ChangeLog: PR target/100333 * gcc.target/arm/cmse/pr100333.c: New test. (cherry picked from commit 5b953740da1976d90d974055c6d825c509c6e654) Fixed. |