Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Thomas Koenig Newsgroups: comp.compilers Subject: Re: binary search debugging of compilers Date: Fri, 19 May 2023 21:59:33 -0000 (UTC) Organization: news.netcologne.de Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <23-05-025@comp.compilers> References: <23-05-003@comp.compilers> <23-05-005@comp.compilers> <23-05-006@comp.compilers> <23-05-008@comp.compilers> <23-05-011@comp.compilers> <23-05-012@comp.compilers> <23-05-015@comp.compilers> <23-05-017@comp.compilers> <23-05-020@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="547"; mail-complaints-to="abuse@iecc.com" Keywords: tools, debug Posted-Date: 20 May 2023 18:03:05 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3481 Kaz Kylheku <864-117-4973@kylheku.com> schrieb: > Oh, stepping doubles with ++ is, I would say, not *that* uncommon. > I doubt that if such a bug were introduced as an easter egg into GCC, > it would go very long without being discovered by the FOSS distros and > other downstream users. It would very likely be caught by regression testing. GCC has an extensive test suite, and it is a requirement that this is run before submitting a patch. If that slips through (as can happen from time to time, for example for different architectures or operating systems), then the automated regression testers will flag it. If not that, the automated SPEC testers also have a good chance of catching it. As an aside, the post-increment operator is converted to its equivalent assignment statement very early, during gimplification. In the following example, the result of the first two passes that GCC performs are shown - the first is a reproduction of the source code, as parsed, and the second one after lowering to GIMPLE. File names may differ bit depending on whic version of GCC you use. $ cat double.c double c; void foo() { c++; } $ gcc -c -fdump-tree-original -fdump-tree-gimple double.c $ cat double.c.004t.original ;; Function foo (null) ;; enabled by -tree-original { c++ ; } $ cat double.c.005t.gimple foo () { c.0_1 = c; _2 = c.0_1 + 1.0e+0; c = _2; }