Bug 57737 - -fopenmp + -femit-struct-debug-reduced/baseonly = internal compiler error: Segmentation fault
Summary: -fopenmp + -femit-struct-debug-reduced/baseonly = internal compiler error: Se...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.7.2
: P3 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 17:27 UTC by Evgeny Gavrin
Modified: 2017-04-18 15:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
File to reproduce bug (702 bytes, text/x-csrc)
2013-06-27 17:27 UTC, Evgeny Gavrin
Details
preprocessed file (456 bytes, text/plain)
2013-06-27 17:28 UTC, Evgeny Gavrin
Details
preprocessed file (455 bytes, text/plain)
2013-06-27 17:29 UTC, Evgeny Gavrin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Gavrin 2013-06-27 17:27:13 UTC
Created attachment 30392 [details]
File to reproduce bug

Compilation of debug-1.c file from ./libgomp/testsuite with the following options: -g -fopenmp -O0 -gdwarf-2 -femit-struct-debug-reduced - causes segfault in the compiler.

The described bug is actual for GCC versions 4.4, 4.6, 4.7.
Works for -femit-struct-debug-reduced and -femit-struct-debug-baseonly

I've attached both problem example and preprocessed file to the report.

Console logs: 

egavrin@debian:~/dev/vd-issues/report-omp-failtest$ gcc-4.7 -g -fopenmp -O0 -gdwarf-2 -femit-struct-debug-baseonly ./debug-1.c
./debug-1.c: In function ‘f7._omp_fn.0’:
./debug-1.c:136:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccWoFu5C.out file, please attach this to your bugreport.

egavrin@debian:~/dev/vd-issues/report-omp-failtest$ gcc-4.7 -g -fopenmp -O0 -gdwarf-2 -femit-struct-debug-reduced ./debug-1.c
./debug-1.c: In function ‘f7._omp_fn.0’:
./debug-1.c:136:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccw1Cilr.out file, please attach this to your bugreport.

Host system info:
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
Comment 1 Evgeny Gavrin 2013-06-27 17:28:53 UTC
Created attachment 30393 [details]
preprocessed file
Comment 2 Evgeny Gavrin 2013-06-27 17:29:18 UTC
Created attachment 30394 [details]
preprocessed file
Comment 3 Evgeny Gavrin 2013-07-01 15:37:33 UTC
I've added crash log:

/cc1 debug-1.c -fopenmp -gdwarf-2 -femit-struct-debug-reduced
 f7 main
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups> <*free_inline_summary> <whole-program>Assembling functions:
 f7 main f7._omp_fn.0
debug-1.c: In function ‘f7._omp_fn.0’:
debug-1.c:133:11: internal compiler error: Segmentation fault
   #pragma omp parallel
           ^
0xe80a4c crash_signal
	/home/egavrin/dev/gcc/gcc/toplev.c:333
0x536597 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*)
	/home/egavrin/dev/gcc/gcc/tree.h:3909
0x85df13 should_emit_struct_debug
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:371
0x8ab513 gen_struct_or_union_type_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:19172
0x8acdcb gen_tagged_type_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:19415
0x8ada45 gen_type_die_with_usage
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:19562
0x8ad71e gen_type_die_with_usage
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:19518
0x8adcce gen_type_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:19601
0x8b16be gen_decl_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:20188
0x8a532a gen_subprogram_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:18063
0x8b0cfd gen_decl_die
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:20102
0x8b2b42 dwarf2out_decl(tree_node*)
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:20484
0x8b2b85 dwarf2out_function_decl
	/home/egavrin/dev/gcc/gcc/dwarf2out.c:20492
0x96c0b6 rest_of_handle_final
	/home/egavrin/dev/gcc/gcc/final.c:4393
Comment 4 Martin Liška 2017-04-18 15:14:24 UTC
I can confirmed that it used to ICE for old releases. However, 4.9.0+ works fine, as well as all active branches. Thus closing as resolved.