Summary: | unoptimal virtual method call. | ||
---|---|---|---|
Product: | gcc | Reporter: | Pawel Sikora <pawel_sikora> |
Component: | other | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | enhancement | CC: | gcc-bugs |
Priority: | P3 | ||
Version: | 4.1.2 | ||
Target Milestone: | 3.4.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: |
Description
Pawel Sikora
2006-09-05 20:54:13 UTC
-funswitch-loops fixes the loops. For the first function, we get: .L4: movl %ebx, (%esp) call *%esi jmp .L4 and: .L3: movl (%ebx), %eax movl %ebx, (%esp) call *-1(%eax,%edi) .p2align 4,,4 jmp .L3 So this is either fixed with -funswitch-loops and/or -O3 which enables -funswitch-loops. And this has been fixed since 3.4.0 which added -funswitch-loops. (In reply to comment #1) > -funswitch-loops fixes the loops. i don't think it is fixed. imho this is only a partial fix. > For the first function, we get: > .L4: > movl %ebx, (%esp) > call *%esi > jmp .L4 > > and: > .L3: > movl (%ebx), %eax <=== [1] > movl %ebx, (%esp) > call *-1(%eax,%edi) <=== [1] > .p2align 4,,4 > jmp .L3 [1] is still less effective than optimized_loop. movl 12(%ebp), %eax # f, f movl 8(%ebp), %esi # a, a movl 16(%ebp), %edx # f, f testb $1, %al #, f$__pfn movl %eax, %ebx # f, f$__pfn je .L13 movl (%esi,%edx), %eax #* f$__delta, tmp65 movl -1(%eax,%ebx), %ebx #, f$__pfn .L13: movl %esi, (%esp) # a, call *%ebx # f$__pfn jmp .L13 i dont't think it's invalid report. -funswitch-loop produces only slightly better results. |