Bug 80123 - libgomp tests pr66199-2.c and pr66199-5.c fail with -mcpu=power9
Summary: libgomp tests pr66199-2.c and pr66199-5.c fail with -mcpu=power9
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: acsawdey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-20 15:27 UTC by acsawdey
Modified: 2017-03-29 23:16 UTC (History)
4 users (show)

See Also:
Host:
Target: powerpc64*-*-* power9
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description acsawdey 2017-03-20 15:27:03 UTC
Both of these fail in the same way with 246224:

gcc/xgcc -Bgcc ../trunk/libgomp/testsuite/libgomp.c/pr66199-2.c -Bpowerpc64le-unknown-linux-gnu/libgomp/ -Bpowerpc64le-unknown-linux-gnu/libgomp/.libs -Ipowerpc64le-unknown-linux-gnu/libgomp -I../trunk/libgomp/testsuite/../../include -I../trunk/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -Wno-hsa -fdiagnostics-color=never -fopenmp -O2 -L/home/sawdey/work/gcc/trunk/build4/powerpc64le-unknown-linux-gnu/./libgomp/.libs -lm -o ./pr66199-2.exe -mcpu=power9
../trunk/libgomp/testsuite/libgomp.c/pr66199-2.c: In function ‘f2._omp_fn.3’:
../trunk/libgomp/testsuite/libgomp.c/pr66199-2.c:21:11: error: could not split insn
(insn 70 61 188 (set (reg:V2DI 86 9 [orig:206 vect_cst__132 ] [206])
        (vec_duplicate:V2DI (reg/v:DI 0 0 [orig:163 c ] [163]))) 1235 {vsx_splat_v2di}
     (nil))
../trunk/libgomp/testsuite/libgomp.c/pr66199-2.c:21:11: internal compiler error: in final_scan_insn, at final.c:3025
0x108bc1d3 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../../trunk/gcc/rtl-error.c:108
0x1053fa5b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        ../../trunk/gcc/final.c:3025
0x1053fe37 final(rtx_insn*, _IO_FILE*, int)
        ../../trunk/gcc/final.c:2051
0x10540497 rest_of_handle_final
        ../../trunk/gcc/final.c:4489
0x10540497 execute
        ../../trunk/gcc/final.c:4562


gcc/xgcc -Bgcc ../trunk/libgomp/testsuite/libgomp.c/pr66199-5.c -Bpowerpc64le-unknown-linux-gnu/libgomp/ -Bpowerpc64le-unknown-linux-gnu/libgomp/.libs -Ipowerpc64le-unknown-linux-gnu/libgomp -I../trunk/libgomp/testsuite/../../include -I../trunk/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -Wno-hsa -fdiagnostics-color=never -fopenmp -O2 -L/home/sawdey/work/gcc/trunk/build4/powerpc64le-unknown-linux-gnu/./libgomp/.libs -lm -o ./pr66199-5.exe -mcpu=power9
../trunk/libgomp/testsuite/libgomp.c/pr66199-5.c: In function ‘f2._omp_fn.3’:
../trunk/libgomp/testsuite/libgomp.c/pr66199-5.c:24:11: error: could not split insn
(insn 75 66 200 (set (reg:V2DI 86 9 [orig:209 vect_cst__140 ] [209])
        (vec_duplicate:V2DI (reg/v:DI 0 0 [orig:162 c ] [162]))) 1235 {vsx_splat_v2di}
     (nil))
../trunk/libgomp/testsuite/libgomp.c/pr66199-5.c:24:11: internal compiler error: in final_scan_insn, at final.c:3025
0x108bc1d3 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        ../../trunk/gcc/rtl-error.c:108
0x1053fa5b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        ../../trunk/gcc/final.c:3025
0x1053fe37 final(rtx_insn*, _IO_FILE*, int)
        ../../trunk/gcc/final.c:2051
0x10540497 rest_of_handle_final
        ../../trunk/gcc/final.c:4489
0x10540497 execute
        ../../trunk/gcc/final.c:4562
Comment 1 acsawdey 2017-03-20 21:41:37 UTC
Changing the final constraint of vsx_splat_<mode> from "wr" to "b" allows this to compile and pass the execution test. 

This isn't really a correct fix as "b" is not NO_REGS if 64-bit instructions are disabled.

;; V2DF/V2DI splat
(define_insn_and_split "vsx_splat_<mode>"
  [(set (match_operand:VSX_D 0 "vsx_register_operand"
					"=<VSa>,    <VSa>,we,<VS_64dm>")
	(vec_duplicate:VSX_D
	 (match_operand:<VS_scalar> 1 "splat_input_operand"
					"<VS_64reg>,Z,    b, wr")))]
Comment 2 acsawdey 2017-03-22 17:48:27 UTC
Author: acsawdey
Date: Wed Mar 22 17:47:55 2017
New Revision: 246394

URL: https://gcc.gnu.org/viewcvs?rev=246394&root=gcc&view=rev
Log:
2017-03-21  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/80123
	* doc/md.texi (Constraints): Document wA constraint.
	* config/rs6000/constraints.md (wA): New.
	* config/rs6000/rs6000.c (rs6000_debug_reg_global): Add wA reg_class.
	(rs6000_init_hard_regno_mode_ok): Init wA constraint.
	* config/rs6000/rs6000.h (RS6000_CONSTRAINT_wA): New.
	* config/rs6000/vsx.md (vsx_splat_<mode>): Use wA constraint.



Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/constraints.md
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/rs6000/rs6000.h
    trunk/gcc/config/rs6000/vsx.md
    trunk/gcc/doc/md.texi
Comment 3 acsawdey 2017-03-22 17:49:20 UTC
Fixed in 246394.
Comment 4 Michael Meissner 2017-03-29 23:16:23 UTC
Author: meissner
Date: Wed Mar 29 23:15:51 2017
New Revision: 246577

URL: https://gcc.gnu.org/viewcvs?rev=246577&root=gcc&view=rev
Log:
[gcc]
2017-03-29  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2017-03-21  Aaron Sawdey  <acsawdey@linux.vnet.ibm.com>

	PR target/80123
	* doc/md.texi (Constraints): Document wA constraint.
	* config/rs6000/constraints.md (wA): New.
	* config/rs6000/rs6000.c (rs6000_debug_reg_global): Add wA reg_class.
	(rs6000_init_hard_regno_mode_ok): Init wA constraint.
	* config/rs6000/rs6000.h (RS6000_CONSTRAINT_wA): New.
	* config/rs6000/vsx.md (vsx_splat_<mode>): Use wA constraint.

	2017-03-16  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71294
	* config/rs6000/vsx.md (vsx_splat_<mode>, VSX_D iterator): Allow a
	SPLAT operation on ISA 2.07 64-bit systems that have direct move,
	but no MTVSRDD support, by doing MTVSRD and XXPERMDI.

[gcc/testsuite]
2017-03-29  Michael Meissner  <meissner@linux.vnet.ibm.com>

	Back port from trunk
	2017-03-16  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/71294
	* g++.dg/pr71294.C: New test.


Added:
    branches/gcc-6-branch/gcc/testsuite/g++.dg/pr71294.C
      - copied unchanged from r246332, trunk/gcc/testsuite/g++.dg/pr71294.C
Modified:
    branches/gcc-6-branch/gcc/ChangeLog
    branches/gcc-6-branch/gcc/config/rs6000/constraints.md
    branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
    branches/gcc-6-branch/gcc/config/rs6000/rs6000.h
    branches/gcc-6-branch/gcc/config/rs6000/vsx.md
    branches/gcc-6-branch/gcc/doc/md.texi
    branches/gcc-6-branch/gcc/testsuite/ChangeLog