Bug 885928 - allocatable real(16) fortran array produces a segmentation error when a subroutine is used in the main program
Summary: allocatable real(16) fortran array produces a segmentation error when a subro...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 17
Hardware: i386
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-11 03:13 UTC by Michael Parkinson
Modified: 2013-01-09 11:52 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-01-09 11:52:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
f90 routines, two main programs, one with allocation, one without, one subroutine, two compile scripts (the names will make everything fairly obvious as to what goes with what) (1.47 KB, application/zip)
2012-12-11 03:13 UTC, Michael Parkinson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 55916 0 None None None Never

Description Michael Parkinson 2012-12-11 03:13:05 UTC
Created attachment 661267 [details]
f90 routines, two main programs, one with allocation, one without, one subroutine, two compile scripts (the names will make everything fairly obvious as to what goes with what)

Description of problem:  compiler messes up addressing with an allocatable real(16) array when code contains a function subroutine (subroutine can either be in C or in Fortran).  When subroutine is not present, there is no problem.


Version-Release number of selected component (if applicable):
    F17 3.6.8-2   gcc 4.7.2


How reproducible:  compile and run the two routines uploaded.  One uses a fixed array; the other an allocatable array allocated to the same size.  Both use a single function to set values.


Steps to Reproduce:
1.  unpack the code and run the two compile scripts
2.  execute the two executables, one noalloc and the other alloc
3.  observe the segmentation error in the allocatable case
  
Actual results:   no allocation runs and prints values
                  allocation bombs on the first store into the array


Expected results:  both routines should print a series of values


Additional info:  An x86_64 machine, F17 3.6.9-2, gcc 4.7.2 does not have the bug.  Both routines compile and operate properly on that machine.  On the x86 machine, if the subroutine is a C routine, with argument passed either by address or by value, the executable bombs when the array is allocatable.

Comment 1 Jakub Jelinek 2013-01-09 11:52:21 UTC
Tracking upstream.


Note You need to log in before you can comment on or make changes to this bug.