Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-14 Thread Jim Wilson
Jeff wrote: I added fprintf (asm_out_file, "\tnop\n"); to the end of case CODE_LABEL. Then I recompile the gcc. Unfortunately, it doesn't seem that a NOP was inserted. Any ideaes? What testcase did you try? Not every basic block starts with a label. Only basic blocks that are the target of

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-11 Thread Ian Lance Taylor
Jeff <[EMAIL PROTECTED]> writes: > > The simplest way is going to be something like > >fprintf (asm_out_file, "\tnop\n"); > > I added fprintf (asm_out_file, "\tnop\n"); to the end of case > CODE_LABEL. Then I recompile the gcc. Unfortunately, it doesn't seem > that a NOP was inserted. Any

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-11 Thread Jeff
The simplest way is going to be something like fprintf (asm_out_file, "\tnop\n"); I added fprintf (asm_out_file, "\tnop\n"); to the end of case CODE_LABEL. Then I recompile the gcc. Unfortunately, it doesn't seem that a NOP was inserted. Any ideaes? case CODE_LABEL: /* The target

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-11 Thread Ian Lance Taylor
Jeff <[EMAIL PROTECTED]> writes: > Which function should I use in order to emit a nop? The simplest way is going to be something like fprintf (asm_out_file, "\tnop\n"); Ian

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-10 Thread Jeff
If you don't want to change the generated code other than inserting the nops, and you can restrict yourself to a processor which does not need to track addresses to avoid out-of-range branches, then you could approximate what you want by emitting a nop in final_scan_insn when you see a CODE_LABEL,

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-10 Thread Ian Lance Taylor
Jeff <[EMAIL PROTECTED]> writes: > It would be cleaner if I know how to modify the gcc source code and > let it insert a nop to each basic block. This shouldn't be a hard job > for an experienced gcc developer, should this? It's doable but it's probably harder than you seem to think it is. gcc i

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-10 Thread Jeff
2006/8/10, Paolo Bonzini <[EMAIL PROTECTED]>: jeff jeff wrote: > Hi all, > > I'm doing an experiment with gcc. I need to modify gcc so that a NOP > instruction will be inserted into each basic block in binary code that > gcc generates. I know this sounds weird but it is part of my > experiment.

Re: How to add a NOP instruction in each basic block for obj code that gcc generates

2006-08-10 Thread Paolo Bonzini
jeff jeff wrote: Hi all, I'm doing an experiment with gcc. I need to modify gcc so that a NOP instruction will be inserted into each basic block in binary code that gcc generates. I know this sounds weird but it is part of my experiment. As I'm unfamiliar with gcc, is there someone willing to