This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Switch stmts and inserting on edges
On Fri, 2003-05-30 at 16:10, Diego Novillo wrote:
> On Fri, 2003-05-30 at 15:41, Andrew MacLeod wrote:
> > the labels the other way around from you. Isnt that exactly the same
> > solution only without changing it to a multi-branch system? Which means
> > the same thing would then work if it were changed to multi-branch
> > eventually. Or am I missing something?
> >
> Yup, same thing. And this actually works with any two case labels that
> fall through to each other, right? The difference is that with MBRs we
well, more or less.
The case I am dealing with has one case doing work, and falling through
to another one which is called. 2 case labels sharing the same code that
has to be split is different.
Sooo. How does a switch currently handle that? I dont think I need to
ever worry about it. If I have:
BB6:
case 3:
default:
blah;
Then there con only be one edge from the switch to BB6.. so inserting on
that edge will insert code into *bopth* case 3: and default:
So as far as insert on edge is concerned, thats never an issue.
If it ever were possible to do such a thing, it would have to look like:
BB6:
case 3:
BB7
default:
blah;
in which case it would be exactly the same thing I am dealing with
now... falthrough from one block into the block I am targetting and have
to split the edge.
And yes, default: and case XX: are totally interchangeable. I do not
beelive there is anything special about default. (Although it probably
has to be the last case, but Im not mucking with order here.)
So what list does the switch use? SWITCH_LABELS you said? I assume its
just a list of labels? Im not changing any labels, just the block that
a label is in, and I'll redirect the edge from the switch stmt's block
for that. Any other little gotchyas in there I might miss by doing just
then obvious?
Andrew