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

[3.4 Ada] PR/15331: Allow Ada to build on IRIX with gas 2.15


Ada fails to build on IRIX targets when using gas 2.15 (both for 3.4
and HEAD).  The problem is caused by the irix-specific Ada support,
which is generating asm statements like:

      Asm (LOADI & " $16,  16*8+" & Roff & "+" & SC_Regs_Pos & "($4)");

Here, Roff is the offset of the register from the start of a 64-bit chunk.
The correct value is 0 for n32 (which uses 64-bit registers) and 4 for o32
(which uses 32-bit registers).

The calculation itself is fine, but the problem is that Roff is set
to ' ' in the n32 case.  This leads to insns like:

        ld      ...,16*8+ +...($4)

We've got away this in the past because the MIPSpro assemblers treat
the second plus as a unary operator.  gas 2.14 and earlier did the same.
However, gas 2.15 now (deliberately) rejects this construct.

The fix is simply to use '0' instead of ' '.

I'm not sure whether this technically counts as a regression.  I suppose
you could argue that it is on the basis that it's no longer possible to
build "with latest binutils".  But if that's stretching things, I'd like
to see the patch applied anyway because:

  - 3.4 seems to be the first FSF gcc 3.x release that ACT are
    relatively happy with.

  - Ada's about to break with the tree-ssa merge.

  - It's a fairly obvious one-character fix to an IRIX-specific file.

Tested on mips-sgi-irix6.5 by Rainer and myself.  OK for HEAD and 3.4?

Richard


	PR target/15331
	* 5gmastop.adb (Roff): Choose between '4' and '0', not '4' and ' '.

Index: ada/5gmastop.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/5gmastop.adb,v
retrieving revision 1.11
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.11 5gmastop.adb
*** ada/5gmastop.adb	5 Apr 2004 14:57:31 -0000	1.11
--- ada/5gmastop.adb	6 May 2004 22:47:04 -0000
*************** package body System.Machine_State_Operat
*** 121,127 ****
     --  load/store instructions used to save/restore machine instructions.
  
     Roff : constant Character := Character'Val (o32n * Character'Pos ('4') +
!                                                n32n * Character'Pos (' '));
     --  Offset from first byte of a __uint64 register save location where
     --  the register value is stored.  For n32/64 we store the entire 64
     --  bit register into the uint64.  For o32, only 32 bits are stored
--- 121,127 ----
     --  load/store instructions used to save/restore machine instructions.
  
     Roff : constant Character := Character'Val (o32n * Character'Pos ('4') +
!                                                n32n * Character'Pos ('0'));
     --  Offset from first byte of a __uint64 register save location where
     --  the register value is stored.  For n32/64 we store the entire 64
     --  bit register into the uint64.  For o32, only 32 bits are stored


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