Bug 153023 - gfortran -ff2c bug
Summary: gfortran -ff2c bug
Status: RESOLVED WONTFIX
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Development (show other bugs)
Version: Beta 3
Hardware: i586 Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Richard Biener
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-23 07:44 UTC by Joachim Reichelt
Modified: 2006-05-03 16:14 UTC (History)
1 user (show)

See Also:
Found By: Beta-Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Reichelt 2006-02-23 07:44:27 UTC
I have to compile real old legacy code written for the good old VAX:
it compiles fine without "-ff2c"
gfortran -DUNIX -DCTEXT -DF2C -DGLX11 -DX11 -DDX4 -DLITE -DWHATCHECK -pedantic -W -fno-automatic -ff2c -std=legacy -Waliasing -frepack-arrays -O0 -c a.f
a.f: In function ‘gvftor’:
a.f:37: internal compiler error: in expand_copysign, at optabs.c:2930
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.suse.de/feedback> for instructions.

Source follows:
      REAL FUNCTION GVFTOR(XYZ1,XYZ2,XYZ3,XYZ4)
C-------------------------------------------------------------------------------
C----                                                                       ----
C---- XYZ1 THROUGH 4 ARE THE COORDINATES OF FOUR POINTS IN SPACE. IF THESE  ----
C---- POINTS ARE THOUGHT CONNECTED, THEY DEFINE A TORSION ANGLE BETWEEN     ----
C---- THEM. THE FUNCTION RETURNS THIS TORSION ANGLE.                        ----
C----                                                                       ----
C-------------------------------------------------------------------------------
C===
      IMPLICIT      NONE
      REAL          XYZ1(3) ,XYZ2(3), XYZ3(3) ,XYZ4(3) ,BOND1(3),
     +              BOND2(3), BOND3(3), VPROD1(3), VPROD2(3),
     +              VPROD3(3), COSINE, GVFACS, GVFDP3
C----
C---- MAKE UP THE CONNECTING BONDS
C----
      CALL GVSTV3 (BOND1,XYZ2,XYZ1)
      CALL GVSTV3 (BOND2,XYZ3,XYZ2)
      CALL GVSTV3 (BOND3,XYZ4,XYZ3)
C----
C---- CALCULATE THE ANGLE
C----
      CALL GVSNM3 (BOND1)
      CALL GVSNM3 (BOND2)
      CALL GVSNM3 (BOND3)
      CALL GVSCP3 (VPROD1,BOND2,BOND1)
      CALL GVSCP3 (VPROD2,BOND3,BOND2)
      CALL GVSNM3 (VPROD1)
      CALL GVSNM3 (VPROD2)
      CALL GVSCP3 (VPROD3,VPROD1,VPROD2)
      COSINE=GVFDP3(VPROD1,VPROD2)
      GVFTOR=GVFACS(COSINE)
C----
C---- SET SIGN OF ANGLE FROM THE SIGN OF THE DOT PRODUCT
C---- OF VPROD3 AND BOND2.
C----
      GVFTOR=SIGN(GVFTOR,GVFDP3(VPROD3,BOND2))

      RETURN
      END
Comment 1 Richard Biener 2006-02-23 12:35:32 UTC
Confirmed.
Comment 2 Richard Biener 2006-02-23 12:50:06 UTC
http://gcc.gnu.org/PR26440
Comment 3 Richard Biener 2006-02-24 11:35:03 UTC
I had a brief look at the root of the problem and it turned out to be a mess.  It looks like -ff2c is an ugly hack that just waits for latent problems to show up.  So my advise is to not use -ff2c if you can avoid it.  Don't hold your breath for a fix, it is unlikely to appear in time for 10.1.
Comment 5 Richard Biener 2006-05-03 16:14:31 UTC
Won't fix for 10.1.