From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF34B3858C5E; Mon, 20 Mar 2023 11:53:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF34B3858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679313229; bh=vVJ2iUJqp7wfi0JlQV8gS7ZtFBzIG3vCR4fLPotaZN4=; h=From:To:Subject:Date:From; b=l4cYHG8ON3dbqXQ3INMnXaXLn4i/YabhFtaedNkWP8QG95BIcHp+4f/3uo9i266L4 earZGkeG49/IbnDc6paR/aA9jjk9a73uc0WAeKtvU76a5yHisKZVdwOQhgecFv+JIy TVIcll5PNKPYf7ftoUGHQHkNRMPoB0KyP/Bch0yo= From: "theodort at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109213] New: [13 Regression] -Os generates significantly more code Date: Mon, 20 Mar 2023 11:53:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: theodort at inf dot ethz.ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109213 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] =3D {0}; static int f =3D 0, *e; static void b(int) {}; static int i() { for (int j =3D0; j < 1; j +=3D1) f =3D 0; return 0; } static void m() { int n[10]; int o[56] =3D {}; for (int h =3D 0; h < 3; h++) if (d[h]) for (; f; f++) if (n[0]) break; int *r[] =3D {&o[0]}; } int main() { int p[10] =3D {}; m(); if (!i()) { int *q =3D &p[0]; for (; g;) b(e =3D=3D q); } } ----------------------------------------------------- 12.2 -Os: main: xorl %eax, %eax movl %eax, f(%rip) xorl %eax, %eax ret ----------------------------------------------------- trunk -Os:=20 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=