public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tschwinge at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/107231] New: [13 Regression] c-c++-common/goacc/kernels-loop-g.c: '-fcompare-debug' failure (length)
Date: Wed, 12 Oct 2022 09:26:59 +0000	[thread overview]
Message-ID: <bug-107231-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107231
           Summary: [13 Regression] c-c++-common/goacc/kernels-loop-g.c:
                    '-fcompare-debug' failure (length)
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure, openacc
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: erozen at microsoft dot com
            Blocks: 104277
  Target Milestone: ---

In a native x86_64-pc-linux-gnu build, when also running testing with '-m32'
('RUNTESTFLAGS="--target_board=unix\{,-m32\}"') I'm seeing a regression for
'-m32' (but not for default '-m64'):

    [-PASS:-]{+FAIL:+} c-c++-common/goacc/kernels-loop-g.c (test for excess
errors)
    PASS: c-c++-common/goacc/kernels-loop-g.c scan-tree-dump-not parloops1
"FAILED:"
    PASS: c-c++-common/goacc/kernels-loop-g.c scan-tree-dump-times optimized
"(?n);; Function .*main._omp_fn.0" 1
    PASS: c-c++-common/goacc/kernels-loop-g.c scan-tree-dump-times parloops1
"(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\),
oacc kernels, omp target entrypoint, noclone\\)\\)" 1
    PASS: c-c++-common/goacc/kernels-loop-g.c scan-tree-dump-times parloops1
"SUCCESS: may be parallelized" 1

    xgcc: error:
[...]/source-gcc/gcc/testsuite/c-c++-common/goacc/kernels-loop-g.c:
'-fcompare-debug' failure (length)

That's for both C and C++ testing.

Note that this test case is a bit "degenerate" in that it needs
'-fcompare-debug' to compile (safe-guard; refer to PR100400).

Reproduce:

    $ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/
source-gcc/gcc/testsuite/c-c++-common/goacc/kernels-loop-g.c -fopenacc
--param=openacc-kernels=decompose -O2 -g -S -fcompare-debug -m32 -save-temps
    xgcc: error: source-gcc/gcc/testsuite/c-c++-common/goacc/kernels-loop-g.c:
‘-fcompare-debug’ failure (length)
    $ diff -u kernels-loop-g.c.gkd kernels-loop-g.gk.c.gkd
    --- kernels-loop-g.c.gkd        2022-10-12 11:10:24.902809164 +0200
    +++ kernels-loop-g.gk.c.gkd     2022-10-12 11:10:24.950809149 +0200
    @@ -601,7 +601,7 @@
                 (set (reg/v:SI 0 ax [orig:96 i ] [96])
                     (const_int 0 [0]))
                 (clobber (reg:CC 17 flags))
    -        ])
"source-gcc/gcc/testsuite/c-c++-common/goacc/kernels-loop.c":36:21 discrim 3#
{*movsi_xor}
    +        ])
"source-gcc/gcc/testsuite/c-c++-common/goacc/kernels-loop.c":36:21#
{*movsi_xor}
          (expr_list:REG_UNUSED (reg:CC 17 flags)
             (nil)))
     (code_label # 0 0 7 13 (nil) [1 uses])

The issue goes away if I revert commit
r13-3213-g80f414e6d73f9f1683f93d83ce63a6a482e54bee "Fix PR107193", commit
r13-3172-gf30e9fd33e56a5a721346ea6140722e1b193db42 "Set discriminators for call
stmts on the same line within the same basic block".

Alternatively, the issue goes away if I pass '-gno-statement-frontiers' (as I
found in the 'c-c++-common/ubsan/pr85213.c' hunk of commit
r13-2921-gf1adf45b17f7f1ede463524d80032bb2ec866ead "Add instruction level
discriminator support", referring to PR100733 "-fcompare-debug failure for
pr85213.c at -O1 -fdisable-tree-phiopt2").  If you confirm that this is indeed
what should currently be done, I'll push that flag onto
'c-c++-common/goacc/kernels-loop-g.c', for the time being?


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104277
[Bug 104277] [meta-bug] gstatement-frontiers causes fcompare-debug issues

             reply	other threads:[~2022-10-12  9:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  9:26 tschwinge at gcc dot gnu.org [this message]
2022-10-14  7:19 ` [Bug debug/107231] " rguenth at gcc dot gnu.org
2022-11-22 11:55 ` ro at gcc dot gnu.org
2022-12-14 15:53 ` danglin at gcc dot gnu.org
2023-04-26  6:56 ` [Bug debug/107231] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:24 ` rguenth at gcc dot gnu.org
2023-11-09  9:40 ` tschwinge at gcc dot gnu.org
2024-05-13 11:35 ` [Bug debug/107231] [13 " rguenth at gcc dot gnu.org
2024-05-21  9:12 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107231-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).