public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
@ 2020-11-08 20:07 iains at gcc dot gnu.org
  2020-11-08 20:10 ` [Bug tree-optimization/97757] " iains at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2020-11-08 20:07 UTC (permalink / raw)
  To: gcc-bugs

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.

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

* [Bug tree-optimization/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
@ 2020-11-08 20:10 ` iains at gcc dot gnu.org
  2020-11-09  8:11 ` [Bug ipa/97757] " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2020-11-08 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-11-08
             Status|UNCONFIRMED                 |NEW
                 CC|                            |hubicka at gcc dot gnu.org
             Target|                            |*-*-darwin*
           Keywords|                            |ice-on-valid-code

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

* [Bug ipa/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
  2020-11-08 20:10 ` [Bug tree-optimization/97757] " iains at gcc dot gnu.org
@ 2020-11-09  8:11 ` rguenth at gcc dot gnu.org
  2020-11-09  9:54 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-09  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
          Component|tree-optimization           |ipa
   Target Milestone|---                         |11.0
                 CC|                            |marxin at gcc dot gnu.org

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

* [Bug ipa/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
  2020-11-08 20:10 ` [Bug tree-optimization/97757] " iains at gcc dot gnu.org
  2020-11-09  8:11 ` [Bug ipa/97757] " rguenth at gcc dot gnu.org
@ 2020-11-09  9:54 ` hubicka at gcc dot gnu.org
  2020-11-11 19:40 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-11-09  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
indeed this is obviously garbage collected that is weird because all things
should be reachable via the modref summary (where THIS pointer is taken). I
will try cross.

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

* [Bug ipa/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-11-09  9:54 ` hubicka at gcc dot gnu.org
@ 2020-11-11 19:40 ` dominiq at lps dot ens.fr
  2020-11-16 15:22 ` hubicka at gcc dot gnu.org
  2020-12-03  9:58 ` iains at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2020-11-11 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Reduced test:

subroutine bar_array()
  logical, save :: first = .true.
  character(len=:), allocatable :: str
  if (first) then
    first = .false.
    if (allocated (str)) STOP 7
    str = "ABCDEF"
  end if
end subroutine bar_array

call bar_array()
end

% gfc save_5_red.f90 -fno-automatic -flto -O2
during IPA pass: modref
save_5_red.f90:12:3: internal compiler error: Segmentation fault: 11
   12 | end
      |   ^

>From the manual

-fno-automatic
Treat each program unit (except those marked as RECURSIVE) as if the SAVE
statement were specified for every local variable and array referenced in it.
Does not affect common blocks. (Some Fortran compilers provide this option
under the name -static or -save.) The default, which is -fautomatic, uses the
stack for local variables smaller than the value given by -fmax-stack-var-size.
Use the option -frecursive to use no static memory.

Local variables or arrays having an explicit SAVE attribute are silently
ignored unless the -pedantic option is added.

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

* [Bug ipa/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-11-11 19:40 ` dominiq at lps dot ens.fr
@ 2020-11-16 15:22 ` hubicka at gcc dot gnu.org
  2020-12-03  9:58 ` iains at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-11-16 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is problem with propagate_in_scc sometimes freeing the summary and losing
track of it.  It is fixed in
https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559116.html

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

* [Bug ipa/97757] [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2
  2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-11-16 15:22 ` hubicka at gcc dot gnu.org
@ 2020-12-03  9:58 ` iains at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: iains at gcc dot gnu.org @ 2020-12-03  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed between r11-5028 and r11-5235

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

end of thread, other threads:[~2020-12-03  9:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 20:07 [Bug tree-optimization/97757] New: [11 Regression] fortran save_6.f90 fails with a segv for -flto -O >= 2 iains at gcc dot gnu.org
2020-11-08 20:10 ` [Bug tree-optimization/97757] " iains at gcc dot gnu.org
2020-11-09  8:11 ` [Bug ipa/97757] " rguenth at gcc dot gnu.org
2020-11-09  9:54 ` hubicka at gcc dot gnu.org
2020-11-11 19:40 ` dominiq at lps dot ens.fr
2020-11-16 15:22 ` hubicka at gcc dot gnu.org
2020-12-03  9:58 ` iains 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).