Bug 750852

Summary: Fedora 16 Alpha: Internal compiler error in VMX build test
Product: [Fedora] Fedora Reporter: IBM Bug Proxy <bugproxy>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 16CC: aravindvijayan224185, bergner, jakub, pknirsch, wgomerin
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: ppc64   
OS: All   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-27 15:38:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 803329    
Description Flags
Backport of Andreas' two patches none

Description IBM Bug Proxy 2011-11-02 14:51:08 UTC
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}
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}
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 1 IBM Bug Proxy 2011-11-02 14:51:23 UTC
------- Comment From bergner@vnet.ibm.com 2011-11-02 10:50 EDT-------
This is the same bug Bill reported in the GCC bugzilla:


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.

Comment 2 Aravind vijayan 2011-11-08 15:17:25 UTC

Fedora Bugzappers volunteer triage team

Comment 3 Jakub Jelinek 2011-11-10 10:04:20 UTC
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 4 IBM Bug Proxy 2011-11-10 20:12:42 UTC
------- Comment From bergner@vnet.ibm.com 2011-11-10 15:03 EDT-------
Pat Haugen is kicking off a bisect to identify the revision that fixes it.

Comment 5 IBM Bug Proxy 2011-11-11 16:00:37 UTC
------- Comment From pthaugen@us.ibm.com 2011-11-11 10:52 EDT-------
This started working on trunk with revision 171413.

2011-03-24  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

* reload.c (find_reloads_subreg_address): Add address_reloaded
parameter and return true there if the full address has been
(find_reloads_toplev): Pass address_reloaded flag.
(find_reloads_address_1): Don't use address_reloaded parameter.

Comment 6 IBM Bug Proxy 2011-11-11 16:40:33 UTC
------- Comment From bergner@vnet.ibm.com 2011-11-11 11:38 EDT-------
Identified patch was submitted upstream here:


Comment 7 IBM Bug Proxy 2011-11-15 18:00:22 UTC
------- Comment From bergner@vnet.ibm.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 8 IBM Bug Proxy 2011-11-28 23:20:24 UTC
------- Comment From clnperez@us.ibm.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 9 IBM Bug Proxy 2011-11-30 19:21:25 UTC
------- Comment From baude@us.ibm.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?

Comment 10 Peter Bergner 2012-02-03 16:08:10 UTC
Jakub, is there any chance Andreas' fix will get picked up for the next update?

Comment 11 IBM Bug Proxy 2012-02-17 19:00:21 UTC
------- Comment From bergner@vnet.ibm.com 2012-02-17 13:55 EDT-------
Still waiting for a reply from Red Hat.

Comment 12 IBM Bug Proxy 2012-03-09 17:11:13 UTC
------- Comment From bergner@vnet.ibm.com 2012-03-09 12:02 EDT-------
FYI, here is the request for the upstream backport:


Comment 13 IBM Bug Proxy 2012-03-09 17:11:26 UTC
Created attachment 568962 [details]
Backport of Andreas' two patches

------- Comment on attachment From bergner@vnet.ibm.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

        2012-01-20  Andreas Krebbel  <Andreas.Krebbel@de.ibm.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@de.ibm.com>

        * reload.c (find_reloads_subreg_address): Add address_reloaded
        parameter and return true there if the full address has been
        (find_reloads_toplev): Pass address_reloaded flag.
        (find_reloads_address_1): Don't use address_reloaded parameter.

        2012-01-20  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

        * gcc.c-torture/compile/pr51856.c: New testcase.

Comment 15 IBM Bug Proxy 2012-05-07 12:00:56 UTC
------- Comment From maheshhi@in.ibm.com 2012-05-07 11:57 EDT-------
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