public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
@ 2022-05-17 15:24 asolokha at gmx dot com
  2022-05-18 11:49 ` [Bug debug/105630] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2022-05-17 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105630
           Summary: [10/11/12/13 Regression] '-fcompare-debug' failure w/
                    -O1 -ftree-parallelize-loops=2
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: compare-debug-failure
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: aarch64-linux-gnu

gcc 13.0.0 20220515 snapshot (g:18547874ee205d830acb31f1e3c1c89fc7725c14) fails
-fcompare-debug check when compiling the following testcase w/ -O1
-ftree-parallelize-loops=2:

int m;
static int n;

void
foo (void)
{
  int *arr[] = { &n, &n, &n };
  int unused = n;

  m = 0;
}

void
bar (int *arr, int i)
{
  while (i < 1)
    arr[i++] = 1;
}

aarch64-linux-gnu-gcc-13.0.0 -O1 -fcompare-debug -ftree-parallelize-loops=2 -c
fjosrfpk.c
aarch64-linux-gnu-gcc-13.0.0: error: fjosrfpk.c: '-fcompare-debug' failure

--- fjosrfpk.c.gkd
+++ fjosrfpk.gk.c.gkd
@@ -360,7 +360,7 @@
 1:   int i;
 2:   signed int D.xxxx;

-;; Function bar._loopfn.0 (bar._loopfn.0, funcdef_no=2, cgraph_uid=3,
symbol_order=5)
+;; Function bar._loopfn.0 (bar._loopfn.0, funcdef_no=2, cgraph_uid=3,
symbol_order=6)

 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)

It was originally reported in PR105415 comment 8.

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

* [Bug debug/105630] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
@ 2022-05-18 11:49 ` jakub at gcc dot gnu.org
  2022-05-18 12:37 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-18 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, the difference between this and PR105415 is that here the VAR_DECL n has
DECL_RTL set, so we don't go through
      /* This decl was probably optimized away.  */
      if (!op0
          /* At least label RTXen are sometimes replaced by
             NOTE_INSN_DELETED_LABEL.  Any notes here are not
             handled by copy_rtx.  */
          || NOTE_P (op0))
        {
          if (!VAR_P (exp)
              || DECL_EXTERNAL (exp)
              || !TREE_STATIC (exp)
              || !DECL_NAME (exp)
              || DECL_HARD_REGISTER (exp)
              || DECL_IN_CONSTANT_POOL (exp)
              || mode == VOIDmode
              || symtab_node::get (exp) == NULL)
            return NULL;

          op0 = make_decl_rtl_for_debug (exp);
          if (!MEM_P (op0)
              || GET_CODE (XEXP (op0, 0)) != SYMBOL_REF
              || SYMBOL_REF_DECL (XEXP (op0, 0)) != exp)
            return NULL;
        }
because op0 is non-NULL, so we go with
      else
        op0 = copy_rtx (op0);
instead.
So perhaps something like:
      else if (VAR_P (exp)
               && is_global_var (exp)
               && symtab_node::get (exp) == NULL)
        return NULL;
before the else or so?
But, we'll need to compare the effects on debug info with that change too.

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

* [Bug debug/105630] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
  2022-05-18 11:49 ` [Bug debug/105630] " jakub at gcc dot gnu.org
@ 2022-05-18 12:37 ` rguenth at gcc dot gnu.org
  2022-05-19  9:58 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-18 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4

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

* [Bug debug/105630] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
  2022-05-18 11:49 ` [Bug debug/105630] " jakub at gcc dot gnu.org
  2022-05-18 12:37 ` rguenth at gcc dot gnu.org
@ 2022-05-19  9:58 ` cvs-commit at gcc dot gnu.org
  2022-05-19  9:59 ` [Bug debug/105630] [10/11/12 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-19  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:213cfa8d0a9d0bb28bd973323ee2055ee6699d86

commit r13-631-g213cfa8d0a9d0bb28bd973323ee2055ee6699d86
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu May 19 11:58:15 2022 +0200

    cfgexpand: Yet another spot with debug insns references to global vars
without varpool nodes [PR105630]

    This is similar to the earlier patch to avoid having MEM_EXPRs
    referencing global vars without varpool nodes, but this time
    the difference is that during gimplification some hashing
    actually created DECL_RTLs for the n VAR_DECL and the previous
    change was in the if above this when DECL_RTL is NULL and we are
    considering creating it.

    The following patch drops on the floor references to vars where
    we've optimized away the varpool node even when it has DECL_RTL.

    Bootstrapped/regtested on x86_64-linux and i686-linux, plus
    bootstrapped on those without the cfgexpand.cc change, reapplied
    it and rebuilt stage3 cc1/cc1plus, the resulting cc1/cc1plus
    binaries on both targets were identical except for the 16-byte
    executable_checksum (I've done the second bootstraps in the same
    directory as the first one after moving the previous one elsewhere,
    so pathnames were the same, just checksum hasn't been regenerated).
    So, at least on those binaries this patch doesn't affect debug info
    at all.

    2022-05-19  Jakub Jelinek  <jakub@redhat.com>

            PR debug/105630
            * cfgexpand.cc (expand_debug_expr): For VAR_DECL, punt for
            global vars without symtab node even when they have DECL_RTL
            set.

            * gcc.dg/pr105630.c: New test.

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

* [Bug debug/105630] [10/11/12 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-05-19  9:58 ` cvs-commit at gcc dot gnu.org
@ 2022-05-19  9:59 ` jakub at gcc dot gnu.org
  2022-06-28 10:49 ` jakub at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug middle-end/105630] [11/12 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-19  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-05-19
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
            Summary|[10/11/12/13 Regression]    |[10/11/12 Regression]
                   |'-fcompare-debug' failure   |'-fcompare-debug' failure
                   |w/ -O1                      |w/ -O1
                   |-ftree-parallelize-loops=2  |-ftree-parallelize-loops=2

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.  Like the other PR, most likely not going to be
backported.

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

* [Bug debug/105630] [10/11/12 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-05-19  9:59 ` [Bug debug/105630] [10/11/12 " jakub at gcc dot gnu.org
@ 2022-06-28 10:49 ` jakub at gcc dot gnu.org
  2023-07-07 10:43 ` [Bug middle-end/105630] [11/12 " rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug middle-end/105630] [11/12 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2
  2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-06-28 10:49 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:43 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 15:24 [Bug debug/105630] New: [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2 asolokha at gmx dot com
2022-05-18 11:49 ` [Bug debug/105630] " jakub at gcc dot gnu.org
2022-05-18 12:37 ` rguenth at gcc dot gnu.org
2022-05-19  9:58 ` cvs-commit at gcc dot gnu.org
2022-05-19  9:59 ` [Bug debug/105630] [10/11/12 " jakub at gcc dot gnu.org
2022-06-28 10:49 ` jakub at gcc dot gnu.org
2023-07-07 10:43 ` [Bug middle-end/105630] [11/12 " 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).