http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54345
--- Comment #3 from Marek Polacek <polacek at redhat dot com> 2012-09-21 15:11:08 UTC --- Hmm. I hoped that something like this will show the leak, but no (it does a lot of threading with -O2--through conditionals, through loop headers and also through latches). But obviously it's not enough. Any ideas, please? extern void bla (void); extern void bar (void); extern void foo (void); void thread_through_condition (int a, int b) { #define E if (a > b) \ bla (); \ else \ bar (); \ if (a <= b) \ foo (); #define E10 E E E E E E E E E E #define E100 E10 E10 E10 E10 E10 E10 E10 E10 E10 E10 #define E1000 E100 E100 E100 E100 E100 E100 E100 E100 E100 E100 #define EE E1000 E1000 EE } void thread_entry_through_header (void) { int i; #define A for (i = 0; i < 42; ++i) \ bla (); #define A10 A A A A A A A A A A #define A100 A10 A10 A10 A10 A10 A10 A10 A10 A10 A10 #define A1000 A100 A100 A100 A100 A100 A100 A100 A100 A100 A100 #define AA A1000 A1000 A1000 A1000 A1000 AA } void thread_latch_through_header (void) { int i = 0; int first; #define L first = 1; i = 0; \ do { \ if (first) \ foo (); \ first = 0; \ bla (); \ } while (i++ < 100); #define L10 L L L L L L L L L L #define L100 L10 L10 L10 L10 L10 L10 L10 L10 L10 L10 #define L1000 L100 L100 L100 L100 L100 L100 L100 L100 L100 L100 L1000 }