[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

Bill Schmidt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Bill Schmidt  ---
Fixed everywhere.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #8 from Bill Schmidt  ---
Author: wschmidt
Date: Wed Apr 12 13:45:27 2017
New Revision: 246874

URL: https://gcc.gnu.org/viewcvs?rev=246874=gcc=rev
Log:
2017-04-12  Bill Schmidt  

Backport from mainline
2017-04-11  Bill Schmidt  

PR target/80376
PR target/80315
* config/rs6000/rs6000.c (rs6000_expand_unop_builtin): Return
CONST0_RTX (mode) rather than const0_rtx where appropriate.
(rs6000_expand_binop_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise; also add missing
vsx_xxpermdi_* variants; also fix typo (arg1 => arg2) for
vshasigma built-ins.
* doc/extend.texi: Document that vec_xxpermdi's third argument
must be a constant.


Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/rs6000/rs6000.c
branches/gcc-5-branch/gcc/doc/extend.texi

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #7 from Bill Schmidt  ---
Author: wschmidt
Date: Wed Apr 12 13:37:30 2017
New Revision: 246873

URL: https://gcc.gnu.org/viewcvs?rev=246873=gcc=rev
Log:
2017-04-12  Bill Schmidt  

Backport from mainline
2017-04-11  Bill Schmidt  

PR target/80376
PR target/80315
* config/rs6000/rs6000.c (rs6000_expand_unop_builtin): Return
CONST0_RTX (mode) rather than const0_rtx where appropriate.
(rs6000_expand_binop_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise; also add missing
vsx_xxpermdi_* variants; also fix typo (arg1 => arg2) for
vshasigma built-ins.
* doc/extend.texi: Document that vec_xxpermdi's third argument
must be a constant.


Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/rs6000/rs6000.c
branches/gcc-6-branch/gcc/doc/extend.texi

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-11 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #6 from Bill Schmidt  ---
Backports still needed.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-11 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #5 from Bill Schmidt  ---
Author: wschmidt
Date: Tue Apr 11 21:37:16 2017
New Revision: 246859

URL: https://gcc.gnu.org/viewcvs?rev=246859=gcc=rev
Log:
2017-04-11  Bill Schmidt  

PR target/80376
PR target/80315
* config/rs6000/rs6000.c (rs6000_expand_unop_builtin): Return
CONST0_RTX (mode) rather than const0_rtx where appropriate.
(rs6000_expand_binop_builtin): Likewise.
(rs6000_expand_ternop_builtin): Likewise; also add missing
vsx_xxpermdi_* variants; also fix typo (arg1 => arg2) for
vshasigma built-ins.
* doc/extend.texi: Document that vec_xxpermdi's third argument
must be a constant.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/doc/extend.texi

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-10 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #4 from Bill Schmidt  ---
Patch under test would produce the follow errors instead:

wschmidt@pike:~/src$ $GCC_INSTALL/bin/gcc pr80376.c 
pr80376.c: In function 'main':
pr80376.c:12:5: error: argument 3 must be a 2-bit unsigned literal
 vec_vsx_st(vec_xxpermdi(a, b, j), 0, c);
 ^~
pr80376.c:12:5: internal compiler error: non-vector constant found where vector
expected
0x116cde0b gen_movv4si(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/config/rs6000/vector.md:114
0x105fd113 insn_gen_fn::operator()(rtx_def*, rtx_def*) const
/home/wschmidt/gcc/gcc-mainline-test/gcc/recog.h:301
0x1077a497 emit_move_insn_1(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:3643
0x1077ab37 emit_move_insn(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:3738
0x107826d3 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:5729
0x107802a3 expand_assignment(tree_node*, tree_node*, bool)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:5321
0x1056ec0b expand_call_stmt
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:2656
0x10572b87 expand_gimple_stmt_1
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:3571
0x105734c3 expand_gimple_stmt
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:3737
0x1057cd03 expand_gimple_basic_block
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:5744
0x1057ef3b execute
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:6357
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-10 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

--- Comment #3 from Bill Schmidt  ---
It's difficult to completely avoid an ICE, as once we have a nested call with
an invalid value it is not simple to recover with our current design.  However,
I will put together a patch that provides better error messages when this
situation arises, and we can consider some re-design work in a later release.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-10 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

Bill Schmidt  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

--- Comment #2 from Bill Schmidt  ---
The vec_xxpermdi interface is incorrectly documented in the GCC docs, and that
needs to be corrected.  Where you have:

vec_xxpermdi(a, b, j)

the use of j is not permitted.  The third argument to vec_xxpermdi must be a
constant in the range [0,3].  We still should not ICE, of course, but the code
as written is not expected to work.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

2017-04-09 Thread dje at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80376

David Edelsohn  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-09
 Ever confirmed|0   |1

--- Comment #1 from David Edelsohn  ---
New.