The condition we're expecting to eventually run into isn't fully
captured by checking for CTORs, instead we can also run into the
CTOR element conversion.
2020-09-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/97173
* tree-vect-loop.c (vectorizable_live_operation): Extend
assert to also conver element conversions.
* gcc.dg/vect/pr97173.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+typedef struct {
+ char *track;
+ char *clocks;
+ char *fm;
+ char *weak;
+} disk_t;
+
+disk_t disk_update_tlens_d;
+int disk_update_tlens_d_0;
+
+void disk_update_tlens() {
+ disk_update_tlens_d.track = disk_update_tlens_d.clocks =
+ disk_update_tlens_d.track + disk_update_tlens_d_0;
+ disk_update_tlens_d.fm = disk_update_tlens_d.clocks + disk_update_tlens_d_0;
+ disk_update_tlens_d.weak = disk_update_tlens_d.fm;
+ disk_update_tlens_d.track[2] = 5;
+}
if (gimple_code (use_stmt) != GIMPLE_PHI
&& !vect_stmt_dominates_stmt_p (gsi_stmt (*gsi), use_stmt))
{
- gcc_assert (is_gimple_assign (use_stmt)
- && gimple_assign_rhs_code (use_stmt) == CONSTRUCTOR);
+ enum tree_code code = gimple_assign_rhs_code (use_stmt);
+ gcc_assert (code == CONSTRUCTOR
+ || code == VIEW_CONVERT_EXPR
+ || CONVERT_EXPR_CODE_P (code));
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Using original scalar computation for "