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: [tree-ssa] Switch stmts and inserting on edges


On Fri, 2003-05-30 at 14:46, Diego Novillo wrote:
> On Fri, 2003-05-30 at 11:23, Andrew MacLeod wrote:
> 
> > Any other suggestions? I havent thought of anything I actually like....
> > 
> The problem is that SWITCH_EXPRs still have implicit semantics that are
> getting in the way.  I think this ought to be fixed by finishing Jason's
> patch to expose SWITCH_EXPRs as explicit multi-way branches, or even
> decision trees.
------------------------------------------------------------------------------
> 
> So, now if we want to split block #3, we just do:
> 
> ---------------------------------------------------------------------------------
>         # BLOCK 3 (a.c:13).  PRED: 0.  SUCC: 4.
>         case3:
> 	goto default;
> 
> 	# BLOCK 4 (a.c:13).  PRED: 0.  SUCC: 5.
> 	new_label:
> 	new_stmt;
> 
>         default :;
>         i_5 = i_2 + 3;
>         goto <UL14d0>;
> ---------------------------------------------------------------------------------
> 
> And rename the appropriate entry in SWITCH_LABELS() to have 'new_label'
> be the last element.

But I can do that same operation today with the existing switch stmt...
Can't I?  That looks an awful lot like what I proposed:
    BB26
    new_label_1:
      goto new_label_2;
    BB100
    default:
      copy_stmt;
    BB101
    new_label_2:
      code;

The only difference is that (upon reflection), new_label_1 serves no
purpose.... and default is still the label the switch targets. So I use
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?

Andrew


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