Re: Inlining with gcc 4.x.x (Linux) ?

Maurice Lombardi <[email protected]> Wed, 11 Jan 2017 19:03:41 +0100
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
Le 11/01/2017 à 13:47, Peter a écrit :
> On 10/01/17 16:05, Prof Abimbola Olowofoyeku wrote:
>
>> snip
>>
>> Works with (32-bit) 4.1.2 (gpc version 20070904, based on gcc-4.1.2)
>> running on 64-bit Linux Mint 17.
>>
>> snip
>
> Thanks, that's interesting.  I tried 32-bit from 4.3.6 via the -m32
> switch, but still not working here.
>
> I would be very interested to see results from any 20070904 64-bit
> compiler based on any gcc-4.x.x   Hopefully someone out there could run
> this test?
>
> gpc -S -O3 InlineDemo.pas
> grep call.*Max InlineDemo.s

I have succesfully compiled gpc-4.3.5 from Waldeck's git programs in 
year 2013
on an old fedora 6 system both for 32 and 64 bits.
The checks are given in attached files.

Running your suggested test gived the attached inlinedemo.s
and grep gives
         call    _p_M0_S0_Max
         call    _p_M0_S0_Max

In fact for my work I still stick with gcc-3.4.6 based gpc because I see 
no advantage in the gcc-4.3.5 based gpc, with contains still a (very 
few) more errors in the tests.

Hope this helps

Maurice

-- 
        Maurice Lombardi
Laboratoire Interdisciplinaire de Physique (LIPhy)
Universite Grenoble Alpes & CNRS - Pôle Phitem
Bat E - 140 rue de la physique
38400 Saint Martin d'Heres FRANCE

Fax: 33 (0)4 76 63 54 95
mailto:[email protected]

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc
rhcheck-32.log (text/plain, 1.7 KB)
cd ./p/test && make MASK="" EXTRA_TEST_PFLAGS=" -m32" TEST_RUN_FLAGS="" "pascal.check-dejagnu"
make[1]: Entering directory `/home/Lombardi/GPC_/build-435/gcc/p/test'
rm -f *.dat *.o *.s *.i *.gpi *.gpd *.gpc core a.out stderr.out *.exe testmake.tmp dummy.c dummy.pas dummy.out diff_cr*.tmp fixcr fixcr.exe
rm -f todo/a.out todo/*.exe todo/*.o todo/*.s todo/*.i todo/*.gpi todo/*.gpd todo/core
GP= PC="/home/Lombardi/GPC_/build-435/gcc/xgpc -B/home/Lombardi/GPC_/build-435/gcc/" PFLAGS="-I ../rts --no-unit-path --unit-path=/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/units --autobuild   -g -O3 -W -Wall -Wno-unused  -m32" PFLAGS_NO_PATHS="-g -O3 -W -Wall -Wno-unused  -m32" SRCDIR="/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test" TEST_MAKE_FLAG=test-make-flag "/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test/test_run"   | tee test_log | "/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test/test_sum" -d
Test Run By lombardi on 2013-03-01 22:08:22
Native configuration is x86_64-unknown-linux-gnu (lobelie.ujf-grenoble.fr)

		=== gpc tests ===

Running target any
Running testsuite ...

FAIL: agettext2test.pas
FAIL: agettexttest.pas
UNSUPPORTED: aregextest.pas
UNSUPPORTED: asmtest.pas
FAIL: dialec3.pas
FAIL: dialec5.pas
FAIL: dialec6.pas
FAIL: emptyrec.pas
FAIL: fjf1102.pas
FAIL: fjf403b.pas
FAIL: fjf563e.pas
FAIL: fjf787.pas
FAIL: fjf848a.pas
FAIL: fjf848b.pas
FAIL: fjf848c.pas
FAIL: fjf998r.pas
FAIL: gmplink.pas
FAIL: gmptest.pas
FAIL: prep1a.pas

		=== gpc Summary ===

# of tests                5112
# of expected passes      5093
# of unexpected failures  17
# of unsupported tests    2

/home/Lombardi/GPC_/build-435/gcc/xgpc version 20070904, based on gcc-4.3.5
make[1]: Leaving directory `/home/Lombardi/GPC_/build-435/gcc/p/test'
rhcheck-64.log (text/plain, 2.3 KB)
../../gcc-4.3.5/gcc/p/script/mkdir-p p/test
{ \
	  echo "# Automatically generated from ../../gcc-4.3.5/gcc/p/test/Makefile."; \
	  echo "# Don't change manually."; \
	  echo ""; \
	  sed -e "s,^srcdir *=.*,srcdir=`cd ../../gcc-4.3.5/gcc/p/test && pwd`,; \
	          s,^PC *=.*,PC=`pwd`/xgpc -B`pwd`/,; \
	          s,^TEST_PATHS *=.*,TEST_PATHS=-I ../rts --no-unit-path --unit-path=`cd ../../gcc-4.3.5/gcc/p/units && pwd`," \
	          ../../gcc-4.3.5/gcc/p/test/Makefile; \
	} > p/test/Makefile || { rm -f p/test/Makefile; false; }
echo timestamp > "p/stamp-test-Makefile"
cd ./p/test && make MASK="" EXTRA_TEST_PFLAGS=" -m64" TEST_RUN_FLAGS="" "pascal.check-dejagnu"
make[1]: Entering directory `/home/Lombardi/GPC_/build-435/gcc/p/test'
rm -f *.dat *.o *.s *.i *.gpi *.gpd *.gpc core a.out stderr.out *.exe testmake.tmp dummy.c dummy.pas dummy.out diff_cr*.tmp fixcr fixcr.exe
rm -f todo/a.out todo/*.exe todo/*.o todo/*.s todo/*.i todo/*.gpi todo/*.gpd todo/core
GP= PC="/home/Lombardi/GPC_/build-435/gcc/xgpc -B/home/Lombardi/GPC_/build-435/gcc/" PFLAGS="-I ../rts --no-unit-path --unit-path=/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/units --autobuild   -g -O3 -W -Wall -Wno-unused  -m64" PFLAGS_NO_PATHS="-g -O3 -W -Wall -Wno-unused  -m64" SRCDIR="/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test" TEST_MAKE_FLAG=test-make-flag "/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test/test_run"   | tee test_log | "/home/Lombardi/GPC_/gcc-4.3.5/gcc/p/test/test_sum" -d
Test Run By lombardi on 2013-03-01 21:53:36
Native configuration is x86_64-unknown-linux-gnu (lobelie.ujf-grenoble.fr)

		=== gpc tests ===

Running target any
Running testsuite ...

FAIL: agettext2test.pas
FAIL: agettexttest.pas
UNSUPPORTED: aregextest.pas
UNSUPPORTED: asmtest.pas
FAIL: awindte2.pas
FAIL: awindtes.pas
FAIL: dialec3.pas
FAIL: dialec5.pas
FAIL: dialec6.pas
FAIL: emptyrec.pas
FAIL: fieldw.pas
FAIL: fjf1102.pas
FAIL: fjf23.pas
FAIL: fjf30b.pas
FAIL: fjf403b.pas
FAIL: fjf563e.pas
FAIL: fjf787.pas
FAIL: fjf848a.pas
FAIL: fjf848b.pas
FAIL: fjf848c.pas
FAIL: prep1a.pas
FAIL: writeb.pas
FAIL: writec.pas
FAIL: writee.pas
FAIL: writeg.pas

		=== gpc Summary ===

# of tests                5112
# of expected passes      5087
# of unexpected failures  23
# of unsupported tests    2

/home/Lombardi/GPC_/build-435/gcc/xgpc version 20070904, based on gcc-4.3.5
make[1]: Leaving directory `/home/Lombardi/GPC_/build-435/gcc/p/test'
inlinedemo.s (text/plain, 2.8 KB)
	.file	"inlinedemo.pas"
	.text
	.p2align 4,,15
	.type	_p__M0_S0_Max, @function
_p__M0_S0_Max:
.LFB2:
	cmpq	%rdi, %rsi
	cmovge	%rsi, %rdi
	movq	%rdi, %rax
	ret
.LFE2:
	.size	_p__M0_S0_Max, .-_p__M0_S0_Max
	.p2align 4,,15
.globl main
	.type	main, @function
main:
.LFB5:
	subq	$8, %rsp
.LCFI0:
	xorl	%ecx, %ecx
	movq	_p_GPC_RTS_VERSION_20070904(%rip), %rax
	call	_p_initialize
	call	_p__M0_init
	call	_p__M0_main_program
	.p2align 4,,5
	call	_p_finalize
	xorl	%eax, %eax
	addq	$8, %rsp
	.p2align 4,,1
	ret
.LFE5:
	.size	main, .-main
	.p2align 4,,15
.globl _p__M0_init
	.type	_p__M0_init, @function
_p__M0_init:
.LFB4:
	cmpb	$0, static_ctor_run_condition_1_2(%rip)
	je	.L9
	rep
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	movb	$1, static_ctor_run_condition_1_2(%rip)
	jmp	_p_DoInitProc
.LFE4:
	.size	_p__M0_init, .-_p__M0_init
	.p2align 4,,15
.globl _p__M0_main_program
	.type	_p__M0_main_program, @function
_p__M0_main_program:
.LFB3:
	subq	$8, %rsp
.LCFI1:
	movq	_p_Output(%rip), %rdi
	movl	$1568, %esi
	call	_p_Write_Init
	movl	$17, %esi
	movl	$42, %edi
	call	_p__M0_S0_Max
	movq	_p_Output(%rip), %rdi
	movq	%rax, %rsi
	movabsq	$-9223372036854775808, %rdx
	call	_p_Write_Integer
	movq	_p_Output(%rip), %rdi
	movabsq	$-9223372036854775808, %rdx
	movl	$32, %esi
	call	_p_Write_Char
	movq	_p_Output(%rip), %rdi
	call	_p_Write_Flush
	movq	_p_Output(%rip), %rdi
	movl	$1568, %esi
	call	_p_Write_Init
	movq	$-2, %rsi
	movq	$-4, %rdi
	call	_p__M0_S0_Max
	movq	_p_Output(%rip), %rdi
	movq	%rax, %rsi
	movabsq	$-9223372036854775808, %rdx
	call	_p_Write_Integer
	movq	_p_Output(%rip), %rdi
	call	_p_Write_Line
	movq	_p_Output(%rip), %rdi
	call	_p_Write_Flush
	cmpq	$0, _p_InOutRes(%rip)
	jne	.L13
	addq	$8, %rsp
	ret
.L13:
	.p2align 4,,5
	call	_p_CheckInOutRes
.LFE3:
	.size	_p__M0_main_program, .-_p__M0_main_program
	.local	static_ctor_run_condition_1_2
	.comm	static_ctor_run_condition_1_2,1,1
	.section	.eh_frame,"a",@progbits
.Lframe1:
	.long	.LECIE1-.LSCIE1
.LSCIE1:
	.long	0x0
	.byte	0x1
	.string	"zR"
	.uleb128 0x1
	.sleb128 -8
	.byte	0x10
	.uleb128 0x1
	.byte	0x3
	.byte	0xc
	.uleb128 0x7
	.uleb128 0x8
	.byte	0x90
	.uleb128 0x1
	.align 8
.LECIE1:
.LSFDE1:
	.long	.LEFDE1-.LASFDE1
.LASFDE1:
	.long	.LASFDE1-.Lframe1
	.long	.LFB2
	.long	.LFE2-.LFB2
	.uleb128 0x0
	.align 8
.LEFDE1:
.LSFDE3:
	.long	.LEFDE3-.LASFDE3
.LASFDE3:
	.long	.LASFDE3-.Lframe1
	.long	.LFB5
	.long	.LFE5-.LFB5
	.uleb128 0x0
	.byte	0x4
	.long	.LCFI0-.LFB5
	.byte	0xe
	.uleb128 0x10
	.align 8
.LEFDE3:
.LSFDE5:
	.long	.LEFDE5-.LASFDE5
.LASFDE5:
	.long	.LASFDE5-.Lframe1
	.long	.LFB4
	.long	.LFE4-.LFB4
	.uleb128 0x0
	.align 8
.LEFDE5:
.LSFDE7:
	.long	.LEFDE7-.LASFDE7
.LASFDE7:
	.long	.LASFDE7-.Lframe1
	.long	.LFB3
	.long	.LFE3-.LFB3
	.uleb128 0x0
	.byte	0x4
	.long	.LCFI1-.LFB3
	.byte	0xe
	.uleb128 0x10
	.align 8
.LEFDE7:
	.ident	"GCC: pkgversion_string ???experimental 20110215"
	.section	.note.GNU-stack,"",@progbits