This is the mail archive of the gcc@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]

Problem with gcc 2.95.3 under HP-UX - missing asm directive



Hello,

this email goes to gcc@gcc.gnu.org as this is the email referenced by the
http://hpux.cs.utah.edu web site, from which I have downloaded binary
distributions of binutils (2.11) and gcc (2.95.3) for HP-UX 11.00.

Recall you can generate HP PA-RISC machine code at level 1.1 (PA7000
processor family) or level 2 (PA8000 processor family, more recent
hardware).

gcc works fine for PA-7000 code:

hp% gcc -mpa-risc-1-1 -mschedule=7100 -O  estat.c  -lm  -o estat.gcc7000.x
hp% time estat.gcc7000.x 50
 bounds[0] = 0
 bounds[1] = 500
 bounds[2] = 707
 bounds[3] = 866
 bounds[4] = 999
 energy = 6485.470861
2.44u 0.00s 0:02.44 100.0%
hp% 

If we ask for PA8000 code *AND* optimization to gcc, we run into trouble:

hp% gcc -mpa-risc-2-0 -mschedule=8000 -O estat.c -lm -o estat.gcc8000.x
/var/tmp/cce51hFb.s: Assembler messages:
/var/tmp/cce51hFb.s:158: Error: Invalid operands 
/var/tmp/cce51hFb.s:331: Error: Invalid operands 
/var/tmp/cce51hFb.s:332: Error: Invalid operands 
hp% 

This is an assembly problem; gcc by itself is fine, we can generate a .s
file:

hp% gcc -S -mpa-risc-2-0 -mschedule=8000 -O estat.c 
hp%

The "level" directive is missing in the generated .s file; so a default
level of 1 is assumed by gas, but the code contains some level 2 machine
code, because this is what we've asked. So the assembler balks.

(UGLY) WORKAROUND:

Note: gas does not understand the " .LEVEL 2.0N" generated by the HP
compilers, so I will have to
add by hand a " .LEVEL 2.0" instead. 

hp% grep LEVEL estat.s
hp%
hp% (echo " .LEVEL 2.0" ; cat estat.s) > estat.full.s
hp% grep LEVEL estat.full.s
 .LEVEL 2.0
hp% 
hp% /opt/binutils/bin/as estat.full.s -o estat.o
hp% file estat.o
estat.o:        PA-RISC2.0 relocatable object
hp% 
hp% gcc estat.o -lm -o estat.gcc8000.x
/usr/bin/ld: (Warning) At least one PA 2.0 object file (estat.o) was
detected. The linked output may not run on a PA 1.x system.
hp% time estat.gcc8000.x 50
 bounds[0] = 0
 bounds[1] = 500
 bounds[2] = 707
 bounds[3] = 866
 bounds[4] = 999
 energy = 6485.470861
2.32u 0.00s 0:02.34 99.1%
hp% 

Hardware context:

hp% date
Tue May 22 20:10:17 MEST 2001
hp% uname -a
HP-UX ptac B.11.00 U 9000/800 1500780598 unlimited-user license
hp% model
9000/800/A500-5X
hp% 

I include estat.c below for reference.


Thanks a lot for your help,

  Jean-Paul Marinier
  Technical Consultant, Partner Technology Access Center
  HP Europe TCO
  Phone +33-1-6982-6773 Fax +33-1-6982-6109
  Mobile +33-6-7299-2251
  Email: jean-paul_marinier@hp.com


----------------------------------------------------------


estat.c


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