This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/13628] New: Assembly error: "section difference relocatable subtraction expression"


I've just discovered that my g77 on my Mac OS X 10.2.8 chokes on
the simplest little stand-alone main programs:

C
C File: hello.f
C
      PRINT *, 'Hello, World!'
      STOP
      END

% g77 -o hello hello.f
/var/tmp//cccXywU0.s:48:section difference relocatable subtraction expression, "LC3" minus 
"L1$pb" using a symbol at the end of section will not produce an assembly time constant
/var/tmp//cccXywU0.s:48:use a symbol with a constant value created with an assignment instead 
of the expression, L_const_sym = LC3 - L1$pb
/var/tmp//cccXywU0.s:47:section difference relocatable subtraction expression, "LC3" minus 
"L1$pb" using a symbol at the end of section will not produce an assembly time constant
/var/tmp//cccXywU0.s:47:use a symbol with a constant value created with an assignment instead 
of the expression, L_const_sym = LC3 - L1$pb
% 

It seems unrelated to optimization or linking: the -O0 -g -c options
make no difference.

On the other hand, more complicated programs compile and execute fine --
which is why I didn't notice this problem sooner.

C
C File: hellosub.f
C
      CALL HELLO
      STOP
      END
C
      SUBROUTINE HELLO
      PRINT *, 'Hello, World!'
      RETURN
      END

% g77 -o hellosub hellosub.f
% ./hellosub
 Hello, World!
% 

System specs:

   Mac OS X 10.2.8

% uname -a
Darwin --- 6.8 Darwin Kernel Version 6.8: Wed Sep 10 15:20:55 PDT 2003; root:xnu/xnu-
344.49.obj~2/RELEASE_PPC  Power Macintosh powerpc

% which gcc
/usr/bin/gcc

%gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1493)

% which g77
/usr/local/bin/g77

% g77 -v
Reading specs from /usr/local/lib/gcc-lib/powerpc-apple-darwin6.6/3.3/specs
Configured with: ../gcc/configure --enable-shared --enable-threads=posix
Thread model: posix
gcc version 3.3

% /usr/local/bin/gcc -v
Reading specs from /usr/local/lib/gcc-lib/powerpc-apple-darwin6.6/3.3/specs
Configured with: ../gcc/configure --enable-shared --enable-threads=posix
Thread model: posix
gcc version 3.3


I compiled g77 from the CVS 3.3 release.  Looking at the "-v" specs,
I guess that was before "upgrading" from Darwin 6.6 to 6.8 (Mac OS X
10.2.6 to 10.2.8), but still with a compatible (?) gcc version 3.3 from
Apple.

Simple programs used to compile fine.  This would not be the first
time that some subtle change in the Mac OS revealed a subtle bug or
incompatibility with g77.  I've spent hours tracking down such things
in two previous releases.

Thanks for your time.  I think g77 is really a great compiler.  I dearly
wish that Apple would include it in their gcc distribution, so that there
would be no question of incompatibility.

-- 
           Summary: Assembly error: "section difference relocatable
                    subtraction expression"
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: twhall at cuhk dot edu dot hk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin6.6
  GCC host triplet: powerpc-apple-darwin6.8
GCC target triplet: powerpc-apple-darwin6.6


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13628


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]