Bug 750852 - Fedora 16 Alpha: Internal compiler error in VMX build test
Summary: Fedora 16 Alpha: Internal compiler error in VMX build test
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 16
Hardware: ppc64
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F17Betappc
TreeView+ depends on / blocked
 
Reported: 2011-11-02 14:51 UTC by IBM Bug Proxy
Modified: 2012-05-07 13:40 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-04-27 15:38:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Backport of Andreas' two patches (4.35 KB, text/plain)
2012-03-09 17:11 UTC, IBM Bug Proxy
no flags Details


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 76328 0 None None None Never

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}
     (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 1 IBM Bug Proxy 2011-11-02 14:51:23 UTC
------- 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.

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

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

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.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.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 6 IBM Bug Proxy 2011-11-11 16:40:33 UTC
------- 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 7 IBM Bug Proxy 2011-11-15 18:00:22 UTC
------- 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 8 IBM Bug Proxy 2011-11-28 23:20:24 UTC
------- 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 9 IBM Bug Proxy 2011-11-30 19:21:25 UTC
------- 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?

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.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.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

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.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 15 IBM Bug Proxy 2012-05-07 12:00:56 UTC
------- 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


Note You need to log in before you can comment on or make changes to this bug.