From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from delivery.mailspamprotection.com (delivery.mailspamprotection.com [185.56.85.133]) by sourceware.org (Postfix) with ESMTPS id 386FB3858408 for ; Fri, 7 Jan 2022 04:12:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 386FB3858408 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tantosonline.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=tantosonline.com Received: from 107.112.208.35.bc.googleusercontent.com ([35.208.112.107] helo=siteground277.com) by se17.mailspamprotection.com with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1n5gbv-000Dm6-Dq for gcc@gcc.gnu.org; Thu, 06 Jan 2022 22:12:17 -0600 Received: from [73.169.135.95] (port=56652 helo=kakukkfu.lan) by siteground277.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.90-.1) (envelope-from ) id 1n5gbv-000BlR-42 for gcc@gcc.gnu.org; Fri, 07 Jan 2022 04:12:15 +0000 Received: from dell-laptop.lan (router.lan [192.168.139.254]) by kakukkfu.lan (Postfix) with ESMTPSA id 5DB7113D for ; Thu, 6 Jan 2022 20:12:14 -0800 (PST) Message-ID: Subject: Why doesn't this pattern match? From: Andras Tantos To: GCC Development Date: Thu, 06 Jan 2022 20:12:13 -0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - siteground277.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tantosonline.com X-Source: X-Source-Args: X-Source-Dir: X-Originating-IP: 35.208.112.107 X-SpamExperts-Domain: siteground277.com X-SpamExperts-Username: 35.208.112.107 Authentication-Results: mailspamprotection.com; auth=pass smtp.auth=35.208.112.107@siteground277.com X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.23) X-Recommended-Action: accept X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT94S3V3P55/DoCaFnXYbKwEPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5xBytxzJBgOlCIhBVn7zf5DAxQ+GhOWeJSm0X/4oD2rzfK4 Wof64aflr4YUW0ae2TIh55uqY3MhMgFAHq5BxPxPnSWXEV458bUmxaOKcxICtcN9X9K1DzVKciEj mqsTuLPQAKujagVaTNLZ5X+kLHvN+ufcSwqqOlrljbZrM+IOzcdMIqsIyb3aJqs33ZX4HJh0xl54 MAEbe1oNTNeaZ2bNJnWeeuYTXKpbWwq0Jmmi2uXvmvRlQ7q/1uQBDKLsi+yPi0A2vLwcNEjxGjiC Erd+qHt1xvvzO+N6IwoZuodIR4zIacMilJyGVyjpEgOg2D9z7iXziAEKWBLXmO85pBwPaF+P3CGL wqkaQ0xpotL0Mhypt3L7tZhLu6Os9ceqGjHQelPdLZIWapW8lSgOkuDXqHh92LXjpWxyqA19gVEn 1I8jz3K25BQZYLiRBulvflK9x7G+8oFGjk5+Tb1j8PJET4ztkOffVWdpRr+g5kzHCGrLhMVo7s5r C/i1xA6nwvG8Ksk+aedMfNWSnJswrtlNQ8clfdequDnRZkTy+cnx+wzevvA7ArqeQFEd2navgAmn OvL8Z8nObfEzCxRgiDMmm7RVhDC6rGajPOQMsilQygZImPb9UZXs+o5qEZeRpTi3BT/xcase7lCw 0EQdzS0Qs10w7kA+lqPr+8hLk2VakQh/fcWngbkAwk6jiMZND+cWe1ww1+dhPKFe6CvZI2O74G/y b0lqja52Mvsrgj8rEk7tj7p+dyFIQ47gnxHR/cQeFcyQ7VJExC7Q4eRzWD0n0z6bhalFEM/pjPCQ A+BAlkOpG56vNwNAHsDD96cr7LsGGzgmrxJJssXyURBEIIDYJMPEAAC5mJVNKOXqIK/gaDmL5XOh CJVJlnAzxF8aJ3ankKhV3eOX7HlpQWFTKwKOPAlbDjazCbhs7qBpykynMvte84F69yef3rjIE9aq rvwwVFFEq45gMHpOzZY5w3lZONZwysYcuEaP1yUDhIrf6APNx91A6n31AAHEln911CjeNHk15Vol AGHS5rCXQKDywZSW8C3uaBiKZzYl7/DyqzzEOtOWX+ZTSN4+SxiH2XbbksYLroyN1JYjH3L7qaaK PM3kr7e7CDjX3ZthNfMWi+djXZBNOJeqVzGgrKtR6HA= X-Report-Abuse-To: spam@quarantine1.mailspamprotection.com X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, KAM_ASCII_DIVIDERS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2022 04:12:19 -0000 Hello! My name is Andras Tantos and I just joined this list, so if I'm asking something off-topic or not following the rules of the community, please let me know. What I'm working on is to port GCC (and Binutils) to a new CPU ISA, I call 'brew'. During developing for this target, I got the following error: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> first.c: In function ‘test_call’: first.c:61:52: error: insn does not satisfy its constraints: 61 | int test_call(int a, int b) { return test_qm(a,b); } | ^ (insn 25 8 9 (set (reg:SI 6 $r6) (reg:SI 0 $pc)) "first.c":61:38 17 {*movsi} (nil)) during RTL pass: final first.c:61:52: internal compiler error: in final_scan_insn_1, at final.c:2811 0x6c4c23 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../brew-gcc/gcc/rtl-error.c:108 0x6c4c4f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) ../../brew-gcc/gcc/rtl-error.c:118 0x643585 final_scan_insn_1 ../../brew-gcc/gcc/final.c:2811 0xb1ef3f final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../brew-gcc/gcc/final.c:2940 0xb1f207 final_1 ../../brew-gcc/gcc/final.c:1997 0xb1fbe6 rest_of_handle_final ../../brew-gcc/gcc/final.c:4285 0xb1fbe6 execute ../../brew-gcc/gcc/final.c:4363 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Clearly, the compiler couldn't find a rule that works for this register move. The relevant section of the .md file is: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> (define_expand "movsi" [(set (match_operand:SI 0 "general_operand" "") (match_operand:SI 1 "general_operand" ""))] "" " { /* If this is a store, force the value into a register. */ if (! (reload_in_progress || reload_completed)) { if (MEM_P (operands[0])) { operands[1] = force_reg (SImode, operands[1]); if (MEM_P (XEXP (operands[0], 0))) operands[0] = gen_rtx_MEM (SImode, force_reg (SImode, XEXP (operands[0], 0))); } else if (MEM_P (operands[1]) && MEM_P (XEXP (operands[1], 0))) operands[1] = gen_rtx_MEM (SImode, force_reg (SImode, XEXP (operands[1], 0))); } }") (define_insn "*movsi" [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,W,A,B,r,r,r") (match_operand:SI 1 "brew_general_mov_src_operand" "O,r,i,r,r,r,W,A,B"))] "register_operand (operands[0], SImode) || register_operand (operands[1], SImode)" "@ %0 <- %0 - %0 %0 <- %1 %0 <- %1 mem[%0] <- %1 mem[%0] <- %1 mem[%0] <- %1 %0 <- mem[%1] %0 <- mem[%1] %0 <- mem[%1]" ) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< As you can imagine, I'm fairly new to GCC development, so I must be making some rookie mistake here, but I would have thought that the second alternative in the "*movsi" rule above would match the pattern. brew_general_mov_src_operand is defined as follows: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> (define_predicate "brew_general_mov_src_operand" (match_code "mem,const_int,reg,subreg,symbol_ref,label_ref,const") { /* Any (MEM LABEL_REF) is OK. That is a pc-relative load. */ if (MEM_P (op) && GET_CODE (XEXP (op, 0)) == LABEL_REF) return 1; if (MEM_P (op) && GET_CODE (XEXP (op, 0)) == PLUS && GET_CODE (XEXP (XEXP (op, 0), 0)) == REG && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT ) return 1; /* Any register is good too */ if (REG_P(op)) return 1; /* PC as source is also acceptable */ if (op == pc_rtx) return 1; return general_operand (op, mode); }) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Thanks for all the help, Andras