[MPlayer-dev-eng] Re: [MPlayer-users] CVS compile error on PPC

Daniel Egger degger at fhm.edu
Fri Jan 24 17:21:48 CET 2003


Am Fre, 2003-01-24 um 14.39 schrieb Romain Dolbeau:

> Well, gcc already has plenty of extensions that violate the standard.

Does it? As long as one can compile C99 compliant code with gcc, there's
no problem...

> I don't see the problem of adding one more, as long as it's off
> by default.

... and there's the big difference here: Motorolas gcc modifications
change the behaviour of the whole compiler by introducing braced
initialisers.

Standard compliant code breaks in very subtle ways as soon as their
AltiVec switch is turned on, making it a pain in the neck.

> Why not ? Is it worse than ASM-with-C-operand ? (OK I didn't read
> the C99 standard, maybe it *has* ASM-with-C-operand :-)

No, it's an gcc extension, but it doesn't violate the standard.

> Well adding a simple '-faltivec means -maltivec -mabi=altivec'
> in the proper file (can't remember the name) would have made
> everybody's life much easier.

Blame Motorola for using -f instead of the correct -m. For the curious:
-f options change the way the compiler works, i.e. for the front- and
the middleend.
-m options change the code generation and the target, i.e. the backend.

> Anyway the code doesn't work, so I try to "fix" it. Whether the
> code or the compiler is wrong isn't relevant to the end-user :-)

The compiler switches are trivial to fix, I already had them until I
did a cvs update -C by accident. The different initialisers are a
completely different problem, instead of writing

vector unsigned short foo = (0, 1, 2, 3, 4, 5, 6, 7);
or
vector unsigned short foo = {0, 1, 2, 3, 4, 5, 6, 7};

one can write 
unsigned short[] foo = {0, 1, 2, 3, 4, 5, 6, 7} __attribute__ ((aligned (16)));
vector unsigned short vec = (vector unsigned short) *foo;

However that forces the compiler in doing a load from memory instead of
generating the on-the-fly when possible and thus pessimizes the code in
some cases.
 
-- 
Servus,
       Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030124/ab296b5b/attachment.pgp>


More information about the MPlayer-dev-eng mailing list