http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48331

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2011-03-29 12:10:38 
UTC ---
The "while (1)" part of the testcase is not actually needed.

The problem seems to be there (at the assembly level):
...
    mov    rax, QWORD PTR buf@GOTPCREL[rip]    #,
    mov    rax, QWORD PTR 8[rax]    #,
    mov    QWORD PTR -8[rbp], rax    # %sfp, # stores value
    mov    rax, QWORD PTR buf@GOTPCREL[rip]    #,
    mov    rbp, QWORD PTR [rax]    #, # rbp changes
    mov    rsp, QWORD PTR 16[rax]    #,
    jmp    [QWORD PTR -8[rbp]]    # %sfp # uses new value or rbp
...

Maybe this was just uncovered by recent changes - comparing asm output from
r171626 and r171653 shows the priority allocator now gives much worse results.

In r171626, the generated code is the same as with CB's allocator, but in
r171653 there is much higher stack usage, causing this problem to show up.

Reply via email to