Nicholas Clark wrote in perl.perl6.internals :
> 
>> >   r->score = r->use_count + (r->lhs_use_count << 2);
>> > 
>> >    r->score += 1 << (loop_depth * 3);
[...]
> I wonder how hard it would be to make a --fsummon-nasal-demons flag for gcc
> that added trap code for all classes of undefined behaviour, and caused
> code to abort (or something more colourfully "undefined") if anything
> undefined gets executed. I realise that code would run very slowly, but it
> would be a very very useful debugging tool.

What undefined behaviour are you referring to exactly ? the shift
overrun ? AFAIK it's very predictable (given one int size). Cases of
potential undefined behavior can usually be detected at compile-time. I
imagine that shift overrun detection can be enabled via an ugly macro
and a cpp symbol.

(what's a nasal demon ? can't find the nasald(8) manpage)

Reply via email to