From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 895A5398D04B; Fri, 17 Jul 2020 15:48:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 895A5398D04B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595000887; bh=RZ2s0gSniV6Ss6ZeXSY4ICvq11BqSHCiKfV6xYnEWx4=; h=From:To:Subject:Date:From; b=PHBM5FVdNTY/Mx99vGAmy0ai4F5eFtn1baWnkx1W2Ioz2t/wvQZhuA+arBpCusLXr +8oitcSYJTTqV2PhwgluHnl0IFYfg9jk5CRViqzslETA196TcBlsX6k26mtZyxFIkG /TUaaWtsXxBmFxh8o43Q/J0O7viEWYAjyirDkw10= From: "suochenyao at 163 dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/96235] New: Segmentation fault with "-Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra" Date: Fri, 17 Jul 2020 15:48:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: suochenyao at 163 dot com 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 15:48:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96235 Bug ID: 96235 Summary: Segmentation fault with "-Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra" Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: suochenyao at 163 dot com Target Milestone: --- Hi, I've got a problem when using gcc new trunk version. I compile the following source code with "-Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra" on x86_64 GNU/Linux. It reports "Segmentation fault (core dumped= )". If I using "gcc -O2 -Wall -Wextra", it will only say "variable =E2=80=98g= =E2=80=99 set but not used". But with only optimization level, the problem will not occur. And if= I reduce any one of "-fno-dce -fno-tree-dce -finline-small-functions -fipa-sr= a", this problem will not occur as well. Looking forward to your reply, Thanks! $ gcc --version $ gcc (GCC) 11.0.0 20200717 (experimental) $=20 $ gcc -O2 -Wall -Wextra -fno-strict-aliasing -fwrapv a.c a.c: In function =E2=80=98e=E2=80=99: a.c:5:7: warning: variable =E2=80=98g=E2=80=99 set but not used [-Wunused-b= ut-set-variable] 5 | int g =3D (b >=3D *f); | ^ $ $ gcc -Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out Segmentation fault (core dumped) $=20 $ gcc -O0 a.c; ./a.out $ gcc -O1 a.c; ./a.out $ gcc -O2 a.c; ./a.out $ gcc -O3 a.c; ./a.out $ gcc -Og a.c; ./a.out $ gcc -Os a.c; ./a.out $=20 $ gcc -O1 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -O2 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -O3 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -Os -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -Og -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -Og -fno-dce -finline-small-functions -fipa-sra a.c; ./a.out $ gcc -Og -fno-dce -fno-tree-dce -fipa-sra a.c; ./a.out $ gcc -Og -fno-dce -fno-tree-dce -finline-small-functions a.c; ./a.out $ ------------------------------- int b=3D1; long d=3D1L; long c=3D1L; static int e(long *f) { int g =3D (b >=3D *f); g =3D (d && c); return 0; } int main() { long a=3D1L; e(&a); return 0; }=