Re: Basic blocks and compilers

Ken Rose <>
9 Jan 2006 23:50:11 -0500

          From comp.compilers

Related articles
Basic blocks and compilers (Christian Christmann) (2006-01-07)
Re: Basic blocks and compilers (George Neuner) (2006-01-09)
Re: Basic blocks and compilers ( (2006-01-09)
Re: Basic blocks and compilers (2006-01-09)
Re: Basic blocks and compilers (Hans-Peter Diettrich) (2006-01-09)
Re: Basic blocks and compilers (Paolo Bonzini) (2006-01-09)
Re: Basic blocks and compilers (Ken Rose) (2006-01-09)
Re: Basic blocks and compilers (Stephen Clarke) (2006-01-09)
Re: Basic blocks and compilers (2006-01-09)
| List of all articles for this month |

From: Ken Rose <>
Newsgroups: comp.compilers
Date: 9 Jan 2006 23:50:11 -0500
Organization: Posted via Supernews,
References: 06-01-009
Keywords: analysis
Posted-Date: 09 Jan 2006 23:50:11 EST

Christian Christmann wrote:
> jlt %d15, %d0, .L5
> j .L3
> I don't understand why the compiler
> 1) is not spliting basic block .L2 into two blocks where
> the second block just contains the instruction "j .L3".
> I though that each re-direction of the control flow imposes the
> creation of a new basic block (like .L4 and .L3). The instuction
> "jlt %d15, %d0, .L5" can possibly direct the program flow to .L5 and
> thus, in my opinion, the basic block should end here.

I'm not familiar with the tricore's instruction set, but this looks like
it really wanted to generate "jge" and perhaps it doesn't exist, or,
more likely, the conditional branch has a very short range and so the
compiler needs to use the longer-range unconditional branch to reach the
target. In either of these cases, the code would be the result of
instruction selection, which takes place after gcc is done with any
thoughts of blocks.

> 2) splits block .L5 and .L4? There are no
> calls to label .L4, so, according to my understanding, all instructions
> of blocks .L5 and .L4 should be held in one block.

Yeah, that does seem to be an unneeded label. There was probably some
reason for it, but it's very hard to guess, particularly without the
source code.

> Might these two points be bugs or do the authors of the tricore-gcc
> have a different definition of basic blocks?

Probably neither. Extra labels do no harm, and the two jumps are
probably caused by one of the mechanisms I mentioned.

  - ken

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.