Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22315 - jpeg-mmx fails to compile (ICE) with gcc 3.3
Summary: jpeg-mmx fails to compile (ICE) with gcc 3.3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-05 21:02 UTC by Jason Rhinelander
Modified: 2003-09-15 05:19 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix for jpeg-mmx gcc33 fix (jpeg-mmx-1.1.2-gcc33.diff.bz2,1.81 KB, patch)
2003-07-23 17:31 UTC, Chandler Carruth
Details | Diff
the REAL fix... no bzip (jpeg-mmx-1.1.2-gcc33.diff,5.48 KB, patch)
2003-07-23 17:34 UTC, Chandler Carruth
Details | Diff
Patch to jpeg-mmx ebuild (jpeg-mmx-ebuild.patch,888 bytes, patch)
2003-09-09 23:08 UTC, Jason Rhinelander
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Rhinelander 2003-06-05 21:02:36 UTC
gcc -march=athlon-xp -O3 -pipe -I. -c -fPIC -DPIC ./jdapimin.c
jdapimin.c: In function `mmxsupport':
jdapimin.c:463: internal compiler error: asm clobber conflict with output operand
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [jdapimin.lo] Error 1
 
!!! ERROR: media-libs/jpeg-mmx-1.1.2-r1 failed.
!!! Function src_compile, Line 29, Exitcode 2
!!! make failed


This happened first on the Pentium M notebook I'm building, with -O3 - lowering
to -O2 did not correct the problem (as has helped with some other GCC 3.3
problems).  I tried also on my desktop Athlon XP system: same error.

This does not happen with 3.2.3.
Comment 1 Travis Tilley (RETIRED) gentoo-dev 2003-06-25 18:52:52 UTC
I have just confirmed this bug to be unrelated to the hammer patch. I tried compiling this with an unpatched version of gcc 3.3, and got the same error:


./libtool --mode=compile gcc -march=pentium4 -msse -msse2 -mfpmath=sse -O3 -pipe  -I. -c ./jdapistd.c
jdapimin.c: In function `mmxsupport':
jdapimin.c:463: internal compiler error: asm clobber conflict with output operand

It is also not a -O3 related bug since it happens with -O2 as well. It also has nothing to do with sse/sse2 which are available on both the P4 and athlon-xp:

gcc -march=pentium4 -mno-sse -mno-sse2 -pipe -I. -c -fPIC -DPIC ./jdapimin.c
jdapimin.c: In function `mmxsupport':
jdapimin.c:463: internal compiler error: asm clobber conflict with output operand

It also happens with march set to i686 or i383 with -march and -pipe being the only c flags.

I'm going to come back to this later after doing more testing with gcc 3.3 but i must thank you greatly for filing this bug, as I seem to have accidentally skipped this package during my own attempts at bringing stuff up to date with gcc 3.3. :)
Comment 2 Travis Tilley (RETIRED) gentoo-dev 2003-06-26 16:47:42 UTC
This bug is caused by -fPIC.



ayanami jpeg-mmx # gcc -march=pentium4 -msse -msse2 -mfpmath=sse -O3 -pipe -fno-strict-aliasing -I. -c ./jdapimin.c
ayanami jpeg-mmx # gcc -march=pentium4 -msse -msse2 -mfpmath=sse -O3 -pipe -fno-strict-aliasing -I. -c -fPIC ./jdapimin.c
jdapimin.c: In function `mmxsupport':
jdapimin.c:463: internal compiler error: asm clobber conflict with output operand
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
Comment 3 Chandler Carruth 2003-07-23 16:29:00 UTC
Hey, hit this bug too.

So far, here is what i know:

There is a conflict in the list of registers that the ASM in that function lists as clobbered, and the output operand... the output is memory though, so that didn't make alot of sense. BUT, because it goes away w/o PIC, i was thinking that PIC might need a free register (unclobbered) to calculate the memory location with... I am in the process of tinkering with the ASM, and as soon as get any results or am completely stumped i will post here again.
Comment 4 Chandler Carruth 2003-07-23 16:44:06 UTC
Ok. I have the fix, just compiled it successfully... I am going to clean it up some, and then i'll submit it here for testing while i test it some myself.

-illusion (carrbc1@wfu.edu)
Comment 5 Chandler Carruth 2003-07-23 17:31:56 UTC
Created attachment 14945 [details, diff]
fix for jpeg-mmx gcc33 fix

This fixes up the gcc3.3 PIC bug in the assembly.

Also a few cleanups for the assembly.

-illusion
Comment 6 Chandler Carruth 2003-07-23 17:34:10 UTC
Created attachment 14946 [details, diff]
the REAL fix... no bzip

sorry... forgot it couldn't be bzipped
Comment 7 Hanno Böck gentoo-dev 2003-07-26 04:45:10 UTC
Does anyone know what happened to upstream jpeg-mmx?
On the sourceforge-page, there is only a version 0.1.4.
Is this newer than the 1.1.2 found in gentoo?
Comment 8 Travis Tilley (RETIRED) gentoo-dev 2003-08-15 07:46:48 UTC
Note: this bug still exists in gcc 3.3.1 :(


./libtool --mode=compile gcc -march=pentium4 -O2 -pipe  -I. -c ./jdapistd.c
gcc -march=pentium4 -O2 -pipe -I. -c -fPIC -DPIC ./jdapimin.c

jdapimin.c: In function `mmxsupport':
jdapimin.c:463: internal compiler error: asm clobber conflict with output operand
Please submit a full bug report,
with preprocessed source if appropriate.

ayanami root # gcc --version
gcc (GCC) 3.3.1  (Gentoo Linux 3.3.1, propolice)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ayanami root # gcc-config -c
i686-pc-linux-gnu-3.3.1


As for jpeg-mmx versioning,... I have no idea.
Comment 9 Chandler Carruth 2003-08-15 13:00:40 UTC
Yes, it does still exist in GCC 3.3.1, because it is a bug in the library.
The fix still fixes it for GCC 3.3.1, as i am using a very recent snapshot of the 3.3 branch and jpeg-mmx compiles fine.

Basically, PIC needs a register to do memory addressing, and the assembly tries to  use ALL the registers and do memory addressing... so when it clobbers all the registers, the compiler complains, because it needs one of them.

If my assesment of this is incorrect anywhere, please post. I am not 100% certain, but this is the best I could figure out based on reading the docs on PIC in the GCC manual. And, freeing up a register does fix the problem.

Anywho, thought I'd post that the fix works for 3.3.1 as well.

-Chandler Carruth
Comment 10 Matt Taylor 2003-09-09 22:23:49 UTC
this bug is still here, patch works, and gcc-3.3.1-r1 was marked ~x86
Comment 11 Jason Rhinelander 2003-09-09 23:08:46 UTC
Created attachment 17394 [details, diff]
Patch to jpeg-mmx ebuild

In the interest of hurrying the fix, here's a patch to the ebuild.  Should just
be a matter of applying this patch to the ebuild, saving the other one as
files/gcc33-fpic.patch and committing.
Comment 12 Hanno Böck gentoo-dev 2003-09-15 05:19:15 UTC
Fix is in portage.