public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/63851] New: ipa-icf miscompiles gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above
@ 2014-11-13 15:50 dominiq at lps dot ens.fr
  2014-11-14 11:28 ` [Bug ipa/63851] [5 Regression] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-11-13 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63851
           Summary: ipa-icf miscompiles
                    gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: fxcoudert at gcc dot gnu.org, iains at gcc dot gnu.org,
                    marxin at gcc dot gnu.org

On x86_64-apple-darwin14 ipa-icf miscompiles
gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above (see pr63622 comment 7).
Reduced test for assumed_rank_8.f90

[Book15] f90/bug% cat assumed_rank_8_red.f90
program main
  implicit none

  interface
    subroutine check (x)
      integer :: x(..)
    end subroutine check
  end interface

  integer, allocatable :: kk
  integer, pointer :: ll

  call g (null())
  kk = 489
  call h (kk)

contains

  subroutine g (x)
    integer, pointer, intent(in) :: x(..)

    call check (x)
  end subroutine

  subroutine h (x)
    integer, allocatable :: x(..)

    call check (x)
  end subroutine

end program main
[Book15] f90/bug% cat assumed_rank_8_c_red.c
/* Called by assumed_rank_8.f90 and assumed_rank_9.f90.  */

#include <stdlib.h>  /* For abort().  */

struct a {
  int *dat;
};

void check_ (struct a *x)
{
  if (*x->dat != 489)
    abort ();
}
[Book15] f90/bug% gfc -O2 assumed_rank_8_red.f90 assumed_rank_8_c_red.c
[Book15] f90/bug% a.out

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x10ec7a5c2
#1  0x10ec7ad60
#2  0x7fff81c71f19
#3  0x10ec71e73
#4  0x10ec71eb5
Segmentation fault

If I comment the first 'call check (x)', the abort goes away.

A reduced test for assumed_rank_10.f90 (fails only with -m32) has been posted
in pr63622 comment 34.


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

end of thread, other threads:[~2014-12-23  9:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13 15:50 [Bug ipa/63851] New: ipa-icf miscompiles gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above dominiq at lps dot ens.fr
2014-11-14 11:28 ` [Bug ipa/63851] [5 Regression] " rguenth at gcc dot gnu.org
2014-11-20 13:43 ` dominiq at lps dot ens.fr
2014-11-25 17:18 ` marxin at gcc dot gnu.org
2014-11-27 14:19 ` burnus at gcc dot gnu.org
2014-11-27 22:11 ` fxcoudert at gcc dot gnu.org
2014-12-17  1:03 ` howarth at bromo dot med.uc.edu
2014-12-17 13:52 ` dominiq at lps dot ens.fr
2014-12-17 21:32 ` howarth at bromo dot med.uc.edu
2014-12-18  2:17 ` howarth at bromo dot med.uc.edu
2014-12-18 17:32 ` marxin at gcc dot gnu.org
2014-12-18 22:26 ` howarth at bromo dot med.uc.edu
2014-12-19  0:32 ` dominiq at lps dot ens.fr
2014-12-23  9:31 ` 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).