public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109213] New: [13 Regression] -Os generates significantly more code
@ 2023-03-20 11:53 theodort at inf dot ethz.ch
  2023-03-20 13:07 ` [Bug tree-optimization/109213] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: theodort at inf dot ethz.ch @ 2023-03-20 11:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109213

            Bug ID: 109213
           Summary: [13 Regression] -Os generates significantly more code
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: theodort at inf dot ethz.ch
  Target Milestone: ---

Input C-code:

static char g, d[5] = {0};
static int f = 0, *e;
static void b(int) {};

static int i() {
    for (int j =0; j < 1; j +=1)
        f = 0;
    return 0;
}

static void m() {
    int n[10];
    int o[56] = {};
    for (int h = 0; h < 3; h++)
        if (d[h])
            for (; f; f++)
                if (n[0])
                    break;

    int *r[] = {&o[0]};
}


int main() {
    int p[10] = {};
    m();
    if (!i()) {
        int *q = &p[0];
        for (; g;)
            b(e == q);
    }
}

-----------------------------------------------------
12.2 -Os:

main:
        xorl    %eax, %eax
        movl    %eax, f(%rip)
        xorl    %eax, %eax
        ret

-----------------------------------------------------
trunk -Os: 

m:
        movl    f(%rip), %eax
        xorl    %edx, %edx
        xorl    %ecx, %ecx
.L5:
        cmpb    $0, d(%rdx)
        je      .L2
        movl    -40(%rsp), %esi
.L3:
        testl   %eax, %eax
        je      .L2
        testl   %esi, %esi
        jne     .L2
        incl    %eax
        movb    $1, %cl
        jmp     .L3
.L2:
        incq    %rdx
        cmpq    $3, %rdx
        jne     .L5
        testb   %cl, %cl
        je      .L1
        movl    %eax, f(%rip)
.L1:
        ret
main:
        xorl    %eax, %eax
        call    m
        xorl    %eax, %eax
        movl    %eax, f(%rip)
        xorl    %eax, %eax
        ret
d:
        .zero   5

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-05-21  9:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 11:53 [Bug tree-optimization/109213] New: [13 Regression] -Os generates significantly more code theodort at inf dot ethz.ch
2023-03-20 13:07 ` [Bug tree-optimization/109213] " rguenth at gcc dot gnu.org
2023-03-20 17:36 ` pinskia at gcc dot gnu.org
2023-03-20 17:36 ` pinskia at gcc dot gnu.org
2023-03-20 17:39 ` pinskia at gcc dot gnu.org
2023-03-20 17:54 ` pinskia at gcc dot gnu.org
2023-03-21  8:45 ` [Bug tree-optimization/109213] [13 Regression] -Os generates significantly more code since r13-723 jakub at gcc dot gnu.org
2023-03-21 13:37 ` rguenth at gcc dot gnu.org
2023-03-27  7:43 ` rguenth at gcc dot gnu.org
2023-03-29 15:04 ` hubicka at gcc dot gnu.org
2023-04-26  6:58 ` [Bug tree-optimization/109213] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:25 ` rguenth at gcc dot gnu.org
2024-05-21  9:14 ` [Bug tree-optimization/109213] [13/14/15 " jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).