> Heh. Well then - the original patch is ok. Thanks. However, I simplified the original testcase far too much so the fix isn't general enough, sorry about that. The new testcase (attached) involves nested GIMPLE_TRY_FINALLYs and GIMPLE_BINDs. So, in the end, we really need to track things. I think it's better to think in terms of fallthruness since there is already a lot of code in gimple-low.c that does this. The patch fixes a typo in the process, whereby GIMPLE_SWITCH is deemed may_fallthru by the code of gimple_stmt_may_fallthru whereas the comment just above explains why it is not. It also attempts to remove only unreachable return statements, that's sufficient and probably safer. Tested on x86_64-suse-linux, OK for mainline? 2009-10-18 Eric Botcazou * gimple-low.c (struct lower_data): Add cannot_fallthru field. (lower_stmt) : Add comment. : Set cannot_fallthru to true and return. : Remove the statement if cannot_fallthru is set. Otherwise lower it and set cannot_fallthru to true. : Update cannot_fallthru for GIMPLE_TRY_FINALLY. Set it to false otherwise. Return. ; Set cannot_fallthru to false. : Set cannot_fallthru to false for BUILT_IN_SETJMP and to true for a noreturn call. Do not remove statements. : Set cannot_fallthru to false. Set cannot_fallthru to false on function exit. (gimple_stmt_may_fallthru) : Really return false. : Remove. 2009-10-18 Eric Botcazou * gnat.dg/noreturn2.ad[sb]: New test. -- Eric Botcazou