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

            Bug ID: 121621
           Summary: [16 regression] SEGV compiling
                    gfortran.dg/gomp/pr77665.f90
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
            Target: sparc-sun-solaris2.11

Between 20250819 (f647d4f58a968079c342a0a3f7e71444d3836614) and 20250820
(39acf3c9dd767626b422843adb8f5be06206af08),
a couple of tests started to FAIL on Solaris/SPARC (both 32 and 64-bit):

+FAIL: gfortran.dg/gomp/pr77665.f90   -O  (internal compiler error:
Segmentation Fault)
+FAIL: gfortran.dg/gomp/pr77665.f90   -O  (test for excess errors)

+FAIL: libgomp.fortran/simd1.f90   -O0  (internal compiler error: Segmentation
Fault)
+FAIL: libgomp.fortran/simd1.f90   -O0  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -O0  compilation failed to produce
executable
+FAIL: libgomp.fortran/simd1.f90   -O1  (internal compiler error: Segmentation
Fault)
+FAIL: libgomp.fortran/simd1.f90   -O1  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -O1  compilation failed to produce
executable
+FAIL: libgomp.fortran/simd1.f90   -O2  (internal compiler error: Segmentation
Fault)
+FAIL: libgomp.fortran/simd1.f90   -O2  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -O2  compilation failed to produce
executable
+FAIL: libgomp.fortran/simd1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error:
Segmentation Fault)
+FAIL: libgomp.fortran/simd1.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  compilation failed to
produce executable
+FAIL: libgomp.fortran/simd1.f90   -O3 -g  (internal compiler error:
Segmentation Fault)
+FAIL: libgomp.fortran/simd1.f90   -O3 -g  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -O3 -g  compilation failed to produce
executable
+FAIL: libgomp.fortran/simd1.f90   -Os  (internal compiler error: Segmentation
Fault)
+FAIL: libgomp.fortran/simd1.f90   -Os  (test for excess errors)
+UNRESOLVED: libgomp.fortran/simd1.f90   -Os  compilation failed to produce
executable

The failure seems to be always the same:

/vol/gcc/src/hg/master/local/gcc/testsuite/gfortran.dg/gomp/pr77665.f90:12:27:
internal compiler error: Segmentation Fault
0x227d2d7 internal_error(char const*, ...)
        /vol/gcc/src/hg/master/local/gcc/diagnostic-global-context.cc:534
0x11ed14f crash_signal
        /vol/gcc/src/hg/master/local/gcc/toplev.cc:323
0xdbde5c vec<omp_mapping_group, va_heap, vl_embed>::operator[](unsigned int)
        /vol/gcc/src/hg/master/local/gcc/vec.h:911
0xdbde5c vec<omp_mapping_group, va_heap, vl_ptr>::operator[](unsigned int)
        /vol/gcc/src/hg/master/local/gcc/vec.h:1610
0xdbde5c gimplify_scan_omp_clauses
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:14003
0xde73bb gimplify_omp_for
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:17140
0xdc4a4b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20796
0xdc65cf gimplify_stmt(tree_node**, gimple**)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
0xdc48db gimplify_statement_list
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:2292
0xdc48db gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20732
0xdc65cf gimplify_stmt(tree_node**, gimple**)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
0xdc7643 gimplify_bind_expr
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:1687
0xdc39e7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20482
0xdf656b gimplify_stmt(tree_node**, gimple**)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
0xdf656b gimplify_body(tree_node*, bool)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:21588
0xdf6ce3 gimplify_function_tree(tree_node*)
        /vol/gcc/src/hg/master/local/gcc/gimplify.cc:21797
0xb2b96b cgraph_node::analyze()
        /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:689
0xb2f673 analyze_functions
        /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:1265
0xb30d57 symbol_table::finalize_compilation_unit()
        /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2575

It can be reproduce as easily as

$ f951 /pr77665.f90 -quiet -fopenmp -o pr77665.s

gdb shows

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x00dbde5c in vec<omp_mapping_group, va_heap, vl_embed>::operator[] (
    this=<optimized out>, ix=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:14003
14003                 grp_end = (*groups)[grpnum].grp_end;
1: x/i $pc
=> 0xdbde5c <gimplify_scan_omp_clauses(tree*, gimple_seq*, omp_region_type,
tree_code, gimple_seq*)+13852>:     ld  [ %g1 ], %g2
(gdb) bt
#0  0x00dbde5c in vec<omp_mapping_group, va_heap, vl_embed>::operator[] (
    this=<optimized out>, ix=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:14003
#1  vec<omp_mapping_group, va_heap, vl_ptr>::operator[] (this=<optimized out>, 
    ix=<optimized out>) at /vol/gcc/src/hg/master/local/gcc/vec.h:1610
#2  gimplify_scan_omp_clauses (list_p=0xfac3638c, pre_p=<optimized out>, 
    region_type=<optimized out>, code=OMP_SIMD, loops_seq_p=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:14003
#3  0x00de73bc in gimplify_omp_for (expr_p=<optimized out>, 
    pre_p=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:17140
#4  0x00dc4a4c in gimplify_expr (expr_p=0xfac338f8, pre_p=<optimized out>, 
    post_p=<optimized out>, gimple_test_f=<optimized out>, fallback=0)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20796
#5  0x00dc65d0 in gimplify_stmt (stmt_p=0xfac338f8, seq_p=0xffbfe730)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
#6  0x00dc48dc in gimplify_statement_list (expr_p=0xfac8438c, pre_p=0xffbfe730)
    at /vol/gcc/src/hg/master/local/gcc/tree-iterator.h:48
#7  gimplify_expr (expr_p=0xfac8438c, pre_p=<optimized out>, 
    post_p=<optimized out>, gimple_test_f=<optimized out>, fallback=0)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20732
#8  0x00dc65d0 in gimplify_stmt (stmt_p=0xfac8438c, seq_p=0xffbfe730)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
#9  0x00dc7644 in gimplify_bind_expr (expr_p=0xfac803a4, pre_p=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/tree.h:4298
#10 0x00dc39e8 in gimplify_expr (expr_p=0xfac803a4, pre_p=<optimized out>, 
    post_p=<optimized out>, gimple_test_f=<optimized out>, fallback=0)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:20482
#11 0x00df656c in gimplify_stmt (stmt_p=0xfac803a4, seq_p=0xffbfe8f0)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:8572
#12 gimplify_body (fndecl=<function_decl 0xfac80320 pr77665>, 
    do_parms=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:21588
#13 0x00df6ce4 in gimplify_function_tree (
    fndecl=<function_decl 0xfac80320 pr77665>)
    at /vol/gcc/src/hg/master/local/gcc/gimplify.cc:21797
#14 0x00b2b96c in cgraph_node::analyze (
    this=<cgraph_node * const 0xfac803c0 "pr77665"/0>)
    at /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:689
#15 0x00b2f674 in analyze_functions (first_time=<optimized out>)
    at /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:1265
#16 0x00b30d58 in symbol_table::finalize_compilation_unit (this=0xfac12000)
    at /vol/gcc/src/hg/master/local/gcc/cgraphunit.cc:2575
#17 0x011edaa0 in compile_file ()
    at /vol/gcc/src/hg/master/local/gcc/toplev.cc:480
#18 0x011f16a4 in do_compile ()
    at /vol/gcc/src/hg/master/local/gcc/toplev.cc:2222
#19 toplev::main (this=<optimized out>, argc=<optimized out>, 
    argv=<optimized out>) at /vol/gcc/src/hg/master/local/gcc/toplev.cc:2385
#20 0x02251044 in main (argc=6, argv=0xffbfed74)
    at /vol/gcc/src/hg/master/local/gcc/main.cc:39

No commit in that range stands out to me as the possible culprit.

Reply via email to