From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27738 invoked by alias); 9 Jan 2008 18:26:01 -0000 Received: (qmail 27723 invoked by uid 22791); 9 Jan 2008 18:26:01 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 09 Jan 2008 18:25:41 +0000 Received: (qmail invoked by alias); 09 Jan 2008 18:25:38 -0000 Received: from pool-129-146-197-89.dbd-ipconnect.net (EHLO [192.168.178.22]) [89.197.146.129] by mail.gmx.net (mp018) with SMTP; 09 Jan 2008 19:25:38 +0100 X-Authenticated: #4022294 Mime-Version: 1.0 (Apple Message framework v753) Content-Transfer-Encoding: 7bit Message-Id: <35528597-A9DA-4D81-8EE4-4192FE591628@gmx.de> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: GCC From: Boris Boesler Subject: Allocating scratch register Date: Wed, 09 Jan 2008 18:26:00 -0000 X-Mailer: Apple Mail (2.753) X-Y-GMX-Trusted: 0 X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00096.txt.bz2 Hi! I'm trying to allocate a scratch register: write immediate constant into scratch register r, write register r into memory ;; write imm into memory (define_insn_and_split "mov_imm_by_store" [(set (match_operand:I8I16 0 "memory_operand" "=m") (match_operand:I8I16 1 "immediate_operand" " i")) (clobber (match_scratch:I8I16 2 "=r"))] "" "#" "" [(parallel [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (match_dup 2))])] "" ) I found that in a mips back-end. But this pattern is not recognized during code-generation [char c1; c1 = 1;]: simple-memory.c:19: error: unrecognizable insn: (insn 12 11 14 3 (set (mem/c/i:QI (reg/f:SI 105) [0 c1+0 S8]) (const_int 1 [0x1])) -1 (nil) (nil)) If I remove the clobber command and replace (match_dup 2) by (reg:I8I16 A15_REGNUM) code will be generated (but not as wanted). What is wrong with the code above? Thanks, Boris