public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use)
@ 2022-05-03  7:12 asolokha at gmx dot com
  2022-05-03  7:50 ` [Bug tree-optimization/105461] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2022-05-03  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105461
           Summary: ICE: Segmentation fault (in verify_use)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-checking, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

Created attachment 52918
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52918&action=edit
Testcase

gcc 12.0.1 20220424 snapshot (g:6b7441a46c771aa6ecdc0c8ed96197417d036b9a) ICEs
when compiling the attached testcase w/ -O2 -fassociative-math -fsignaling-nans
-fvar-tracking:

% x86_64-unknown-linux-gnu-gcc-12.0.1 -O2 -fassociative-math -fsignaling-nans
-fvar-tracking -w -c iqhddjm7.c
during GIMPLE pass: dse
iqhddjm7.c: In function 'foo':
iqhddjm7.c:13:1: internal compiler error: Segmentation fault
   13 | //     
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/toplev.cc:322
      | ^
0xed365f crash_signal
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/toplev.cc:322
0x111c92d verify_use
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/tree-ssa.cc:881
0x1120828 verify_ssa(bool, bool)
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/tree-ssa.cc:1164
0xde0b6d execute_function_todo
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/passes.cc:2092
0xde0f9e execute_todo
       
/var/tmp/portage/sys-devel/gcc-12.0.1_p20220424/work/gcc-12-20220424/gcc/passes.cc:2139

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

* [Bug tree-optimization/105461] ICE: Segmentation fault (in verify_use)
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
@ 2022-05-03  7:50 ` rguenth at gcc dot gnu.org
  2022-05-03  8:14 ` [Bug tree-optimization/105461] [12/13 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-03  7:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-05-03
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use)
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
  2022-05-03  7:50 ` [Bug tree-optimization/105461] " rguenth at gcc dot gnu.org
@ 2022-05-03  8:14 ` rguenth at gcc dot gnu.org
  2022-05-03  8:18 ` [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4 marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-03  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection
            Summary|ICE: Segmentation fault (in |[12/13 Regression] ICE:
                   |verify_use)                 |Segmentation fault (in
                   |                            |verify_use)
   Target Milestone|---                         |12.0
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, we have

<bb 2> :
_6 = (float) y_3(D);
*x_2(D) = _6;
_7 = (int) _6;
# DEBUG a => _7
return;

but !MAY_HAVE_DEBUG_BIND_STMTS is true.  It looks like a bug in option
save/restore refactoring.  In GCC 11 we disabled -fvar-tracking when -g
is not enabled, diagnosing the mismatch but that's no longer done.

Instead we now do

  /* Note -fvar-tracking is enabled automatically with OPT_LEVELS_1_PLUS and
     so we need to drop it if we are called from optimize attribute.  */
  if (debug_info_level == DINFO_LEVEL_NONE
      && !OPTION_SET_P (flag_var_tracking))
    flag_var_tracking = false;

while the code still present in toplev.cc does

  /* We know which debug output will be used so we can set flag_var_tracking
     and flag_var_tracking_uninit if the user has not specified them.  */
  if (debug_info_level < DINFO_LEVEL_NORMAL
      || !dwarf_debuginfo_p ()
      || debug_hooks->var_location == do_nothing_debug_hooks.var_location)
    {
      if ((OPTION_SET_P (flag_var_tracking) && flag_var_tracking == 1)
          || (OPTION_SET_P (flag_var_tracking_uninit)
              && flag_var_tracking_uninit == 1))
        {
          if (debug_info_level < DINFO_LEVEL_NORMAL)
            warning_at (UNKNOWN_LOCATION, 0,
                        "variable tracking requested, but useless unless "
                        "producing debug info");
          else
            warning_at (UNKNOWN_LOCATION, 0,
                        "variable tracking requested, but not supported "
                        "by this debug format");
        }
      flag_var_tracking = 0;
      flag_var_tracking_uninit = 0;
      flag_var_tracking_assignments = 0;

that's inconsistent I guess (the toplev.c code doesn't alter the OPTIONS_SET
set.

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

* [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
  2022-05-03  7:50 ` [Bug tree-optimization/105461] " rguenth at gcc dot gnu.org
  2022-05-03  8:14 ` [Bug tree-optimization/105461] [12/13 Regression] " rguenth at gcc dot gnu.org
@ 2022-05-03  8:18 ` marxin at gcc dot gnu.org
  2022-05-03  8:23 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-05-03  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12/13 Regression] ICE:     |[12/13 Regression] ICE:
                   |Segmentation fault (in      |Segmentation fault (in
                   |verify_use)                 |verify_use) since
                   |                            |r12-4608-gb4702276615ff8d4
           Keywords|needs-bisection             |

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with mine r12-4608-gb4702276615ff8d4.

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

* [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2022-05-03  8:18 ` [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4 marxin at gcc dot gnu.org
@ 2022-05-03  8:23 ` rguenth at gcc dot gnu.org
  2022-05-03 10:33 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-03  8:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/toplev.cc b/gcc/toplev.cc
index ed546b2cad8..60497845dfe 100644
--- a/gcc/toplev.cc
+++ b/gcc/toplev.cc
@@ -1478,6 +1478,7 @@ process_options (bool no_backend)
                        "by this debug format");
        }
       flag_var_tracking = 0;
+      OPTION_SET_P (flag_var_tracking) = 0;
       flag_var_tracking_uninit = 0;
       flag_var_tracking_assignments = 0;
     }

fixes the issue.  Note finish_options uses global_options_set in a few places
but fixing that doesn't fix the issue here.  I'm going to fix that separately.

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

* [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2022-05-03  8:23 ` rguenth at gcc dot gnu.org
@ 2022-05-03 10:33 ` cvs-commit at gcc dot gnu.org
  2022-05-06  8:33 ` [Bug tree-optimization/105461] [12 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-03 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:6b4cc784806ac8676a08ecbbeadbd1bfa56073bb

commit r13-83-g6b4cc784806ac8676a08ecbbeadbd1bfa56073bb
Author: Richard Biener <rguenther@suse.de>
Date:   Tue May 3 10:36:30 2022 +0200

    middle-end/105461 - opts processing of -fvar-tracking

    The flag_var_tracking reset in finish_options doesn't match the
    condition in process_options, in particular we fail to reset it
    when the option was specified on the command line.  The following
    fixes this and also alters the debug info level guard to match
    the one in process_options.

    2022-05-03  Richard Biener  <rguenther@suse.de>

            PR middle-end/105461
            * opts.cc (finish_options): Match the condition to
            disable flag_var_tracking to that of process_options.

            * gcc.dg/pr105461.c: New testcase.

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

* [Bug tree-optimization/105461] [12 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2022-05-03 10:33 ` cvs-commit at gcc dot gnu.org
@ 2022-05-06  8:33 ` jakub at gcc dot gnu.org
  2022-05-06  9:28 ` cvs-commit at gcc dot gnu.org
  2022-05-06  9:29 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.0                        |12.2

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 12.1 is being released, retargeting bugs to GCC 12.2.

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

* [Bug tree-optimization/105461] [12 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2022-05-06  8:33 ` [Bug tree-optimization/105461] [12 " jakub at gcc dot gnu.org
@ 2022-05-06  9:28 ` cvs-commit at gcc dot gnu.org
  2022-05-06  9:29 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-06  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:1b13a6e0dc2f61fc26ebfd33ee8549da45286f34

commit r12-8344-g1b13a6e0dc2f61fc26ebfd33ee8549da45286f34
Author: Richard Biener <rguenther@suse.de>
Date:   Tue May 3 10:36:30 2022 +0200

    middle-end/105461 - opts processing of -fvar-tracking

    The flag_var_tracking reset in finish_options doesn't match the
    condition in process_options, in particular we fail to reset it
    when the option was specified on the command line.  The following
    fixes this and also alters the debug info level guard to match
    the one in process_options.

    2022-05-03  Richard Biener  <rguenther@suse.de>

            PR middle-end/105461
            * opts.cc (finish_options): Match the condition to
            disable flag_var_tracking to that of process_options.

            * gcc.dg/pr105461.c: New testcase.

    (cherry picked from commit 6b4cc784806ac8676a08ecbbeadbd1bfa56073bb)

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

* [Bug tree-optimization/105461] [12 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4
  2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2022-05-06  9:28 ` cvs-commit at gcc dot gnu.org
@ 2022-05-06  9:29 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-06  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.1.1
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |12.1.0

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-05-06  9:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  7:12 [Bug tree-optimization/105461] New: ICE: Segmentation fault (in verify_use) asolokha at gmx dot com
2022-05-03  7:50 ` [Bug tree-optimization/105461] " rguenth at gcc dot gnu.org
2022-05-03  8:14 ` [Bug tree-optimization/105461] [12/13 Regression] " rguenth at gcc dot gnu.org
2022-05-03  8:18 ` [Bug tree-optimization/105461] [12/13 Regression] ICE: Segmentation fault (in verify_use) since r12-4608-gb4702276615ff8d4 marxin at gcc dot gnu.org
2022-05-03  8:23 ` rguenth at gcc dot gnu.org
2022-05-03 10:33 ` cvs-commit at gcc dot gnu.org
2022-05-06  8:33 ` [Bug tree-optimization/105461] [12 " jakub at gcc dot gnu.org
2022-05-06  9:28 ` cvs-commit at gcc dot gnu.org
2022-05-06  9:29 ` 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).