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

Maurice Lombardi <[email protected]> Wed, 11 Jan 2017 20:32:19 +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

OOPS. I have used the inlinedemo.pas contained in the docdemos directory 
of gpc, instead of the InlineDemo.pas you provided
(notice the different capitalization).
The only difference is the {$R-} directive contained in your version.
But this changes nothing, except the first line in InlineDemo.s, as you 
can see in the attached file.

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