From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30960 invoked by alias); 13 Nov 2014 15:50:05 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30889 invoked by uid 48); 13 Nov 2014 15:50:00 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63851] New: ipa-icf miscompiles gfortran.dg/assumed_rank_(8|9|10).f90 at -O2 and above Date: Thu, 13 Nov 2014 15:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01128.txt.bz2 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 /* 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.