public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Help with another constraint
@ 2007-12-09 13:07 Balaji V. Iyer
  2007-12-09 14:28 ` Rask Ingemann Lambertsen
  0 siblings, 1 reply; 14+ messages in thread
From: Balaji V. Iyer @ 2007-12-09 13:07 UTC (permalink / raw)
  To: gcc, openrisc

Hello Everyone,
    I am trying to partition register files in GCC port of Opencores
(OPENRISC 1000). It is currently failing the following constraint in
negdi2
 
(insn 15 13 16 (set (mem:SI (plus:SI (reg/f:SI 2 r2)
                (const_int -28 [0xffffffe4])) [0 D.1256+0 S4 A32])
        (neg:SI (reg:SI 3 r3 [orig:80 D.1255 ] [80]))) 38 {negsi2} (nil)
    (nil))
../../gcc-4.0.2/gcc/libgcc2.c:72: internal compiler error: in
final_scan_insn, at final.c:2439
Please submit a full bug report,

 
REGISTER R2 is the frame pointer!!
 
I think this is because of the way I am handling the frame
pointer...This is how I do it in the or32.h file



#define FRAME_POINTER_REGNUM 2
#define FRAME_POINTER_REQUIRED 0
 
#define INITIAL_FRAME_POINTER_OFFSET(DEPTH)
\
{ int regno;
\
  int offset = 0;
\
  for( regno=0; regno < FIRST_PSEUDO_REGISTER;  regno++ )
\
    if( regs_ever_live[regno] && !call_used_regs[regno] )
\
      offset += 4;
\
  (DEPTH) = (!current_function_is_leaf || regs_ever_live[LINK_REGNUM] ?
4 : 0)  +       \
                (frame_pointer_needed ? 4 : 0)
+       \
                offset
+       \
                OR32_ALIGN(current_function_outgoing_args_size,4)
+       \
                OR32_ALIGN(get_frame_size(),4);
\
}

 
#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \
{ int offset = -1;
\
  rtx regs = stack_pointer_rtx;
\
  if (ADDR == frame_pointer_rtx)
\
    offset = 0;
\
  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) ==
frame_pointer_rtx \
           && GET_CODE (XEXP (ADDR, 0)) == CONST_INT)
\
    offset = INTVAL (XEXP (ADDR, 0));
\
  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) ==
frame_pointer_rtx \
           && GET_CODE (XEXP (ADDR, 1)) == CONST_INT)
\
    offset = INTVAL (XEXP (ADDR, 1));
\
  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 0) ==
frame_pointer_rtx) \
    { rtx other_reg = XEXP (ADDR, 1);
\
      offset = 0;
\
      regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }
\
  else if (GET_CODE (ADDR) == PLUS && XEXP (ADDR, 1) ==
frame_pointer_rtx) \
    { rtx other_reg = XEXP (ADDR, 0);
\
      offset = 0;
\
      regs = gen_rtx (PLUS, Pmode, stack_pointer_rtx, other_reg); }
\
  if (offset >= 0)
\
    { int regno;
\
      extern char call_used_regs[];
\
      offset += 4; /* I don't know why??? */
\
      for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
\
        if (regs_ever_live[regno] && ! call_used_regs[regno])
\
          offset += 4;
\
      ADDR = plus_constant (regs, offset + (DEPTH)); } }
 

 
 
 
 
What am I doing wrong??
 
 
ANy help is highly highly appreciated!
 
Yours Sincerely,
 
Balaji V. Iyer.
 
 
 
 
-- 
 
Balaji V. Iyer
PhD Student, 
Center for Efficient, Scalable and Reliable Computing,
Department of Electrical and Computer Engineering,
North Carolina State University.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-12-17 18:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-09 13:07 Help with another constraint Balaji V. Iyer
2007-12-09 14:28 ` Rask Ingemann Lambertsen
2007-12-09 22:06   ` Balaji V. Iyer
2007-12-10 17:31     ` 'Rask Ingemann Lambertsen'
2007-12-12  5:13       ` Balaji V. Iyer
2007-12-12 12:53         ` Revital1 Eres
2007-12-12 13:01           ` Balaji V. Iyer
2007-12-12 14:35           ` Dave Korn
2007-12-12 17:50             ` Rask Ingemann Lambertsen
2007-12-16 14:24             ` Hans-Peter Nilsson
2007-12-16 17:18               ` Hans-Peter Nilsson
2007-12-12 15:21         ` 'Rask Ingemann Lambertsen'
2007-12-17 18:38           ` Rask Ingemann Lambertsen
2007-12-17 20:31             ` Balaji V. Iyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).