On 11/05/2012 01:08 PM, Ian Lance Taylor wrote:
On Mon, Nov 5, 2012 at 10:02 AM, Kenneth Zadeck
<zad...@naturalbridge.com> wrote:
The question is why is having a case label of 256 on a unsigned char switch
legal?
Are you asking why it is valid in the C language? Or are you asking
why it is valid in GIMPLE? I guess the first question is fairly
obvious so you are asking about GIMPLE. I don't personally see a
problem with declaring that it is invalid in GIMPLE, but of course you
would need to modify the gimplifier and verify_gimple_stmt to reject
this code.
Ian
i have been around enough to understand that a lot can unravel when you
pull on a string.
At the top level, i could ask is it a problem if i make this illegal
gimple? and by problem i mean does this make the front ends reject some
legal c program?
the problem seems to be mostly that the front ends need to be calling
force_fit_type_double (or on my branch force_fit_type_wide rather than
just double_int_to_tree (or wide_int_to_tree). This would mean that the
value would go into the gimple code with overflow bit set.
kenny