public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception
@ 2022-07-04 19:39 gscfq@t-online.de
  2022-07-04 20:14 ` [Bug tree-optimization/106189] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2022-07-04 19:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106189
           Summary: [10/11/12/13 Regression] ICE: Floating point exception
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r9 at -O2+ and file c-c++-common/Warray-bounds-9.c :


$ gcc-13-20220703 -c Warray-bounds-9.c -O2 -w -Warray-bounds=2
-mfunction-return=keep
during GIMPLE pass: vrp
Warray-bounds-9.c: In function 'a_n_0':
Warray-bounds-9.c:24:12: internal compiler error: Floating point exception
   24 | NOIPA void a_n_0 (int n)
      |            ^~~~~
0xc2cd3f crash_signal
        ../../gcc/toplev.cc:322
0x18092c4 array_bounds_checker::check_mem_ref(unsigned int, tree_node*, bool)
        ../../gcc/gimple-array-bounds.cc:537
0x180a779 array_bounds_checker::check_array_bounds(tree_node**, int*, void*)
        ../../gcc/gimple-array-bounds.cc:727
0xec2a22 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        ../../gcc/tree.cc:11237
0x97fba8 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        ../../gcc/gimple-walk.cc:202
0x1808dd5 check_array_bounds_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/gimple-array-bounds.cc:790
0x17f7a14 dom_walker::walk(basic_block_def*)
        ../../gcc/domwalk.cc:311
0x180a4da array_bounds_checker::check()
        ../../gcc/gimple-array-bounds.cc:804
0xeab6b6 execute_vrp
        ../../gcc/tree-vrp.cc:4234

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

* [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
@ 2022-07-04 20:14 ` pinskia at gcc dot gnu.org
  2022-07-07 12:37 ` [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-04 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization
   Target Milestone|---                         |10.5

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

* [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
  2022-07-04 20:14 ` [Bug tree-optimization/106189] " pinskia at gcc dot gnu.org
@ 2022-07-07 12:37 ` marxin at gcc dot gnu.org
  2022-07-07 12:40 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-07-07 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12/13 Regression]    |[10/11/12/13 Regression]
                   |ICE: Floating point         |ICE: Floating point
                   |exception                   |exception since
                   |                            |r9-1948-gd893b683f40884cd
   Last reconfirmed|                            |2022-07-07
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r9-1948-gd893b683f40884cd.

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

* [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
  2022-07-04 20:14 ` [Bug tree-optimization/106189] " pinskia at gcc dot gnu.org
  2022-07-07 12:37 ` [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd marxin at gcc dot gnu.org
@ 2022-07-07 12:40 ` marxin at gcc dot gnu.org
  2022-07-25 15: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-07-07 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ cat warray-bounds.c
a_n_0_0_a[][0];
a_n_0_0() { T(((char *)a_n_0_0_a)[1]); }

$ gcc  warray-bounds.c -c -O2 -Warray-bounds=2 -w
during GIMPLE pass: vrp
warray-bounds.c: In function ‘a_n_0_0’:
warray-bounds.c:2:1: internal compiler error: Floating point exception
    2 | a_n_0_0() { T(((char *)a_n_0_0_a)[1]); }
      | ^~~~~~~
0xf59efa crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.cc:322
0x7ffff78567bf ???
       
/usr/src/debug/glibc-2.35-5.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x1d1b484 array_bounds_checker::check_mem_ref(unsigned int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/gimple-array-bounds.cc:537
0x1d1baf9 array_bounds_checker::check_array_bounds(tree_node**, int*, void*)
        /home/marxin/Programming/gcc/gcc/gimple-array-bounds.cc:727
0x12662cb walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.cc:11237
0xc4d120 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
        /home/marxin/Programming/gcc/gcc/gimple-walk.cc:202
0x1d19a5a check_array_bounds_dom_walker::before_dom_children(basic_block_def*)
        /home/marxin/Programming/gcc/gcc/gimple-array-bounds.cc:790
0x1d02fe5 dom_walker::walk(basic_block_def*)
        /home/marxin/Programming/gcc/gcc/domwalk.cc:311
0x1d19c9b array_bounds_checker::check()
        /home/marxin/Programming/gcc/gcc/gimple-array-bounds.cc:804
0x123e421 execute_vrp
        /home/marxin/Programming/gcc/gcc/tree-vrp.cc:4235
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-07-07 12:40 ` marxin at gcc dot gnu.org
@ 2022-07-25 15:23 ` rguenth at gcc dot gnu.org
  2022-07-26  6:37 ` 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-07-25 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
           Priority|P3                          |P2
             Status|NEW                         |ASSIGNED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Interestingly

      const offset_int nelts = aref.sizrng[1] / eltsize;

is "happy" because of

  if (divisor == 0)
    overflow = true;

let's do that "trick" for the other case as well.

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

* [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2022-07-25 15:23 ` rguenth at gcc dot gnu.org
@ 2022-07-26  6:37 ` cvs-commit at gcc dot gnu.org
  2022-07-27  9:24 ` [Bug tree-optimization/106189] [10/11/12 " cvs-commit 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-07-26  6:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:bb04f9f23ac0dee2c003118c85372ece50a52220

commit r13-1835-gbb04f9f23ac0dee2c003118c85372ece50a52220
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jul 25 17:24:57 2022 +0200

    tree-optimization/106189 - avoid division by zero exception

    The diagnostic code can end up with zero sized array elements
    with T[][0] and the wide-int code nicely avoids exceptions when
    dividing by zero in one codepath but not in another.  The following
    fixes the exception by using wide-int in both paths.

            PR tree-optimization/106189
            * gimple-array-bounds.cc (array_bounds_checker::check_mem_ref):
            Divide using offset_ints.

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

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

* [Bug tree-optimization/106189] [10/11/12 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2022-07-26  6:37 ` cvs-commit at gcc dot gnu.org
@ 2022-07-27  9:24 ` cvs-commit at gcc dot gnu.org
  2022-10-17 13:28 ` [Bug tree-optimization/106189] [10/11 " cvs-commit at gcc dot gnu.org
  2023-07-07 10:02 ` [Bug tree-optimization/106189] [10 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-27  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 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:5b8458bc35b5df34c1b4b8735975f2686444f6c8

commit r12-8629-g5b8458bc35b5df34c1b4b8735975f2686444f6c8
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jul 25 17:24:57 2022 +0200

    tree-optimization/106189 - avoid division by zero exception

    The diagnostic code can end up with zero sized array elements
    with T[][0] and the wide-int code nicely avoids exceptions when
    dividing by zero in one codepath but not in another.  The following
    fixes the exception by using wide-int in both paths.

            PR tree-optimization/106189
            * gimple-array-bounds.cc (array_bounds_checker::check_mem_ref):
            Divide using offset_ints.

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

    (cherry picked from commit bb04f9f23ac0dee2c003118c85372ece50a52220)

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

* [Bug tree-optimization/106189] [10/11 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2022-07-27  9:24 ` [Bug tree-optimization/106189] [10/11/12 " cvs-commit at gcc dot gnu.org
@ 2022-10-17 13:28 ` cvs-commit at gcc dot gnu.org
  2023-07-07 10:02 ` [Bug tree-optimization/106189] [10 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-17 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:9124675d2771aaf573bfbbe237ab28030bf3115d

commit r11-10316-g9124675d2771aaf573bfbbe237ab28030bf3115d
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jul 25 17:24:57 2022 +0200

    tree-optimization/106189 - avoid division by zero exception

    The diagnostic code can end up with zero sized array elements
    with T[][0] and the wide-int code nicely avoids exceptions when
    dividing by zero in one codepath but not in another.  The following
    fixes the exception by using wide-int in both paths.

            PR tree-optimization/106189
            * gimple-array-bounds.cc (array_bounds_checker::check_mem_ref):
            Divide using offset_ints.

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

    (cherry picked from commit bb04f9f23ac0dee2c003118c85372ece50a52220)

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

* [Bug tree-optimization/106189] [10 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd
  2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2022-10-17 13:28 ` [Bug tree-optimization/106189] [10/11 " cvs-commit at gcc dot gnu.org
@ 2023-07-07 10:02 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |10.5.0
   Target Milestone|10.5                        |11.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
fixed.

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 19:39 [Bug c/106189] New: [10/11/12/13 Regression] ICE: Floating point exception gscfq@t-online.de
2022-07-04 20:14 ` [Bug tree-optimization/106189] " pinskia at gcc dot gnu.org
2022-07-07 12:37 ` [Bug tree-optimization/106189] [10/11/12/13 Regression] ICE: Floating point exception since r9-1948-gd893b683f40884cd marxin at gcc dot gnu.org
2022-07-07 12:40 ` marxin at gcc dot gnu.org
2022-07-25 15:23 ` rguenth at gcc dot gnu.org
2022-07-26  6:37 ` cvs-commit at gcc dot gnu.org
2022-07-27  9:24 ` [Bug tree-optimization/106189] [10/11/12 " cvs-commit at gcc dot gnu.org
2022-10-17 13:28 ` [Bug tree-optimization/106189] [10/11 " cvs-commit at gcc dot gnu.org
2023-07-07 10:02 ` [Bug tree-optimization/106189] [10 " 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).