Bug 751767 - gfortran fails to compile stbt05.f (lapack 3.1) with -O2
Summary: gfortran fails to compile stbt05.f (lapack 3.1) with -O2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc
Version: 6.1
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
: 740720 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-07 14:14 UTC by Tru Huynh
Modified: 2012-06-20 14:39 UTC (History)
3 users (show)

Fixed In Version: gcc-4.4.6-4.el6
Doc Type: Bug Fix
Doc Text:
Previously GCC's Fortran frontend, when determining a type with specific precision, could return wrong type which caused an internal compiler error later. This has been fixed so now GCC uses smallest of the wider types if there are any to avoid ICEing.
Clone Of:
Environment:
Last Closed: 2012-06-20 14:39:27 UTC
Target Upstream Version:


Attachments (Terms of Use)
stbt05.f from lapack 3.1 (8.03 KB, text/x-fortran)
2011-11-07 14:14 UTC, Tru Huynh
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0941 0 normal SHIPPED_LIVE gcc bug fix and enhancement update 2012-06-19 21:00:22 UTC

Description Tru Huynh 2011-11-07 14:14:40 UTC
Created attachment 532048 [details]
stbt05.f from lapack 3.1

Description of problem:
gfortran fails to compile stbt05.f (lapack 3.1) with -O2/-O1 flags. 

Version-Release number of selected component (if applicable):
gcc-gfortran-4.4.5-6.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. gfortran  -O2 -fPIC -c stbt05.f -o stbt05.o

  
Actual results:
comilation failure with:

stbt05.f: In function ‘stbt05’:
stbt05.f:1: internal compiler error: Segmentation fault

Expected results:
no errors

Additional info:
-O2 fails also
-O0 succeed

Comment 1 Tru Huynh 2011-11-07 14:16:06 UTC
gcc44-gfortran-4.4.4-13.el5.x86_64 under RHEL 5.7 release does not show the error.

Comment 4 Jakub Jelinek 2011-11-10 16:40:18 UTC
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179290
ought to fix this.
See http://gcc.gnu.org/ml/gcc-patches/2011-09/msg01418.html
for more details.

Comment 10 Tru Huynh 2011-11-22 17:31:01 UTC
will that fix make it for 6.2? Thanks

Comment 11 Tru Huynh 2011-12-11 21:42:50 UTC
possible workaround for lapack builds from https://bugzilla.redhat.com/show_bug.cgi?id=520518 as listed in lapack-3.2.1-4.el6.x86_64:

* Fri Sep 04 2009 Tom "spot" Callaway <tcallawa> - 3.2.1-3
- use RPM_OPT_O_FLAGS (-O0) everywhere necessary, drop RPM_OPT_SIZE_FLAGS (-Os) (bz 520518)

no idea what #543948 is (not public)

Comment 12 Tru Huynh 2011-12-11 22:21:10 UTC
for what it's worth, lapack 3.4.0 also has the same issue O2 core dumps, but -O2 -Os compiles fine.

Comment 15 Jakub Jelinek 2012-03-02 18:30:39 UTC
In SVN: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184801

Comment 19 IBM Bug Proxy 2012-04-27 08:21:09 UTC
------- Comment From pavsubra.com 2012-04-27 08:13 EDT-------
I have downloaded the lapack-3.3.0.tgz to my P7 machine and did the following steps on RHEL 6.3 Beta:

[root@saturnfo-lp1 ~]# cd lapack-3.3.0
[root@saturnfo-lp1 lapack-3.3.0]# ls
BLAS                     CTestConfig.cmake   lapack-config.cmake.in          LICENSE   make.inc.example  TESTING
CheckTimeFunction.cmake  INSTALL             lapack-config-install.cmake.in  Makefile  README
CMakeLists.txt           lapack_build.cmake  lapack-config-version.cmake.in  make.inc  SRC
[root@saturnfo-lp1 lapack-3.3.0]# cp make.inc.example make.inc

Then edited the make.inc file with :

OPTS     = -fPIC  -O3 -mcpu=powerpc64
NOOPT    = -g -O0 -fPIC

Then uncommented the line in the Makefile:
lib: blaslib variants lapacklib tmglib

[root@saturnfo-lp1 lapack-3.3.0]# make all

The make all is successful and not giving any errors.

Also I copied the fortran file stpt05.f into the machine and compiled the same as follows:

[root@saturnfo-lp1 ~]# gfortran -O1 -c stpt05.f
It is successful and creating the stpt05.o file

Comment 20 Marek Polacek 2012-05-27 12:20:37 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously GCC's Fortran frontend, when determining a type with specific precision, could return wrong type which caused an internal compiler error later.  This has been fixed so now GCC uses smallest of the wider types if there are any to avoid ICEing.

Comment 22 errata-xmlrpc 2012-06-20 14:39:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0941.html


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