Switch case ordering
Richard Henderson
rth@redhat.com
Wed Sep 8 14:47:00 GMT 2010
On 09/08/2010 07:15 AM, Paulo J. Matos wrote:
> Hello,
>
> I have noticed that at least in GCC4.3 the switch cases are ordered
> somewhere in a pass, since they arrive at expand pass ordered in
> increasing order.
>
> Can anyone tell me if I can assume this always to happen and where this
> is happening? I couldn't find any reference to this in the internal
> docs.
Yes, you can assume this.
It happens in sort_case_labels, initially called by gimplify_switch_expr.
r~
More information about the Gcc
mailing list