[MPlayer-dev-eng] ppc runtime-cpu-detection fails with gcc 3.3

Jan Paul Schmidt jps at fundament.org
Thu Feb 23 23:11:27 CET 2006


On Thu, Feb 23, 2006 at 02:53:35PM -0500, Alan Curry wrote:

> >$gcc -maltivec -mabi=altivec -S -o - gccbug.c | grep stv
> >$gcc --version
> >gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1495)
> 
> This makes me worry that my test is broken. 20030304 is 8 months before the
> bug was reported and fixed in upstream gcc; how could Apple have fixed it
> already?

Maybe they needed 8 months to get the fix upstream? gcc 3.3 on a Mac
means normally, that it is based on gcc 3.3. Not that it is the same.

There is a document, which shows some differences:

	http://darwinsource.opendarwin.org/August2003GCCUpdate/gcc-1495/AppleReleaseNotes.html
 
> Maybe their assembly output looks different and grepping "stv" is missing the
> target. Could you show me the whole output of
>   gcc -maltivec -mabi=altivec -S -o - gccbug.c

$gcc -maltivec -mabi=altivec -S -o - gccbug.c

	.section __TEXT,__text,regular,pure_instructions
	.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
.section __TEXT,__text,regular,pure_instructions
	.align 2
	.align 2
	.globl _foo
.section __TEXT,__text,regular,pure_instructions
	.align 2
_foo:
	mflr r0
	mfcr r2
	bl saveFP ; save f14-f31
	stmw r13,-220(r1)
	stw r2,4(r1)
	stwu r1,-288(r1)
	mr r30,r1
	bl L_setjmp$stub
	lwz r1,0(r1)
	lwz r11,4(r1)
	lmw r13,-220(r1)
	mtcrf 56,r11
	b restFP ; restore f14-f31
.data
.section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
	.align 2
L_setjmp$stub:
	.indirect_symbol _setjmp
	mflr r0
	bcl 20,31,L0$_setjmp
L0$_setjmp:
	mflr r11
	addis r11,r11,ha16(L_setjmp$lazy_ptr-L0$_setjmp)
	mtlr r0
	lwzu r12,lo16(L_setjmp$lazy_ptr-L0$_setjmp)(r11)
	mtctr r12
	bctr
.data
.lazy_symbol_pointer
L_setjmp$lazy_ptr:
	.indirect_symbol _setjmp
	.long dyld_stub_binding_helper

> It should be under 200 lines... under 50 if the bug is not present.

$gcc -maltivec -mabi=altivec -S -o - gccbug.c | wc -l
      41 

jps




More information about the MPlayer-dev-eng mailing list