Article View: gnu.gcc.help
Article #51434generating function call at RTL level
From: Elliot Stewart
Date: Wed, 02 Jun 1993 18:58
Date: Wed, 02 Jun 1993 18:58
28 lines
1826 bytes
1826 bytes
The environment that I am using is: Sun SPARC ELC SunOS v4.1.2 GCC v1.42 I am inserting code at the rtl level -- I want to insert my own function call with one argument and no return value. I have currently looked at the files insn-emit.c (for gen_call) and a few others but I am still unclear on how to set it up. I understand that the first argument to gen_call should be the function name. The second argument I am setting up is the parameter that I am passing(I first set register %o0 to hold the parameter value). Is there any more/less to this? A copy of the code that I have written is included here for a function call "_snapshot" and parameter "train_id": pattern = gen_rtx(SET, VOIDmode, gen_rtx(REG, SImode, 8), gen_rtx(CONST_INT, VOIDmode, train_id++)); emit_insn_before(pattern, insn); pattern = gen_call(gen_rtx(MEM, FUNCTION_MODE, gen_rtx(SYMBOL_REF, SImode, "_snapshot")), gen_rtx(REG, SImode, 8)); emit_insn_before(pattern, insn); Any help with this would be greatly appreciated. Elliot Stewart stewart@crhc.uiuc.edu
Technical Details
Message-ID:
<199306021849.AA24491@gershwin.crhc.uiuc.edu>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!news.univie.ac.at!paladin.american.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!crhc.uiuc.edu!stewartShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,5bb3feac782bd15c,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-06-02 12:26:25 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!scsing.switch.ch!news.univie.ac.at!paladin.american.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!crhc.uiuc.edu!stewart From: stewart@crhc.uiuc.edu (Elliot Stewart) Newsgroups: gnu.gcc.help Subject: generating function call at RTL level Date: 2 Jun 1993 14:58:06 -0400 Organization: GNUs Not Usenet Lines: 28 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <199306021849.AA24491@gershwin.crhc.uiuc.edu>