aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-11-12 06:15:50 -0700
committerJeff Law <jlaw@ventanamicro.com>2024-11-12 06:16:38 -0700
commitb8ecd96aea9a97a60b143fc70efa6d03d0f188a2 (patch)
tree468d2d99c2c2f07be583a68d72624751069b85a6 /gcc
parentde6fe61839ff78f05580c553e4f87507166ef160 (diff)
downloadgcc-b8ecd96aea9a97a60b143fc70efa6d03d0f188a2.zip
gcc-b8ecd96aea9a97a60b143fc70efa6d03d0f188a2.tar.gz
gcc-b8ecd96aea9a97a60b143fc70efa6d03d0f188a2.tar.bz2
[committed] Fix minor c6x backend bug exposed by CRC patches
This is a minor bug in the c6x port I saw when testing Mariam's CRC work. Specifically some of the CRC tests were failing with a segfault testing if an operand was an "a_register" from within the dest_regfile attribute. We were extracting what we thought should have been a register operand then looking at the REGNO. The underlying data was totally bogus, hence the fault in the accessor macros. The core issue is we were trying to extract operands from a nop insn which has no operands. As far as I can tell "unknown" is a reasonable answer for the dest_regfile attribute on a nop insn, so this patch adds an explicit setting of dest_regfile rather than letting the default processing kick in. I'm applying the attached patch to the trunk. There's still a backend bug affecting ~15 CRC tests. Essentially the assembler complains about a label (related to debugging info) not at the start of an execution packet. I'm not chasing this down. gcc/ * config/c6x/c6x.md (nop, nop_count): Add explicit "dest_regfile" attribute setting.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/c6x/c6x.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/config/c6x/c6x.md b/gcc/config/c6x/c6x.md
index ea9ffe8..9e0aa61 100644
--- a/gcc/config/c6x/c6x.md
+++ b/gcc/config/c6x/c6x.md
@@ -365,12 +365,14 @@
(define_insn "nop"
[(const_int 0)]
""
- "nop")
+ "nop"
+ [(set_attr "dest_regfile" "unknown")])
(define_insn "nop_count"
[(unspec [(match_operand 0 "const_int_operand" "n")] UNSPEC_NOP)]
""
- "%|%.\\tnop\\t%0")
+ "%|%.\\tnop\\t%0"
+ [(set_attr "dest_regfile" "unknown")])
;; -------------------------------------------------------------------------
;; Move instructions