https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103821
Bug ID: 103821 Summary: [12 Regression] huge compile time (jump threading) at -O3 for simple code Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: compile-time-hog Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: #include <inttypes.h> uint16_t int_sqrt32(uint32_t x) { uint16_t res=0; uint16_t add= 0x8000; do { uint16_t temp=res | add; uint32_t g2=temp*temp; if (x>=g2) res=temp; add>>=1; } while(add); return res; } ----- CUT ----- Compile this at -O3 and GCC takes a long time: backwards jump threading : 20.12 ( 81%) 0.01 ( 50%) 20.12 ( 78%) 26M ( 79%)