public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
@ 2022-06-23  6:44 marxin at gcc dot gnu.org
  2022-06-23  6:44 ` [Bug c++/106062] " marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-23  6:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106062
           Summary: [13 Regression] ICE in build_builtin_unreachable since
                    r13-1204-gd68d366425369649
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---

Since the revision the following fails:

$ cat loop.f90
call test (reshape ((/ 'a', 'b', 'c', 'd' /), (/ 2, 2 /)))
contains
  subroutine test (a)
    character (*), dimension (:, :) :: a
    if (len (a) .ne. 1) STOP 
  end  
end

$ gcc loop.f90 -fsanitize=unreachable -O2 -c
during GIMPLE pass: einline
loop.f90:1:58:

    1 | call test (reshape ((/ 'a', 'b', 'c', 'd' /), (/ 2, 2 /)))
      |                                                          ^
internal compiler error: Segmentation fault
0xfe3e1a crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.cc:322
0x7ffff78567bf ???
       
/usr/src/debug/glibc-2.35-4.2.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x12d6c45 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3629
0x12d6c45 build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**)
        /home/marxin/Programming/gcc/gcc/tree.cc:10634
0x12d6da0 build_call_expr_loc(unsigned int, tree_node*, int, ...)
        /home/marxin/Programming/gcc/gcc/tree.cc:10667
0x12d6de8 build_builtin_unreachable(unsigned int)
        /home/marxin/Programming/gcc/gcc/tree.cc:10819
0xac0aad fold_builtin_0
        /home/marxin/Programming/gcc/gcc/builtins.cc:9270
0xac0aad fold_builtin_n
        /home/marxin/Programming/gcc/gcc/builtins.cc:9578
0xac31a2 fold_call_stmt(gcall*, bool)
        /home/marxin/Programming/gcc/gcc/builtins.cc:10836
0xcb7c34 gimple_fold_builtin
        /home/marxin/Programming/gcc/gcc/gimple-fold.cc:5151
0xcb7c34 gimple_fold_call
        /home/marxin/Programming/gcc/gcc/gimple-fold.cc:5551
0xcba373 fold_stmt_1
        /home/marxin/Programming/gcc/gcc/gimple-fold.cc:6295
0x1066af8 fold_marked_statements
        /home/marxin/Programming/gcc/gcc/tree-inline.cc:5366
0x107afd3 optimize_inline_calls(tree_node*)
        /home/marxin/Programming/gcc/gcc/tree-inline.cc:5514
0x1e6077f early_inliner(function*)
        /home/marxin/Programming/gcc/gcc/ipa-inline.cc:3038
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.

Can be fixed with:

 gcc/ubsan.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ubsan.cc b/gcc/ubsan.cc
index f15026872a1..b6c4301dfaf 100644
--- a/gcc/ubsan.cc
+++ b/gcc/ubsan.cc
@@ -654,9 +654,10 @@ sanitize_unreachable_fn (tree *data, location_t loc)
     }
   else if (san)
     {
-      fn = builtin_decl_explicit (BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE);
+      /* Call ubsan_create_data first as it initializes SANITIZER built-ins. 
*/
       *data = ubsan_create_data ("__ubsan_unreachable_data", 1, &loc,
                                 NULL_TREE, NULL_TREE);
+      fn = builtin_decl_explicit (BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE);
       *data = build_fold_addr_expr_loc (loc, *data);
     }
   else

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

* [Bug c++/106062] [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
  2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
@ 2022-06-23  6:44 ` marxin at gcc dot gnu.org
  2022-06-23 12:18 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-23  6:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-06-23
   Target Milestone|---                         |13.0
     Ever confirmed|0                           |1

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

* [Bug c++/106062] [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
  2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
  2022-06-23  6:44 ` [Bug c++/106062] " marxin at gcc dot gnu.org
@ 2022-06-23 12:18 ` jakub at gcc dot gnu.org
  2022-06-23 12:45 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-23 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Patch preapproved.

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

* [Bug c++/106062] [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
  2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
  2022-06-23  6:44 ` [Bug c++/106062] " marxin at gcc dot gnu.org
  2022-06-23 12:18 ` jakub at gcc dot gnu.org
@ 2022-06-23 12:45 ` marxin at gcc dot gnu.org
  2022-06-23 13:30 ` cvs-commit at gcc dot gnu.org
  2022-06-23 13:30 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-23 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org

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

* [Bug c++/106062] [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
  2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-06-23 12:45 ` marxin at gcc dot gnu.org
@ 2022-06-23 13:30 ` cvs-commit at gcc dot gnu.org
  2022-06-23 13:30 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-23 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:8a15cd3396aa08dc2633982481fe392af0aa9e78

commit r13-1217-g8a15cd3396aa08dc2633982481fe392af0aa9e78
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Jun 23 14:43:50 2022 +0200

    c++: properly initialize UBSAN built-ins

            PR c++/106062

    gcc/ChangeLog:

            * ubsan.cc (sanitize_unreachable_fn): Change order of calls
            in order to initialize UBSAN built-ins.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/ubsan/pr106062.f90: New test.

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

* [Bug c++/106062] [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649
  2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-06-23 13:30 ` cvs-commit at gcc dot gnu.org
@ 2022-06-23 13:30 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-06-23 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-06-23 13:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23  6:44 [Bug c++/106062] New: [13 Regression] ICE in build_builtin_unreachable since r13-1204-gd68d366425369649 marxin at gcc dot gnu.org
2022-06-23  6:44 ` [Bug c++/106062] " marxin at gcc dot gnu.org
2022-06-23 12:18 ` jakub at gcc dot gnu.org
2022-06-23 12:45 ` marxin at gcc dot gnu.org
2022-06-23 13:30 ` cvs-commit at gcc dot gnu.org
2022-06-23 13:30 ` marxin 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).