https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97757
Bug ID: 97757
Summary: [11 Regression] fortran save_6.f90 fails with a segv
for -flto -O >= 2
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: iains at gcc dot gnu.org
Target Milestone: ---
most likely in the range r11-4777 and r11-4781.
It doesn't seem to reproduce on Linux - but it shows on a stage#1 built with
debug - so probably will show on a darwin cross.
gcc/f951 /src-local/gcc-master/gcc/testsuite/gfortran.dg/save_6.f90 -fPIC
-quiet -dumpdir a- -dumpbase save_6.f90 -dumpbase-ext .f90
-mmacosx-version-min=10.12.0 -mtune=core2 -O2 -version -fno-automatic -flto
-fintrinsic-modules-path finclude -o a-save_6.s
looks like a GGC issue....
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
during IPA pass: modref
/src-local/gcc-master/gcc/testsuite/gfortran.dg/save_6.f90:54:3: internal
compiler error: Segmentation fault: 11
54 | end
| ^
0x1017d33c5 crash_signal
/src-local/gcc-master/gcc/toplev.c:330
0x1012e52d6 modref_tree<int>::merge(modref_tree<int>*, vec<modref_parm_map,
va_heap, vl_ptr>*)
/src-local/gcc-master/gcc/ipa-modref-tree.h:420
0x1012e35b9 modref_propagate_in_scc
/src-local/gcc-master/gcc/ipa-modref.c:2440
0x1012e3ac9 execute
/src-local/gcc-master/gcc/ipa-modref.c:2549
=====
Process 49712 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS
(code=EXC_I386_GPFLT)
frame #0: 0x00000001012e52d6
f951`modref_tree<int>::merge(this=0xa5a5a5a5a5a5a5a5, other=0x00000001469008c0,
parm_map=0x00007fff5fbff330) at ipa-modref-tree.h:420
417 Return true if something has changed. */
418 bool merge (modref_tree <T> *other, vec <modref_parm_map> *parm_map)
419 {
-> 420 if (!other || every_base)
421 return false;
422 if (other->every_base)
423 {
Target 0: (f951) stopped.