https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104159
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2022-01-21
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
424 break;
425 }
426
427 /* Constants. */
428 if (tree cst = arg->maybe_get_constant ())
429 if (tree result = fold_unary (op, type, cst))
430 {
431 if (CONSTANT_CLASS_P (result))
432 return get_or_create_constant_svalue (result);
433
(gdb) p debug_tree (cst)
<vector_cst 0x7ffff668e558
type <vector_type 0x7ffff66a53f0 W
type <integer_type 0x7ffff655f7e0 long unsigned int public unsigned DI
size <integer_cst 0x7ffff6543d50 constant 64>
unit-size <integer_cst 0x7ffff6543d68 constant 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff655f7e0 precision:64 min <integer_cst 0x7ffff6563030 0> max <integer_cst
0x7ffff6544520 18446744073709551615>
pointer_to_this <pointer_type 0x7ffff656f348>>
unsigned V2DI
size <integer_cst 0x7ffff6543d98 constant 128>
unit-size <integer_cst 0x7ffff6543db0 constant 16>
align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff66a5348 nunits:2 context <translation_unit_decl 0x7ffff6551bb8 t.c>>
constant npatterns:1 nelts-per-pattern:1
elt:0: <integer_cst 0x7ffff6563030 type <integer_type 0x7ffff655f7e0 long
unsigned int> constant 0>>
$1 = void
(gdb) p debug_tree (type)
<vector_type 0x7ffff66a5000 T
type <integer_type 0x7ffff655f5e8 int public SI
size <integer_cst 0x7ffff6543f90 constant 32>
unit-size <integer_cst 0x7ffff6543fa8 constant 4>
align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x7ffff655f5e8 precision:32 min <integer_cst 0x7ffff6543f48 -2147483648> max
<integer_cst 0x7ffff6543f60 2147483647>
pointer_to_this <pointer_type 0x7ffff6567a80>>
V1SI size <integer_cst 0x7ffff6543f90 32> unit-size <integer_cst
0x7ffff6543fa8 4>
align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff667bbd0 nunits:1 context <translation_unit_decl 0x7ffff6551bb8 t.c>
pointer_to_this <pointer_type 0x7ffff66a5bd0>>
$2 = void
and using VIEW_CONVERT_EXPR as op. For truncations you should use
VEC_PACK_TRUNC, but eventually giving up for not explicitely handled
cases would be better.
Note the original stmt is
_1 = VIEW_CONVERT_EXPR<T>(_4);
with both _4 and _1 V1SI (signed/unsigned convert), so not sure how
we got to V2DI here.