From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 51E8B3858282; Thu, 28 Mar 2024 05:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51E8B3858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711603734; bh=+IEYO8sUMWzl/fTwiNpsqkG5cgOXyXbTHEDsdmYBx4M=; h=From:To:Subject:Date:From; b=PMvlPFx+K32vVXFOGMalz8HEf+R8QVsFSnX4bWAIb/Y0BOqlkoBDWh+zvWvep/FDQ a8K7n2/+neMNmZjX/neQAIx2rQ/1YWYojpVXCLn9zAvvQoBBNkJ7diXqMYf+POk7xV SWKgsUwHesxoMLun55O6ZeCjfteTSmnqvb2+mzD8= From: "vt at altlinux dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114507] New: FR: Randomize order of evluation of function of arguments Date: Thu, 28 Mar 2024 05:28:53 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vt at altlinux dot org 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=3D114507 Bug ID: 114507 Summary: FR: Randomize order of evluation of function of arguments Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: vt at altlinux dot org Target Milestone: --- There is class of bugs when, for example, printf is called with several functions that output to the same static buffer overwriting each others res= ult. This could be hard to detect in legacy code, for example there is nested ca= lls invisible from top level functions, also compiler tend to create the same c= all order, so if overwriting is order dependent it could be undetected for years and appear on some rare architecture when compiler reorder calls [1]. To detect this kind of bugs it would be useful to have compiler option to reorder function arguments evaluation randomly. With this test suites will = have a _chance_ to detect the bugs even on one architecture. [1] https://lore.kernel.org/all/20240323091717.dtsioyvjnhl5dtyv@altlinux.or= g/=