On 7/18/25 10:18 AM, Jan Dubiec wrote:
On 14.07.2025 20:02, Jeff Law wrote:
[...]
MD is a completely new topic to me so I am looking for some hints how
to debug the issue. Is it possible that this particular MD is not
fully complete?
Debugging failure to match is painful. I sometimes remove all the
#line markers in the generated insn-recog.cc files and follow the
recognizer, but that's only when I can't see what's going on with
visual inspection of the dumps & md file.
After spending two days I have found the source of the problem, however,
to my surprise, in completely different place:
diff --git a/gcc/config/h8300/jumpcall.md b/gcc/config/h8300/jumpcall.md
index 4e634085130..44847e4b43e 100644
--- a/gcc/config/h8300/jumpcall.md
+++ b/gcc/config/h8300/jumpcall.md
@@ -156,7 +156,7 @@ (define_insn_and_split ""
"#"
"&& reload_completed"
[(set (reg:CCZ CC_REG)
- (eq (zero_extract:HSI (match_dup 1) (const_int 1) (match_dup 2))
+ (eq:CCZ (zero_extract:HSI (match_dup 1) (const_int 1) (match_dup 2))
(const_int 0)))
(set (pc)
(if_then_else (match_op_dup 3 [(reg:CCZ CC_REG) (const_int 0)])
Good. Note that I've got a tester I can throw things into. I'll do a
regression test of mh, ms, msx with -mint32. I can add your patch to
that tester to see what happens.
I would be nice. The new version is in the attachment. I run tests on
the simulator. Anyway, exactly the same set of test cases passes/fails
for unmodified and patched gcc.
Later I will post the patch to gcc-patches.
The updated patch passed without issues.
Jeff