that problem happens while building libavicodec's idct_altivec.c. I restricted the issue inq the idct_add_altivec() function. the code is usually built with "-O4 -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec -pipe -ffast-math -fomit-frame-pointer" and with gcc-3.2.3 produces correct code. if I change it removing -O4 and not putting any other -O (tested -O2 and -O1) the result is a fully working code.
Created attachment 5724 [details] Preprocessed source
Can you provide the non-preprocessed source as looking to the preprocessed source for altivec is a pain?
Created attachment 5725 [details] source
I have something similiar when attempting to build mpegvideo_altivec.c from ffmpeg. The following command always gives an ICE: gcc -Wall -maltivec -mabi=altivec -g -O3 -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -c -o ppc/mpegvideo_altivec.o ppc/mpegvideo_altivec.c Only when dropping -O entirely does it compile. Output when adding -v and -save-tempts is as follows: Reading specs from /usr/lib/gcc-lib/powerpc-linux/3.3.3/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux Thread model: posix gcc version 3.3.3 (Debian 20040306) /usr/lib/gcc-lib/powerpc-linux/3.3.3/cc1 -E -quiet -v -I.. -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=unix -Asystem=posix -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE ppc/mpegvideo_altivec.c -maltivec -mabi=altivec -Wall -O3 mpegvideo_altivec.i ignoring nonexistent directory "/usr/powerpc-linux/include" #include "..." search starts here: #include <...> search starts here: .. /usr/local/include /usr/lib/gcc-lib/powerpc-linux/3.3.3/include /usr/include End of search list. /usr/lib/gcc-lib/powerpc-linux/3.3.3/cc1 -fpreprocessed mpegvideo_altivec.i -quiet -dumpbase mpegvideo_altivec.c -maltivec -mabi=altivec -auxbase-strip ppc/mpegvideo_altivec.o -g -O3 -Wall -version -o mpegvideo_altivec.s GNU C version 3.3.3 (Debian 20040306) (powerpc-linux) compiled by GNU C version 3.3.3 (Debian 20040306). GGC heuristics: --param ggc-min-expand=72 --param ggc-min-heapsize=80312 ppc/mpegvideo_altivec.c: In function `dct_quantize_altivec': ppc/mpegvideo_altivec.c:516: internal compiler error: in add_location_or_const_value_attribute, at dwarf2out.c:9496 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 5919 [details] Preprocessed source
Jonathan Gray, Your bug is that 3.3.3 did not have a patch to fix that ICE, it has been fixed already in 3.3.4.
Lu Zero, I'm revisiting this bug report. The testcase you provided cannot be executed to check for the miscompilation, which makes it very difficult for us to check for the problem. Would you please provide a testcase with a main() invoking idc_add_altivec() with some valid parameters, and aborting if the result is incorrect (assuming it does not crash right way because of the miscompilation)? Thanks
Fixed at least on gcc-3.4.x and in the hammer branch. gcc-3.3.4 should have other problems (I didn't check yet) the best way to check about the problem works is just use mplayer or ffplay...
Fixed so closing.