public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/100733] New: -fcompare-debug failure for pr85213.c at -O1 -fdisable-tree-phiopt2
@ 2021-05-23 17:20 pinskia at gcc dot gnu.org
  2021-05-23 17:21 ` [Bug middle-end/100733] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-05-23 17:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100733

            Bug ID: 100733
           Summary: -fcompare-debug failure for pr85213.c at -O1
                    -fdisable-tree-phiopt2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-debug
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

So while modifying phi-opt, I ran into pr85213.c testcase failing with the C++
front-end. BUT the problem is not related at all to PHI-OPT changes as the IR
coming out of the front-end is hugely different with and without debug
information turned on.

Without debug info turned on we start with:
NON_LVALUE_EXPR <SAVE_EXPR <-(__builtin_expect ((long int) (x == 0), 3) == 0)>
>;

But with:
NON_LVALUE_EXPR <SAVE_EXPR <-(__builtin_expect (# DEBUG BEGIN STMT;
x != 0; ? 0 : 1, 3) == 0)>>


It just happens with the PHI-OPT, by the time we get to expand, the IR is very
similar BUT the difference comes from SSA names are different.

You can reproduce the failure on the trunk without any patches to PHI-OPT by
doing:
g++ -O1 -fsanitize=undefined -fcompare-debug -fdisable-tree-phiopt2
c-c++-common/ubsan/pr85213.c

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-07 10:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 17:20 [Bug middle-end/100733] New: -fcompare-debug failure for pr85213.c at -O1 -fdisable-tree-phiopt2 pinskia at gcc dot gnu.org
2021-05-23 17:21 ` [Bug middle-end/100733] " pinskia at gcc dot gnu.org
2021-05-24 11:09 ` jakub at gcc dot gnu.org
2021-05-24 11:11 ` [Bug middle-end/100733] [8/9/10/11/12 Regression] " jakub at gcc dot gnu.org
2021-05-25  7:33 ` rguenth at gcc dot gnu.org
2021-06-01  8:20 ` rguenth at gcc dot gnu.org
2022-05-27  9:45 ` [Bug middle-end/100733] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:45 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug middle-end/100733] [11/12/13/14 " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).