I did a VMX test using existing test package and when doing the build it gave the following compiling errors: [root@c57f1ju0203 testVMX-0.2.2]# make gcc gcc -O3 -m32 -mcpu=970 -mtune=970 -maltivec -mabi=altivec -ffast-math -finline-functions -frerun-loop-opt -frerun-cse-after-loop -DALTIVEC -DGCC_COMPILER -x c -o testVMX-gcc-32 testVMX.c memoryVector.c -lm g++ -O3 -m32 -mcpu=970 -mtune=970 -maltivec -mabi=altivec -ffast-math -finline-functions -frerun-loop-opt -frerun-cse-after-loop -DALTIVEC -DGCC_COMPILER -x c++ -o testVMX-g++-32 testVMX.c memoryVector.c -lm gcc -O3 -m64 -mcpu=970 -mtune=970 -maltivec -mabi=altivec -ffast-math -finline-functions -frerun-loop-opt -frerun-cse-after-loop -DALTIVEC -DGCC_COMPILER -x c -o testVMX-gcc-64 testVMX.c memoryVector.c -lm testVMX.c: In function ??part3??: testVMX.c:5340:1: error: insn does not satisfy its constraints: (insn 38767 19596 38766 2202 (set (reg:V4SI 6 6) (const_vector:V4SI [ (const_int 15 [0xf]) (const_int 15 [0xf]) (const_int 15 [0xf]) (const_int 15 [0xf]) ])) testVMX.c:4485 1000 {*altivec_movv4si} (nil)) testVMX.c:5340:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403 Please submit a full bug report, with preprocessed source if appropriate. == Comment: 2011.11.02 00:38:29 == Cut down testcase: #include <altivec.h> typedef union { vector unsigned int v; unsigned int e[4]; } bar; int testcase() { int a = 1, b, i; vector unsigned int c = (vector unsigned int){1, 1, 1, 1}; vector unsigned int d = (vector unsigned int){1, 2, 1, 2}; bar c_u, d_u; c_u.v = c; d_u.v = d; b = vec_all_le(c_u.v, d_u.v); for (i=0; i < 4; i++) a += (c_u.e[i] <= d_u.e[i]); if (b != a) return 1; return 0; } == Comment: 2011.11.02 00:39:28 == Fails on FC16: gcc version 4.6.1 20111003 (Red Hat 4.6.1-10) (GCC) # gcc -Wall -O3 -m64 -maltivec -c foo3.c foo3.c: In function ???testcase???: foo3.c:28:1: error: insn does not satisfy its constraints: (insn 69 7 68 2 (set (reg:V4SI 10 10) (const_vector:V4SI [ (const_int 1 [0x1]) (const_int 1 [0x1]) (const_int 1 [0x1]) (const_int 1 [0x1]) ])) foo3.c:16 1000 {*altivec_movv4si} (nil)) foo3.c:28:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:403 Alan tells me it passes on mainline: gcc (GCC) 4.7.0 20111028 (experimental)
------- Comment From bergner.com 2011-11-02 10:50 EDT------- This is the same bug Bill reported in the GCC bugzilla: http://gcc.gnu.org/PR50181 Although Anton's reduced test case is much smaller than Bill's largish Fortran test case :) Obviously, doing a VMX load into an integer register is not a good thing. I'm a little hesitant to say this is FIXEDAWAITINGTEST until we've identified why this passed on mainline. It may be that is is fixed there, or we could just be getting lucky and the bug is still present, but latent.
-- Fedora Bugzappers volunteer triage team https://fedoraproject.org/wiki/BugZappers
Can you bisect it which trunk commit made it go away? Then we can figure out if it is a fix for that or just some unrelated change that made the bug go latent?
------- Comment From bergner.com 2011-11-10 15:03 EDT------- Pat Haugen is kicking off a bisect to identify the revision that fixes it.
------- Comment From pthaugen.com 2011-11-11 10:52 EDT------- This started working on trunk with revision 171413. 2011-03-24 Andreas Krebbel <Andreas.Krebbel.com> * reload.c (find_reloads_subreg_address): Add address_reloaded parameter and return true there if the full address has been reloaded. (find_reloads_toplev): Pass address_reloaded flag. (find_reloads_address_1): Don't use address_reloaded parameter.
------- Comment From bergner.com 2011-11-11 11:38 EDT------- Identified patch was submitted upstream here: http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01527.html
------- Comment From bergner.com 2011-11-15 12:58 EDT------- At the top of the web page I pointed you to, you should see the following: Other format: [Raw text] Click on the "Raw Text" link and you can save that page as your patch.
------- Comment From clnperez.com 2011-11-28 18:12 EDT------- [Making external] > Ok,with the gcc patch rebuilt I redid the testVMX test and this time it passed. > Thanks a lot!
------- Comment From baude.com 2011-11-30 14:15 EDT------- @Fedora, we have confirmed the patch that Berger points at resolves the defect. Would you consider pulling this patch into gcc?
Jakub, is there any chance Andreas' fix will get picked up for the next update?
------- Comment From bergner.com 2012-02-17 13:55 EDT------- Still waiting for a reply from Red Hat.
------- Comment From bergner.com 2012-03-09 12:02 EDT------- FYI, here is the request for the upstream backport: http://gcc.gnu.org/ml/gcc-patches/2012-02/msg01428.html
Created attachment 568962 [details] Backport of Andreas' two patches ------- Comment on attachment From bergner.com 2012-03-09 12:00 EDT------- I'm attaching the backport of Andreas' patches we want picked up in Fedora 16. I'll also note that I have asked upstream that these be applied to the FSF 4.5 and 4.6 branches where this bug also exists. If it's easier to commit them there and them merge the F16 source with upstream, that's fine with me to. PR target/50181 Backported from mainline gcc/ 2012-01-20 Andreas Krebbel <Andreas.Krebbel.com> PR rtl-optimization/51856 * reload.c (find_reloads_subreg_address): Set the address_reloaded flag to reloaded. 2011-03-24 Andreas Krebbel <Andreas.Krebbel.com> * reload.c (find_reloads_subreg_address): Add address_reloaded parameter and return true there if the full address has been reloaded. (find_reloads_toplev): Pass address_reloaded flag. (find_reloads_address_1): Don't use address_reloaded parameter. gcc/testsuite/ 2012-01-20 Andreas Krebbel <Andreas.Krebbel.com> * gcc.c-torture/compile/pr51856.c: New testcase.
------- Comment From maheshhi.com 2012-05-07 11:57 EDT------- Hi, I Verified this on Fedora 17 alpha PPC64 and we did not get any compilation errors and all tests are passed. Looks like It is fixed now with F17 alpha PPC64. Here is the output: g++ -O3 -m64 -mcpu=970 -mtune=970 -maltivec -mabi=altivec -ffast-math -finline-functions -frerun-loop-opt -frerun-cse-after-loop -DALTIVEC -DGCC_COMPILER -x c++ -o testVMX-g++-64 testVMX.c memoryVector.c -lm ---uname -a --- Linux c57f1ju0203.ppd.pok.ibm.com 3.3.4-1.fc17.ppc64 #1 SMP Tue May 1 12:48:10 MST 2012 ppc64 ppc64 ppc64 GNU/Linux [root@c57f1ju0203 glibc-2.15-a316c1f]# gcc --version gcc (GCC) 4.7.0 20120416 (Red Hat 4.7.0-2) Copyright (C) 2012 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. Thanks, Mahesh