Bug 164732

Summary: gfortran cannot parse single-line nested arithmetic if statement
Product: Red Hat Enterprise Linux 4 Reporter: Nate Crawford <nathan.crawford>
Component: gcc4Assignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: 4.0.1-4.EL4.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-06 11:49:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nate Crawford 2005-07-31 07:05:45 UTC
Description of problem:
With some ancient, but working, fortran77 code, I ran into a little glitch. 
Specifically, the command (and error message):

  gfortran -O2 -w -ffixed-form [unimportant stuff]

          IF(INCX.EQ.INCY) IF(INCX-1) 5,20,60
                      1
  Error: Unclassifiable statement in IF-clause at (1) 

After changing it to an if block:

        IF(INCX.EQ.INCY) THEN
           IF(INCX-1) 5,20,60
        ENDIF

the subroutine compiled cleanly.

Version-Release number of selected component (if applicable):
gcc version 4.0.0 20041214 (Red Hat 4.0.0-0.14.EL4)

How reproducible:
allways

Steps to Reproduce:
1.take old ugly fortran
2.compile
3.
  
Actual results:
compilation error

Expected results:
no compilation error

Additional info:
  This subroutine has been compiled correctly for years with many compilers on
many architectures, and is probably legal fortran77.  I have not tried it with
gfortran on non-IA64 machines, but I suspect the bug exists across them all.

-Nate

Comment 1 Jakub Jelinek 2005-08-06 11:49:53 UTC
This is upstream PR17229, fixed in April.  gfortran packages for RHEL4 U2 are
based on 20050727 gcc-4_0-rhl-branch (which is based on 20050727 gcc-4_0-branch),
so that fix is included.