This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RE: RTL Dumps


Petar,

>From what you have briefly explained it seems that your problem is in
whatever mov insns you have defined in the .md file.  I think
emit_move_insn(...) will not attempt to generate any assembly.  All it
will do is try to emit the appropriate move insn into the RTL list.

To get over your problem I would suggest just using 'dummy' insns to
begin with.  Here is a couple of mov insns that I use as dummy insns:
(define_insn "movqi"
 [(set (match_operand:QI 0 "general_operand" "")
       (match_operand:QI 1 "general_operand" ""))]
  ""
  "movqi %0 %1 ; %0 = %1" )

(define_insn "movhi"
 [(set (match_operand:HI 0 "general_operand" "")
       (match_operand:HI 1 "general_operand" ""))]
  ""
  "movhi %0 %1 ; %0 = %1" )

You can follow the same basic form for all other modes as necessary. 
This code is almost sure to cause the compiler to crash at later stages
of compilation however it should be sufficient to generate the RTL list.

Also - the bad news is that you need a working .md file in order to
generate an RTL list.  Not all insns have to be working - just those
named insns that the compiler is looking for in its initial tree -> RTL
conversion.  I would recommend creating a _very_ basic test program and
generating the RTL for the test case with a working machine (i.e. x86,
powerpc, etc.).  Have a look at the RTL patterns used and focus on
getting these right in your .md file first.  What you learn from this
exercise should go a long way to helping get to the next stage.

I hope this helps.
Marty Moose.

>>> "Petar Penchev" <ptr@melexis.com> 12/19/03 7:18 PM >>>
Hi ,
I tried the options you recommended, but it didn't work at all.
I have a segmentation fault in emit_move_insn(...). I think gcc is still
trying to generate an asm code for the source.
Reason I need RTL code onlym,is that I have some problems with .md file
I am
wtriting.
I have another qestion: Is it necessary to have a valid .md file to get
a
valid RTL ?
I hope the answer is 'no'.

Regards
Petar



> Hi,
>
> Pls try  -drx option.
>
> Alan Liu
>
> -----Original Message-----
> From: Petar Penchev [mailto:ptr@melexis.com]
> Sent: Friday, December 19, 2003 2:29 PM
> To: gcc@gcc.gnu.org
> Subject: RTL Dumps
>
>
> Hello everybody,
> Is it possible to make GCC to perform RTL dumps without optimization
and
> without compiling the source. At the moment I need C to RTL
translation.
>
>
> Regards Petar
>
>
>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]