------- Comment #23 from manu at gcc dot gnu dot org 2008-08-25 10:50 ------- (In reply to comment #22) > there is currently no good way to detect if a block is dead during the VRP > pass, as the VRP information is used for *determining* wether or not a block > is > dead.
I think in this case it is. simplify_switch_using_ranges is called before the warning occurs. However, it doesn't handle the case where the switch index is an integer constant! So it just doesn't do anything. I think this is a missed optimization, it should simplify the switch. > Is there a general warning-queuing implementation that I could make use of or > is there some other warning that does that already? Iirc the "is used/ might > be > used uninitialized" type of warnings do not use something like that. No, we don't have that but "is used/ may be used" does detect whether the current BB is always executed or not. That would be an improvement in my opinion. Not in this case anyway because as I said above, in this case we could do perfect. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902