Bug 84422 - ICE on various builtin test functions when compiled with -mcpu=power7
Summary: ICE on various builtin test functions when compiled with -mcpu=power7
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0.1
: P3 normal
Target Milestone: ---
Assignee: Carl Love
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2018-02-16 18:16 UTC by Carl Love
Modified: 2018-03-28 23:22 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpcle
Build:
Known to work:
Known to fail:
Last reconfirmed: 2018-02-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Love 2018-02-16 18:16:04 UTC
On Power 8 LE the following builtin test function produce an internal compiler error when compiled with the command:

     gcc -c -m64 -mcpu=power7 <file name>

gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
   during RTL pass: vregs

gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p8.c
    during RTL pass: vregs

gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c
    during RTL pass: vregs

gcc/testsuite/gcc.target/powerpc/sse2-pmuludq-1.c
    during RTL pass: expand

For completeness, the following also fails and has an existing PR for it.

gcc/testsuite/gcc.target/powerpc/builtin-fctid-fctiw-runnable.c
  during RTL pass: reload
  Note, existing PR 83964,
Comment 1 Carl Love 2018-02-16 18:55:42 UTC
GCC trunk commit 257752 fixed the issue with:

  gcc/testsuite/gcc.target/powerpc/builtins-3-runnable.c
   during RTL pass: vregs
Comment 2 Carl Love 2018-02-23 17:29:17 UTC
Moved Power 8 vec_float2, vec_signed2 and vec_unsigned2 builtin tests to new file builtins-3-runnable-p8.c.  Fixed ICE for vec_signed2 and vec_unsigned2 which were found in builtins-3-runnable.c once the vec_float2 test was moved to a P8 test file.  Commit 257937.
Comment 3 Carl Love 2018-02-26 17:14:03 UTC
gcc/testsuite/gcc.target/powerpc/sse2-pmuludq-1.c

Test requres Power 8 as a minimum.  Compiling with -mcpu=power7 generates an ICE but the test requires Power8.  So the ICE shouldn't be an issue under normal testing conditions.
Comment 4 Carl Love 2018-02-26 22:03:36 UTC
gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p8.c
    during RTL pass: vregs

gcc/testsuite/gcc.target/powerpc/fold-vec-neg-longlong.p9.c
    during RTL pass: vregs

Both tests fixed with mainline commit 258006 on 2/26/2018
Comment 5 Carl Love 2018-03-14 23:01:45 UTC
Author: carll
Date: Wed Mar 14 23:01:12 2018
New Revision: 258539

URL: https://gcc.gnu.org/viewcvs?rev=258539&root=gcc&view=rev
Log:
gcc/ChangeLog:

2018-03-14  Carl Love  <cel@us.ibm.com>

	PR target/84422
	* config/rs6000/rs6000-builtin.def: Change expansion for
	VMULESW to BU_P8V_AV_2.
	Change expansion for VMULEUW to BU_P8V_AV_2.
	* config/rs6000/rs6000.c: Change
	ALTIVEC_BUILTIN_VMULESW to P8V_BUILTIN_VMULESW.
	Change ALTIVEC_BUILTIN_VMULEUW to P8V_BUILTIN_VMULEUW.
	Change ALTIVEC_BUILTIN_VMULOSW to P8V_BUILTIN_VMULOSW.
	Change ALTIVEC_BUILTIN_VMULOUW to P8V_BUILTIN_VMULOUW.
	* config/rs6000/rs6000-c.c: Change
	ALTIVEC_BUILTIN_VMULESW to P8V_BUILTIN_VMULESW.
	Change ALTIVEC_BUILTIN_VMULEUW to P8V_BUILTIN_VMULEUW.
	Change ALTIVEC_BUILTIN_VMULOSW to P8V_BUILTIN_VMULOSW.
	Change ALTIVEC_BUILTIN_VMULOUW to P8V_BUILTIN_VMULOUW.

Modified:
    trunk/gcc/config/rs6000/rs6000-builtin.def
    trunk/gcc/config/rs6000/rs6000-c.c
    trunk/gcc/config/rs6000/rs6000.c
Comment 6 Carl Love 2018-03-28 23:22:32 UTC
gcc/testsuite/gcc.target/powerpc/builtin-fctid-fctiw-runnable.c
 was fixed by reverting the patch that added them.  Commit 258492

gcc/testsuite/gcc.target/powerpc/sse2-pmuludq-1.c
  was fixed by commit 258539

At this point all of the test cases that were generating and ICE for -mcpu=power7 have been fixed.  


Closing the issue.