https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71532
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Simpler testcase: int foo (int, int, int, int, int, int, int, int, int, int) __attribute__((pure)); int bar (int, int, int, int, int, int, int, int, int, int) __attribute__((pure)); int test (void) { int a = foo (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); a += bar (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); return a; } The question is if const/pure function can clobber the argument slots in which the arguments are passed to it. CSE doesn't invalidate those, so with -O2 -march=corei7 -mtune=slm we get all the arguments written to the stack just once, not twice.