https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99945
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This has nothing to do with cleanup functions but just nested functions vs SRA. Take: ``` int foo1 (void); int foo2 (int); #ifdef D #define N #else #define N ! #endif int bar (void) { int i; auto void cf (int *t) { foo2 (i); } int t; t = 0; if (foo1 ()) i = foo1 (); i = N foo1 () || i; foo2 (i); cf(&t); return 0; } ``` Which is the same as the original one without the cleanup attribute (basically added the call to cf). Using `-O2 -Wall -DD -fno-tree-sra` causes the following warning the be done: ``` <source>: In function 'bar': <source>:22:17: warning: 'FRAME.1.i' may be used uninitialized [-Wmaybe-uninitialized] 22 | i = N foo1 () || i; | ~~~~~~~~^~~~ <source>:11:5: note: 'FRAME.1' declared here 11 | int bar (void) | ^~~ ``` Without `-fno-tree-sra`, there is no warning because SRA produces: ``` # SR.4_14 = PHI <SR.4_12(D)(5), _9(3)> _2 = foo1 (); _17 = _2 | SR.4_14; ``` which should 100% warn but since SR.4 is artifical does not.