public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Troubles building gcc-3.2.1 --target=m68k-linux
@ 2002-12-10  9:43 Peter Barada
  2002-12-10 10:18 ` Jim Wilson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Barada @ 2002-12-10  9:43 UTC (permalink / raw)
  To: gcc


Using linux-2.4.19, binutils-2.13, gcc-3.2.1, glibc-2.2.5, and the
following Makefile, I've succeeded in building a gcc-3.2.1
--target=m68k-linux compiler using a x86 host gcc-3.2.1 compiler.

I'm doing this since I'm trying to 'fix' m68k PIC code generation in
gcc-3.2.1 so it can support ColdFire.

But if I modify the m68k target files to change
GO_IF_LEGITIMATE_ADDRESS from a macro to a function call (the same way
that i386.h does it), the build fails to comlete the bootstrap.  I've
gotten to the point that I've convinced myself its a compiler bug in
gcc-3.2.1, so before I file a PR, I figured I would ask people with
better eyes than mine to look at what I've done and tell me where I
went wrong.

Here's the Makefile that built up everything:

begin 644 Makefile
M(PHC($)U:6QD(&%N(&TV.&LM;&EN=7@@8V]M<&EL97(@9G)O;2`J<V-R871C
M:"H*(PH*(R!7:&5R92!A;&P@=&AE('-O=7)C97,@87)E"E-/55)#15]0051(
M("`@(#U^+W=O<FLO8W9S+7=A=F5M87)K+V-R;W-S+6QI;G5X+71O;VQS"@HC
M($)U:6QD:6YG(&]N(&%N(&DV.#8M;&EN=7@@;6%C:&EN90I(3U-4("`@("`@
M("`]:38X-BUL:6YU>`H*(R!487)G970@05)#2"!N965D960@9F]R(&-O;F9I
M9W5R:6YG($QI;G5X(&ME<FYE;`I!4D-("3UM-CAK"@HC(%1A<F=E="!T;R!C
M;VYF:6=U<F4@1TY5('1O;VQS(&9O<@I405)'150@("`@("`@(#TD>T%20TA]
M+6QI;G5X"@HC('=H97)E('1O(&EN<W1A;&P@=&AE('1O;VQS("AH;W-T(&%N
M9"!T87)G970@=&]O;',I"E!2149)6`D)/2]H;VUE+VUY;&]C86PO>&-O;7`*
M24Y35$%,3%]$25(@("`])'M04D5&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
end


Here's the patch that I used to change GO_IF_LEGITIMATE_ADDRESS from a
macro to a function the m68k target files: 

[pbarada: ~/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/config/m68k] > cvs diff -Nu m68k.h m68k-protos.h m68k.c
Index: m68k.h
===================================================================
RCS file: /usr/local/wavemark/cvs/archives/cross-linux-tools/gcc-3.2.1/gcc/config/m68k/m68k.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 m68k.h
--- m68k.h	2002/11/25 23:46:44	1.1.1.1
+++ m68k.h	2002/12/10 16:47:58
@@ -1436,13 +1436,21 @@
 	    || (INTVAL (XEXP (X, 1)) == 8 && !TARGET_5200))))
 
 /* If pic, we accept INDEX+LABEL, which is what do_tablejump makes.  */
+#if 1
 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
+do {									\
+  if (legitimate_address_p ((MODE), (X)))				\
+    goto ADDR;								\
+} while (0)
+#else
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR)				\
 { GO_IF_NONINDEXED_ADDRESS (X, ADDR);					\
   GO_IF_INDEXED_ADDRESS (X, ADDR);					\
   if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS	\
       && LEGITIMATE_INDEX_P (XEXP (X, 0))				\
       && GET_CODE (XEXP (X, 1)) == LABEL_REF)				\
     goto ADDR; }
+#endif
 
 /* Don't call memory_address_noforce for the address to fetch
    the switch offset.  This address is ok as it stands (see above),
Index: m68k-protos.h
===================================================================
RCS file: /usr/local/wavemark/cvs/archives/cross-linux-tools/gcc-3.2.1/gcc/config/m68k/m68k-protos.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 m68k-protos.h
--- m68k-protos.h	2002/11/25 23:46:44	1.1.1.1
+++ m68k-protos.h	2002/12/10 16:47:58
@@ -47,6 +47,7 @@
 extern int strict_low_part_peephole_ok PARAMS ((enum machine_mode, rtx, rtx));
 
 /* Functions from m68k.c used in macros.  */
+extern int legitimate_address_p PARAMS ((enum machine_mode, rtx));
 extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
 extern int const_int_cost PARAMS ((rtx));
 extern int standard_68881_constant_p PARAMS ((rtx));
Index: m68k.c
===================================================================
RCS file: /usr/local/wavemark/cvs/archives/cross-linux-tools/gcc-3.2.1/gcc/config/m68k/m68k.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 m68k.c
--- m68k.c	2002/11/25 23:46:44	1.1.1.1
+++ m68k.c	2002/12/10 16:47:58
@@ -4261,3 +4261,18 @@
   output_asm_insn (output_move_simode (xop), xop);
 }
 #endif
+
+int legitimate_address_p(MODE, X)
+     enum machine_mode MODE;
+     rtx X;
+{
+  GO_IF_NONINDEXED_ADDRESS (X, good);
+  GO_IF_INDEXED_ADDRESS (X, good);
+  if (flag_pic && MODE == CASE_VECTOR_MODE && GET_CODE (X) == PLUS
+      && LEGITIMATE_INDEX_P (XEXP (X, 0))
+      && GET_CODE (XEXP (X, 1)) == LABEL_REF)
+    goto good;
+  return 0;
+ good:
+  return 1;
+}

If this patch is not applied, the Makefile completes, and I have an
m68k-linux compiler that looks like it works(I built up a hello word
app, but I have no m68k hardware to test it on).  When the patch is
applied, the build process fails in the bootstrap with: 

/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo/m68k-linux-bootstrap/gcc/xgcc -B/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo/m68k-linux-bootstrap/gcc/ -B/home/mylocal/xcomp/target/m68k-linux/bin/ -B/home/mylocal/xcomp/target/m68k-linux/lib/ -isystem /home/mylocal/xcomp/target/m68k-linux/include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -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 -fexceptions -c /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde-glibc.c -o libgcc/./unwind-dw2-fde-glibc.o
In file included from /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde-glibc.c:47:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-pe.h: In function `size_of_encoded_value':
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-pe.h:76: warning: implicit declaration of function `abort'
In file included from /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde-glibc.c:298:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde.c: In function `get_cie_encoding':
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde.c:271: warning: implicit declaration of function `strlen'
In file included from /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde-glibc.c:298:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde.c: In function `search_object':
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/unwind-dw2-fde.c:968: Internal compiler error in print_operand_address, at config/m68k/m68k.c:3702
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
make[2]: *** [libgcc/./unwind-dw2-fde-glibc.o] Error 1
make[2]: Leaving directory `/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo/m68k-linux-bootstrap/gcc'


I pulled open the debugger and found that the compiler is trying to
emit the following instruction:

(gdb) frame 6
#6  0x080c7c2d in final_scan_insn (insn=0x401cb5e0, file=0x826cb60, 
    optimize=2, prescan=0, nopeepholes=0)
    at /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.1/gcc/final.c:2643
(gdb) call debug_rtx(insn)

(insn 362 360 656 (set (reg/v:SI 3 %d3 [92])
        (mem/s:SI (plus:SI (mem:SI (plus:SI (reg/f:SI 14 %a6)
                        (const_int -20 [0xffffffec])) [27 vec S4 A8])
                (const_int 4 [0x4])) [4 <variable>.count+0 S4 A16])) 29 {*m68k.md:976} (nil)
    (nil))

Note the use of two 'mem' operations in the second operand.  The
compiler can't handle this.  I looked through the debug dumps and
found that this is generated by reload (by finding this insn in
unwind-dw2-fde-glibc.c.21.greg). 

1) Does my change look correct?  If not, where'd I go wrong???
2) If its correct, is this a bug in gcc-3.2.1 for i386 and should I
   file a PR on it?
3) How should I proceed?

Thanx for any help!

-- 
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] 6+ messages in thread

* Re: Troubles building gcc-3.2.1 --target=m68k-linux
  2002-12-10  9:43 Troubles building gcc-3.2.1 --target=m68k-linux Peter Barada
@ 2002-12-10 10:18 ` Jim Wilson
  2002-12-10 10:52   ` Peter Barada
  2002-12-10 11:13   ` Peter Barada
  0 siblings, 2 replies; 6+ messages in thread
From: Jim Wilson @ 2002-12-10 10:18 UTC (permalink / raw)
  To: Peter Barada; +Cc: gcc

You need to have REG_OK_STRICT and !REG_OK_STRICT versions of the macro
GO_IF_LEGITIMATE_ADDRESS.  See for instance the definition in the mips port.

When strict is false, you can accept pseudo-regs where a reg is OK.
When strict is true, you can't accept pseudo-regs where a reg is OK, because
a pseudo-reg is actually a MEM refering to a stack-slot.

Jim

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

* Re: Troubles building gcc-3.2.1 --target=m68k-linux
  2002-12-10 10:18 ` Jim Wilson
@ 2002-12-10 10:52   ` Peter Barada
  2002-12-10 12:17     ` Andreas Schwab
  2002-12-10 11:13   ` Peter Barada
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Barada @ 2002-12-10 10:52 UTC (permalink / raw)
  To: wilson; +Cc: Peter.Barada, gcc


>You need to have REG_OK_STRICT and !REG_OK_STRICT versions of the macro
>GO_IF_LEGITIMATE_ADDRESS.  See for instance the definition in the mips port.
>
>When strict is false, you can accept pseudo-regs where a reg is OK.
>When strict is true, you can't accept pseudo-regs where a reg is OK, because
>a pseudo-reg is actually a MEM refering to a stack-slot.

I was wondering about that, since I see that in the i386 version.
Eventually I'll include that in the new GO_IF_LEGITIMATE_ADDRESS for m68k.

What I'm *more* concerned (at the moment) is why as a macro
GO_IF_LEGITIMATE_ADDRESS works, but as a function it fails....

-- 
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] 6+ messages in thread

* Re: Troubles building gcc-3.2.1 --target=m68k-linux
  2002-12-10 10:18 ` Jim Wilson
  2002-12-10 10:52   ` Peter Barada
@ 2002-12-10 11:13   ` Peter Barada
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Barada @ 2002-12-10 11:13 UTC (permalink / raw)
  To: wilson; +Cc: Peter.Barada, gcc


>You need to have REG_OK_STRICT and !REG_OK_STRICT versions of the macro
>GO_IF_LEGITIMATE_ADDRESS.  See for instance the definition in the mips port.
>
>When strict is false, you can accept pseudo-regs where a reg is OK.
>When strict is true, you can't accept pseudo-regs where a reg is OK, because
>a pseudo-reg is actually a MEM refering to a stack-slot.

Can you give me an example of an address that is legal when !strict,
but illegal when strict(and the other way around(if it exists))?

Thanx.

-- 
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] 6+ messages in thread

* Re: Troubles building gcc-3.2.1 --target=m68k-linux
  2002-12-10 10:52   ` Peter Barada
@ 2002-12-10 12:17     ` Andreas Schwab
  2002-12-10 12:33       ` Peter Barada
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2002-12-10 12:17 UTC (permalink / raw)
  To: Peter Barada; +Cc: wilson, Peter.Barada, gcc

Peter Barada <pbarada@mail.wm.sps.mot.com> writes:

|> >You need to have REG_OK_STRICT and !REG_OK_STRICT versions of the macro
|> >GO_IF_LEGITIMATE_ADDRESS.  See for instance the definition in the mips port.
|> >
|> >When strict is false, you can accept pseudo-regs where a reg is OK.
|> >When strict is true, you can't accept pseudo-regs where a reg is OK, because
|> >a pseudo-reg is actually a MEM refering to a stack-slot.
|> 
|> I was wondering about that, since I see that in the i386 version.
|> Eventually I'll include that in the new GO_IF_LEGITIMATE_ADDRESS for m68k.
|> 
|> What I'm *more* concerned (at the moment) is why as a macro
|> GO_IF_LEGITIMATE_ADDRESS works, but as a function it fails....

Because you only have one version, but all those macros ultimatively
depend on REG_OK_FOR_INDEX_P and REG_OK_FOR_BASE_P, and those differ
between REG_OK_STRICT and !REG_OK_STRICT.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Troubles building gcc-3.2.1 --target=m68k-linux
  2002-12-10 12:17     ` Andreas Schwab
@ 2002-12-10 12:33       ` Peter Barada
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Barada @ 2002-12-10 12:33 UTC (permalink / raw)
  To: schwab; +Cc: Peter.Barada, wilson, Peter.Barada, gcc


>|> What I'm *more* concerned (at the moment) is why as a macro
>|> GO_IF_LEGITIMATE_ADDRESS works, but as a function it fails....
>
>Because you only have one version, but all those macros ultimatively
>depend on REG_OK_FOR_INDEX_P and REG_OK_FOR_BASE_P, and those differ
>between REG_OK_STRICT and !REG_OK_STRICT.

Duh.

Since I only saw one definition of GO_IF_LEGITIMATE_ADDRESS, I thought
it was invariant.  Obviously that's wrong.

-- 
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] 6+ messages in thread

end of thread, other threads:[~2002-12-10 20:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10  9:43 Troubles building gcc-3.2.1 --target=m68k-linux Peter Barada
2002-12-10 10:18 ` Jim Wilson
2002-12-10 10:52   ` Peter Barada
2002-12-10 12:17     ` Andreas Schwab
2002-12-10 12:33       ` Peter Barada
2002-12-10 11:13   ` Peter Barada

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