From: Michael Meissner Date: Tue, 18 Apr 2017 16:41:06 +0000 (+0000) Subject: re PR target/80099 (ICE in rs6000_expand_vector_extract, at config/rs6000/rs6000... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=19970253373d37faecea458bd9f511c9cb3ed6e7;p=gcc.git re PR target/80099 (ICE in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:7450) [gcc] 2017-04-18 Michael Meissner PR target/80099 * config/rs6000/rs6000.c (rs6000_expand_vector_extract): Eliminate unneeded test for TARGET_UPPER_REGS_SF. * config/rs6000/vsx.md (vsx_extract_v4sf_var): Likewise. [gcc/testsuite] 2017-04-18 Michael Meissner PR target/80099 * gcc.target/powerpc/pr80099-1.c: New test. * gcc.target/powerpc/pr80099-2.c: Likewise. * gcc.target/powerpc/pr80099-3.c: Likewise. * gcc.target/powerpc/pr80099-4.c: Likewise. * gcc.target/powerpc/pr80099-5.c: Likewise. From-SVN: r246972 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07b3384677f..fa3e2575ec1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-04-18 Michael Meissner + + PR target/80099 + * config/rs6000/rs6000.c (rs6000_expand_vector_extract): Eliminate + unneeded test for TARGET_UPPER_REGS_SF. + * config/rs6000/vsx.md (vsx_extract_v4sf_var): Likewise. + 2017-04-18 Jakub Jelinek PR sanitizer/80444 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0fd2365ecf3..8f68d84a8fe 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7600,12 +7600,8 @@ rs6000_expand_vector_extract (rtx target, rtx vec, rtx elt) return; case V4SFmode: - if (TARGET_UPPER_REGS_SF) - { - emit_insn (gen_vsx_extract_v4sf_var (target, vec, elt)); - return; - } - break; + emit_insn (gen_vsx_extract_v4sf_var (target, vec, elt)); + return; case V4SImode: emit_insn (gen_vsx_extract_v4si_var (target, vec, elt)); diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index bfc15270bb0..28fc5b5f3cf 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -2419,8 +2419,7 @@ UNSPEC_VSX_EXTRACT)) (clobber (match_scratch:DI 3 "=r,&b,&b")) (clobber (match_scratch:V2DI 4 "=&v,X,X"))] - "VECTOR_MEM_VSX_P (V4SFmode) && TARGET_DIRECT_MOVE_64BIT - && TARGET_UPPER_REGS_SF" + "VECTOR_MEM_VSX_P (V4SFmode) && TARGET_DIRECT_MOVE_64BIT" "#" "&& reload_completed" [(const_int 0)] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4d1cd159d15..000f4717143 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-04-18 Michael Meissner + + PR target/80099 + * gcc.target/powerpc/pr80099-1.c: New test. + * gcc.target/powerpc/pr80099-2.c: Likewise. + * gcc.target/powerpc/pr80099-3.c: Likewise. + * gcc.target/powerpc/pr80099-4.c: Likewise. + * gcc.target/powerpc/pr80099-5.c: Likewise. + 2017-04-18 Jakub Jelinek PR sanitizer/80444 diff --git a/gcc/testsuite/gcc.target/powerpc/pr80099-1.c b/gcc/testsuite/gcc.target/powerpc/pr80099-1.c new file mode 100644 index 00000000000..9f34c5fbef8 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr80099-1.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2 -mno-upper-regs-sf" } */ + +/* PR target/80099: compiler internal error if -mno-upper-regs-sf used. */ + +int a; +int int_from_mem (vector float *c) +{ + return __builtin_vec_extract (*c, a); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr80099-2.c b/gcc/testsuite/gcc.target/powerpc/pr80099-2.c new file mode 100644 index 00000000000..5800db63212 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr80099-2.c @@ -0,0 +1,128 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2 -mno-upper-regs-sf" } */ + +/* PR target/80099 was an issue with -mno-upper-regs-sf. Test for all variable + extract types with various -mno-upper-regs-* options. */ + +double +d_extract_arg_n (vector double v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +float +f_extract_arg_n (vector float v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +long +sl_extract_arg_n (vector long v, unsigned long n) +{ + return (long) __builtin_vec_extract (v, n); +} + +unsigned long +ul_extract_arg_n (vector unsigned long v, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (v, n); +} + +long +si_extract_arg_n (vector int v, unsigned long n) +{ + return (int) __builtin_vec_extract (v, n); +} + +unsigned long +ui_extract_arg_n (vector unsigned int v, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (v, n); +} + +long +ss_extract_arg_n (vector short v, unsigned long n) +{ + return (short) __builtin_vec_extract (v, n); +} + +unsigned long +us_extract_arg_n (vector unsigned short v, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (v, n); +} + +long +sc_extract_arg_n (vector signed char v, unsigned long n) +{ + return (signed char) __builtin_vec_extract (v, n); +} + +unsigned long +uc_extract_arg_n (vector unsigned char v, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (v, n); +} + + +double +d_extract_mem_n (vector double *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +float +f_extract_mem_n (vector float *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +long +sl_extract_mem_n (vector long *p, unsigned long n) +{ + return (long) __builtin_vec_extract (*p, n); +} + +unsigned long +ul_extract_mem_n (vector unsigned long *p, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (*p, n); +} + +long +si_extract_mem_n (vector int *p, unsigned long n) +{ + return (int) __builtin_vec_extract (*p, n); +} + +unsigned long +ui_extract_mem_n (vector unsigned int *p, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (*p, n); +} + +long +ss_extract_mem_n (vector short *p, unsigned long n) +{ + return (short) __builtin_vec_extract (*p, n); +} + +unsigned long +us_extract_mem_n (vector unsigned short *p, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (*p, n); +} + +long +sc_extract_mem_n (vector signed char *p, unsigned long n) +{ + return (signed char) __builtin_vec_extract (*p, n); +} + +unsigned long +uc_extract_mem_n (vector unsigned char *p, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (*p, n); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr80099-3.c b/gcc/testsuite/gcc.target/powerpc/pr80099-3.c new file mode 100644 index 00000000000..71c2b40b0d1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr80099-3.c @@ -0,0 +1,128 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2 -mno-upper-regs-df" } */ + +/* PR target/80099 was an issue with -mno-upper-regs-sf. Test for all variable + extract types with various -mno-upper-regs-* options. */ + +double +d_extract_arg_n (vector double v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +float +f_extract_arg_n (vector float v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +long +sl_extract_arg_n (vector long v, unsigned long n) +{ + return (long) __builtin_vec_extract (v, n); +} + +unsigned long +ul_extract_arg_n (vector unsigned long v, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (v, n); +} + +long +si_extract_arg_n (vector int v, unsigned long n) +{ + return (int) __builtin_vec_extract (v, n); +} + +unsigned long +ui_extract_arg_n (vector unsigned int v, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (v, n); +} + +long +ss_extract_arg_n (vector short v, unsigned long n) +{ + return (short) __builtin_vec_extract (v, n); +} + +unsigned long +us_extract_arg_n (vector unsigned short v, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (v, n); +} + +long +sc_extract_arg_n (vector signed char v, unsigned long n) +{ + return (signed char) __builtin_vec_extract (v, n); +} + +unsigned long +uc_extract_arg_n (vector unsigned char v, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (v, n); +} + + +double +d_extract_mem_n (vector double *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +float +f_extract_mem_n (vector float *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +long +sl_extract_mem_n (vector long *p, unsigned long n) +{ + return (long) __builtin_vec_extract (*p, n); +} + +unsigned long +ul_extract_mem_n (vector unsigned long *p, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (*p, n); +} + +long +si_extract_mem_n (vector int *p, unsigned long n) +{ + return (int) __builtin_vec_extract (*p, n); +} + +unsigned long +ui_extract_mem_n (vector unsigned int *p, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (*p, n); +} + +long +ss_extract_mem_n (vector short *p, unsigned long n) +{ + return (short) __builtin_vec_extract (*p, n); +} + +unsigned long +us_extract_mem_n (vector unsigned short *p, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (*p, n); +} + +long +sc_extract_mem_n (vector signed char *p, unsigned long n) +{ + return (signed char) __builtin_vec_extract (*p, n); +} + +unsigned long +uc_extract_mem_n (vector unsigned char *p, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (*p, n); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr80099-4.c b/gcc/testsuite/gcc.target/powerpc/pr80099-4.c new file mode 100644 index 00000000000..145dd1724af --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr80099-4.c @@ -0,0 +1,128 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2 -mno-upper-regs-di" } */ + +/* PR target/80099 was an issue with -mno-upper-regs-sf. Test for all variable + extract types with various -mno-upper-regs-* options. */ + +double +d_extract_arg_n (vector double v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +float +f_extract_arg_n (vector float v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +long +sl_extract_arg_n (vector long v, unsigned long n) +{ + return (long) __builtin_vec_extract (v, n); +} + +unsigned long +ul_extract_arg_n (vector unsigned long v, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (v, n); +} + +long +si_extract_arg_n (vector int v, unsigned long n) +{ + return (int) __builtin_vec_extract (v, n); +} + +unsigned long +ui_extract_arg_n (vector unsigned int v, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (v, n); +} + +long +ss_extract_arg_n (vector short v, unsigned long n) +{ + return (short) __builtin_vec_extract (v, n); +} + +unsigned long +us_extract_arg_n (vector unsigned short v, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (v, n); +} + +long +sc_extract_arg_n (vector signed char v, unsigned long n) +{ + return (signed char) __builtin_vec_extract (v, n); +} + +unsigned long +uc_extract_arg_n (vector unsigned char v, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (v, n); +} + + +double +d_extract_mem_n (vector double *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +float +f_extract_mem_n (vector float *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +long +sl_extract_mem_n (vector long *p, unsigned long n) +{ + return (long) __builtin_vec_extract (*p, n); +} + +unsigned long +ul_extract_mem_n (vector unsigned long *p, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (*p, n); +} + +long +si_extract_mem_n (vector int *p, unsigned long n) +{ + return (int) __builtin_vec_extract (*p, n); +} + +unsigned long +ui_extract_mem_n (vector unsigned int *p, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (*p, n); +} + +long +ss_extract_mem_n (vector short *p, unsigned long n) +{ + return (short) __builtin_vec_extract (*p, n); +} + +unsigned long +us_extract_mem_n (vector unsigned short *p, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (*p, n); +} + +long +sc_extract_mem_n (vector signed char *p, unsigned long n) +{ + return (signed char) __builtin_vec_extract (*p, n); +} + +unsigned long +uc_extract_mem_n (vector unsigned char *p, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (*p, n); +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr80099-5.c b/gcc/testsuite/gcc.target/powerpc/pr80099-5.c new file mode 100644 index 00000000000..9ebc0fe466d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr80099-5.c @@ -0,0 +1,128 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -O2 -mno-upper-regs" } */ + +/* PR target/80099 was an issue with -mno-upper-regs-sf. Test for all variable + extract types with various -mno-upper-regs-* options. */ + +double +d_extract_arg_n (vector double v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +float +f_extract_arg_n (vector float v, unsigned long n) +{ + return __builtin_vec_extract (v, n); +} + +long +sl_extract_arg_n (vector long v, unsigned long n) +{ + return (long) __builtin_vec_extract (v, n); +} + +unsigned long +ul_extract_arg_n (vector unsigned long v, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (v, n); +} + +long +si_extract_arg_n (vector int v, unsigned long n) +{ + return (int) __builtin_vec_extract (v, n); +} + +unsigned long +ui_extract_arg_n (vector unsigned int v, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (v, n); +} + +long +ss_extract_arg_n (vector short v, unsigned long n) +{ + return (short) __builtin_vec_extract (v, n); +} + +unsigned long +us_extract_arg_n (vector unsigned short v, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (v, n); +} + +long +sc_extract_arg_n (vector signed char v, unsigned long n) +{ + return (signed char) __builtin_vec_extract (v, n); +} + +unsigned long +uc_extract_arg_n (vector unsigned char v, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (v, n); +} + + +double +d_extract_mem_n (vector double *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +float +f_extract_mem_n (vector float *p, unsigned long n) +{ + return __builtin_vec_extract (*p, n); +} + +long +sl_extract_mem_n (vector long *p, unsigned long n) +{ + return (long) __builtin_vec_extract (*p, n); +} + +unsigned long +ul_extract_mem_n (vector unsigned long *p, unsigned long n) +{ + return (unsigned long) __builtin_vec_extract (*p, n); +} + +long +si_extract_mem_n (vector int *p, unsigned long n) +{ + return (int) __builtin_vec_extract (*p, n); +} + +unsigned long +ui_extract_mem_n (vector unsigned int *p, unsigned long n) +{ + return (unsigned int) __builtin_vec_extract (*p, n); +} + +long +ss_extract_mem_n (vector short *p, unsigned long n) +{ + return (short) __builtin_vec_extract (*p, n); +} + +unsigned long +us_extract_mem_n (vector unsigned short *p, unsigned long n) +{ + return (unsigned short) __builtin_vec_extract (*p, n); +} + +long +sc_extract_mem_n (vector signed char *p, unsigned long n) +{ + return (signed char) __builtin_vec_extract (*p, n); +} + +unsigned long +uc_extract_mem_n (vector unsigned char *p, unsigned long n) +{ + return (unsigned char) __builtin_vec_extract (*p, n); +}