http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50557
Bug #: 50557 Summary: [4.7 Regression] Register pressure increase after reassociation (x86, 32 bits) Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: izamya...@gmail.com After the fix for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49749 (http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176984) I observed a degradation for the attached test. (~9% on Core) Before the fix RA managed to use registers for code related to line #30. After the fix an order of operations has been changed and this apparently led to change in live ranges and hence to increased register pressure. Asm snippet for fast case # 4long.c:30 .loc 1 30 0 movl 8(%ecx), %esi xorl %edi, %edi addl %eax, %esi movl 52(%esp), %eax adcl %edx, %edi mull 8(%ebp) addl %eax, %esi adcl %edx, %edi Asm snippet for slow case # 4long.c:30 .loc 1 30 0 movl 52(%esp), %eax mull 8(%ebp) movl %eax, (%esp) movl 8(%ecx), %eax movl %edx, 4(%esp) xorl %edx, %edx addl %eax, (%esp) adcl %edx, 4(%esp) addl %esi, (%esp) adcl %edi, 4(%esp) gcc is: Target: x86_64-unknown-linux-gnu Configured with: ../configure --disable-bootstrap --enable-languages=c,c++ --prefix=/export/users/izamyati/build/ Thread model: posix gcc version 4.7.0 20110731 (experimental) (GCC) Compilation flags: -O2 -mssse3 -mfpmath=sse -ffast-math -m32