Looks like in -O3 16 bytes of stack are allocated, compared with 32 for -Os and -Oz. So it looks like what you want happens in some optimization modes. -Os and -Oz focus on code size, so perhaps they just don't care about stack optimizations like these?
On Wed, Feb 24, 2016 at 3:25 PM, Charles Vaughn <[email protected]> wrote: > Looking at a simple test example disassembly to demonstrate Emscripten, I > noticed a potential optimization opportunity. > > See the gist here: https://gist.github.com/hackcasual/e0262caec12bd60b2fe1 > C++ is in a comment on top, compiled with -Oz > > For example, q and p are pointers allocated on the stack, however as their > lifetimes don't overlap couldn't p be dropped and just q used? Similar to > what the registerization pass does. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
