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]

Re: [patch] Add MIPS nonpic tests to testsuite


Committed.  I will look at the sde-elf toolchain next.
Catherine

Richard Sandiford wrote:
Adam Nemet <anemet@caviumnetworks.com> writes:
Catherine Moore <clm@codesourcery.com> writes:
	I've tested with mips-linux and also with mips-sde-elf.  The testsuite
doesn't currently pass with the mips-sde-elf configuration due to extra
compiler/linker messages, though.
Can you elaborate?  It would be nice if the new tests passed on the
configurations that they're run on.

I imagine it was:


%{fPIC|fpic|fPIE|fpie:%{!mips16*:-KPIC}}

in sde.h:SUBTARGET_ASM_SPEC.  So we assemble -fpic code as -mabicalls,
even though GCC hasn't generated that.

If so, it looks like an SDE bug to me, and it's good that the testsuite
has picked up on it.  -fpic really ought to be link-compatible with
-fno-pic, if it's accepted at all.

If that guess is right, I think the patch is OK to commit with
the following changes:

+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/nonpic-\[a-z\]*.c]] {

Part of the reason for splitting out the "main-*" files was that this could simply be non-pic-*.c instead of nonpic-\[a-z\]*.c and that this could be:

+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/main-\[0-9\]*.c]] "-fno-pic" ""

main-*.c instead of main-\[0-9\]*.c.


+These tests are meant to test the interoperability of PIC and nonpic objects for mips.
+This table shows the various combinations and each case is tested by one of the nonpic tests.
+Test Case	The PIC code        	The non-PIC code        The result (stub and/or PLT)
+
+nonpic-1.c	nothing           	nothing              	Neither (trivial)
+nonpic-2.c	nothing           	call only		PLT entry
+nonpic-3.c	nothing           	address taken only	Neither (* But creating a PLT entry is valid)
+nonpic-4.c	nothing           	address and call	PLT entry
+nonpic-5.c	call only           	nothing			.MIPS.stubs entry
+nonpic-6.c	call only           	call only		.MIPS.stubs and PLT
+nonpic-7.c	call only           	address taken only	.MIPS.stubs (* Also creating a PLT entry is valid)
+nonpic-8.c	call only           	address and call	.MIPS.stubs and PLT entry
+nonpic-9.c	address taken only	nothing			Neither
+nonpic-10.c	address taken only	call only		PLT entry
+nonpic-11.c	address taken only	address taken only	Neither (* But creating a PLT entry is valid)
+nonpic-12.c	address taken only	address and call	PLT entry
+nonpic-13.c	address and call	nothing			Neither
+nonpic-14.c	address and call	call only		PLT entry
+nonpic-15.c	address and call	address taken only	Neither (* But creating a PLT entry is valid)
+nonpic-16.c	address and call	address and call	PLT entry

This hasn't been updated for the new names. s/nonpic tests/main-*.c tests/ s/nonpic-/main-/

Looks good to go otherwise, thanks.  But given that Adam and David have
expressed concerns, please leave 24 hours for objections before committing.

Richard


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