From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6496F3857B80; Thu, 16 Jun 2022 19:16:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6496F3857B80 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBtaWRkbGUtZW5kLzEwNjAwOF0gTmV3OiBbMTIgUmVncmVz?= =?UTF-8?B?c2lvbl0gd2FybmluZzog4oCYKCgoY2hhciAqKWxvYWRjbWRzLjExM182OCAr?= =?UTF-8?B?IF85MzMgKyAxNikpWzMyOTQwNjE0NDE3MzM4NDg0OV0ubWFwZW5k4oCZIG1h?= =?UTF-8?B?eSBiZSB1c2VkIHVuaW5pdGlhbGl6ZWQgWy1XbWF5YmUtdW5pbml0aWFsaXpl?= =?UTF-8?B?ZF0=?= Date: Thu, 16 Jun 2022 19:16:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail 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 attachments.created 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: Thu, 16 Jun 2022 19:16:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106008 Bug ID: 106008 Summary: [12 Regression] warning: =E2=80=98(((char *)loadcmds.11= 3_68 + _933 + 16))[329406144173384849].mapend=E2=80=99 may be = used uninitialized [-Wmaybe-uninitialized] Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- Created attachment 53156 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53156&action=3Dedit A testcase When building glibc master branch with -mavx512f, I got [hjl@gnu-tgl-2 tmp]$ gcc -O2 -march=3Dx86-64 -S -Wall x.i -mavx512f=20 dl-load.c: In function =E2=80=98_dl_map_object_from_fd.constprop=E2=80=99: dl-load.c:1158:30: warning: =E2=80=98(((char *)loadcmds.113_68 + _933 + 16))[329406144173384849].mapend=E2=80=99 may be used uninitialized [-Wmaybe-uninitialized] [hjl@gnu-tgl-2 tmp]$=20 The code looks like struct loadcmd *c =3D &loadcmds[nloadcmds++]; c->mapstart =3D ALIGN_DOWN (ph->p_vaddr, GLRO(dl_pagesize)); c->mapend =3D ALIGN_UP (ph->p_vaddr + ph->p_filesz, GLRO(dl_pages= ize)); c->dataend =3D ph->p_vaddr + ph->p_filesz; c->allocend =3D ph->p_vaddr + ph->p_memsz; /* Remember the maximum p_align. */ if (powerof2 (ph->p_align) && ph->p_align > p_align_max) p_align_max =3D ph->p_align; c->mapoff =3D ALIGN_DOWN (ph->p_offset, GLRO(dl_pagesize)); /* Determine whether there is a gap between the last segment and this one. */ if (nloadcmds > 1 && c[-1].mapend !=3D c->mapstart) has_holes =3D true; c[-1].mapend should always be initialized.=