Bug 24816 – backend optimizer slowdown on large for loop body

Status
NEW
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-10-15T08:52:40Z
Last change time
2024-12-13T19:38:11Z
Keywords
industry
Assigned to
No Owner
Creator
Dennis
Blocks
21121
Moved to GitHub: dmd#20535 →

Comments

Comment #0 by dkorpel — 2024-10-15T08:52:40Z
Change the size of the static foreach to arbitrarily explode compilation time when compiling with -O: ``` void f() { for (int i = 0; i < 1; i++) { int j = 0; static foreach (k; 0 .. 1000) j++; } } ``` The optimizer should stop trying to do quadratic time loop optimizations past a certain threshold.
Comment #1 by robert.schadek — 2024-12-13T19:38:11Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20535 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB