public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Saga of m68k PIC continues
@ 2002-12-11 12:57 Peter Barada
  2002-12-11 14:25 ` Jim Wilson
  2002-12-11 16:11 ` Richard Henderson
  0 siblings, 2 replies; 17+ messages in thread
From: Peter Barada @ 2002-12-11 12:57 UTC (permalink / raw)
  To: gcc


I restarted the mind-meld of i386 PIC into m68k, and I've gone through
and modified the following defintions in m68k.h:

LEGITIITMATE_PIC_OPERAND_P
SYMBOLIC_CONST

And modified/created the following functions in m68k.c:

symbolic_operand
local_symbolic_operand
legitimate_pic_address_disp_p
symbolic_reference_mentioned_p
legitimize_pic_address

It builds now, but fails building crtstuff.c with -fPIC:

./xgcc -B./ -B/home/mylocal/xcomp/target/m68k-linux/bin/ -isystem /home/mylocal/xcomp/target/m68k-linux/include -isystem /home/mylocal/xcomp/target/m68k-linux/sys-include -O2 -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -I. -I. -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/. -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/config -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/../include  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fPIC \
  -Dinhibit_libc -c /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
  -o crtbeginS.o
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/crtstuff.c: In function `__do_global_dtors_aux':
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/crtstuff.c:286: unrecognizable insn:
(insn 12 115 14 (set (reg/f:SI 32)
        (unspec:SI[ 
                (symbol_ref:SI ("completed.1"))
            ]  6)) -1 (nil)
    (expr_list:REG_EQUAL (const:SI (unspec:SI[ 
                    (symbol_ref:SI ("completed.1"))
                ]  6))
        (nil)))
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/crtstuff.c:286: Internal compiler error in extract_insn, at recog.c:2148


The backtrace points to regmove_optimize() being the current pass, and
at this point reload_in_progress *and* reload_complete are both zero,
so the pseudo should be legal.

Since I'm only trying to load the address of the symbol into a
register, I'd expect the movsi and other implicit movsi patterns to
handle it, especially:

(define_insn ""
  ;; Notes: make sure no alternative allows g vs g.
  ;; We don't allow f-regs since fixed point cannot go in them.
  ;; We do allow y and x regs since fixed point is allowed in them.
  [(set (match_operand:SI 0 "nonimmediate_operand" "=g,d,a<,y,!*x*r*m")
        (match_operand:SI 1 "general_src_operand" "daymSKT,n,i,g,*x*r*m"))]

  "!TARGET_5200"
  "*
{
  if (which_alternative == 4)
    return \"fpmove%.l %x1,fpa0\;fpmove%.l fpa0,%x0\";
  if (FPA_REG_P (operands[1]) || FPA_REG_P (operands[0]))
    return \"fpmove%.l %x1,%x0\";
  return output_move_simode (operands);
}")


I found that: 

(unspec:SI[ 
        (symbol_ref:SI ("completed.1"))
    ]  6)

is not accepted by general_operand(which is called form
general_src_operand) which to me seems very strange, especially since
the mode was SImode.

1) Should general_src_operand accept the unspec symbol?
2) If not, does anyone have an idea how I should get this instruction
   recognized? 

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

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

end of thread, other threads:[~2002-12-12 22:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 12:57 Saga of m68k PIC continues Peter Barada
2002-12-11 14:25 ` Jim Wilson
2002-12-11 16:11 ` Richard Henderson
2002-12-11 16:19   ` Peter Barada
2002-12-12  2:41     ` Richard Henderson
2002-12-12  5:11       ` Andreas Schwab
2002-12-12 11:24         ` Richard Henderson
2002-12-12 11:28           ` Andreas Schwab
2002-12-12 12:27     ` Peter Barada
2002-12-12 12:44       ` Jan Hubicka
2002-12-12 12:44         ` Peter Barada
2002-12-12 13:00           ` Jan Hubicka
2002-12-12 13:46             ` Peter Barada
2002-12-12 14:32               ` Jim Wilson
2002-12-12 13:50             ` Peter Barada
2002-12-12 13:59               ` Jan Hubicka
2002-12-12 14:57               ` Richard Henderson

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).