Re: Control Flow Graphs
Call dump_flow_info() defined in cfg.c to output the pred and succ of each block. You can use this output to construct the CFG. Maybe the software graphviz can help you to visualize the CFG. On 10/16/06, Rob Quill <[EMAIL PROTECTED]> wrote: Hi, Does anyone know if it is possible to view/access/print out the control flow graphs produced by GCC, either at compilation time, or after compilation has taken place? Thanks for your time. Rob -- Paul Yuan www.yingbo.com
Re: Some hints on solving this problem?
1) Modify the final() in final.c to emit some code before ld and st before outputting the assembly. 2) Modify the MD file. Find the template which generate ld or st, and add some code before ld and st. On 2/3/07, 吴曦 <[EMAIL PROTECTED]> wrote: Hi, I am working on gcc 4.1.1 and Itanium2 architecture. I want to use gcc to emit some code before each ld and st instruction (I know that using dynamic binary translator like PIN may be more suitable for this task, but I am on the way of studying gcc and want to use it to achieve this goal). But after several days of study, I find that the back-end of gcc too complex... :-( So, what is the best level in back-end to accomplish this task? I would appreciate any help I can get on this problem! thx! -- Paul Yuan www.yingbo.com
Re: Some hints on solving this problem?
Just care ia64.md. itanium1.md is for the description of itanium1 processor's pipeline, and itanium2.md for the description of itanium2 processor's pipeline. The are both used in the instruction scheduling pass. On 2/4/07, 吴曦 <[EMAIL PROTECTED]> wrote: Thanks for the hints, I have already noticed that insn list is match against the RTL templates to emit assembly code. However, I found 3 md files, ia64.md, itanium.md, itanium2.md, each file is very big... would you mind giving some hints on the differences between them? Especially, I am working on itanium2 architecture. (I have found many insn templates in ia64.md, but how about itanium.md and itanium2.md?) 在 07-2-4,Paul Yuan<[EMAIL PROTECTED]> 写道: > 1) Modify the final() in final.c to emit some code before ld and st > before outputting the assembly. > 2) Modify the MD file. Find the template which generate ld or st, and > add some code before ld and st. > > On 2/3/07, 吴曦 <[EMAIL PROTECTED]> wrote: > > Hi, > > I am working on gcc 4.1.1 and Itanium2 architecture. I want to use gcc > > to emit some code before each ld and st instruction (I know that using > > dynamic binary translator like PIN may be more suitable for this task, > > but I am on the way of studying gcc and want to use it to achieve this > > goal). But after several days of study, I find that the back-end of > > gcc too complex... :-( > > > > So, what is the best level in back-end to accomplish this task? > > > > I would appreciate any help I can get on this problem! > > > > thx! > > > > > -- > Paul Yuan > www.yingbo.com > -- Paul Yuan www.yingbo.com
Re: Any hints on this problem? Thanks!
Andy, you must handle the calling convertion when inserting a function call. It includes the saving and restoring of caller registers and the proper passing of params. On 2/9/07, Andrew Haley <[EMAIL PROTECTED]> wrote: �NbjX writes: > > > > Make sure that the called function restores the original state of the > > program before it returns. > > > > Andreas. > Thanks~. I know the goal is to restore the original state before the > inserted function returns. BUT, how to? Is there any way to tell gcc: > "Hey, you should restore the original state before that function > returns". I want hints on how to and the existing interfaces in gcc > to do this :-). He's telling you that you have to do it yourself, in the code that you just inserted. Andrew. -- Paul Yuan www.yingbo.com