[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #6 from Marc Glisse --- (In reply to Wilco from comment #5) > Also it doesn't support these simple cases: > > void vla2(int x) > { > if (x == 10) > { > int arr[x]; > t (arr); > } > } Again, try something smaller. When

[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #5 from Wilco --- (In reply to Marc Glisse from comment #4) > (In reply to Wilco from comment #2) > > I don't see it happen for the simplest case in current trunk: > > 400 bytes is too large, try again with something smaller. (I'm wi

[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #4 from Marc Glisse --- (In reply to Wilco from comment #2) > I don't see it happen for the simplest case in current trunk: 400 bytes is too large, try again with something smaller. (I'm with you if you want to increase the threshold

[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #3 from Wilco --- There is also something buggy with the way alloca aligns, it always allocates 16 bytes too much...

[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #2 from Wilco --- (In reply to Marc Glisse from comment #1) > Note that we already do it for VLA (aka BUILT_IN_ALLOCA_WITH_ALIGN) in CCP. I don't see it happen for the simplest case in current trunk: void t(int *); void vla(void) {

[Bug middle-end/81445] Dynamic stack allocation not optimized into static allocation

2017-07-14 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81445 --- Comment #1 from Marc Glisse --- Note that we already do it for VLA (aka BUILT_IN_ALLOCA_WITH_ALIGN) in CCP.