View | Details | Return to bug 102788
Collapse All | Expand All

(-)a/gcc/testsuite/g++.dg/vect/pr102788.cc (+32 lines)
Line 0 Link Here
1
// { dg-do run }
2
// { dg-additional-options "-O3" }
3
4
unsigned long long int var_4 = 235;
5
unsigned long long int var_5 = 74;
6
signed char var_12 = -99;
7
unsigned long long int var_349;
8
unsigned char var_645;
9
void test();
10
11
const unsigned long long &min(const unsigned long long &a,
12
			      const unsigned long long &b)
13
{
14
  return b < a ? b : a;
15
}
16
17
void __attribute__((noipa)) test()
18
{
19
  for (short c = var_12; c; c += 5)
20
    ;
21
  for (int e = 0; e < 12; e += 1) {
22
      var_349 = var_4 ? 235 : 74;
23
      var_645 = min((unsigned long long)true, var_5 ? var_12 : var_4);
24
  }
25
}
26
27
int main()
28
{
29
  test();
30
  if (var_645 != 1)
31
    __builtin_abort();
32
}
(-)a/gcc/tree-vect-patterns.c (-6 / +3 lines)
Lines 119-126 vect_init_pattern_stmt (vec_info *vinfo, gimple *pattern_stmt, Link Here
119
    = STMT_VINFO_DEF_TYPE (orig_stmt_info);
119
    = STMT_VINFO_DEF_TYPE (orig_stmt_info);
120
  if (!STMT_VINFO_VECTYPE (pattern_stmt_info))
120
  if (!STMT_VINFO_VECTYPE (pattern_stmt_info))
121
    {
121
    {
122
      gcc_assert (VECTOR_BOOLEAN_TYPE_P (vectype)
122
      gcc_assert (!vectype
123
		  == vect_use_mask_type_p (orig_stmt_info));
123
		  || (VECTOR_BOOLEAN_TYPE_P (vectype)
124
		      == vect_use_mask_type_p (orig_stmt_info)));
124
      STMT_VINFO_VECTYPE (pattern_stmt_info) = vectype;
125
      STMT_VINFO_VECTYPE (pattern_stmt_info) = vectype;
125
      pattern_stmt_info->mask_precision = orig_stmt_info->mask_precision;
126
      pattern_stmt_info->mask_precision = orig_stmt_info->mask_precision;
126
    }
127
    }
Lines 4283-4290 vect_recog_bool_pattern (vec_info *vinfo, Link Here
4283
	  || VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)))
4284
	  || VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)))
4284
	return NULL;
4285
	return NULL;
4285
      vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
4286
      vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (lhs));
4286
      if (vectype == NULL_TREE)
4287
	return NULL;
4288
4287
4289
      if (check_bool_pattern (var, vinfo, bool_stmts))
4288
      if (check_bool_pattern (var, vinfo, bool_stmts))
4290
	{
4289
	{
Lines 5696-5702 vect_pattern_recog_1 (vec_info *vinfo, Link Here
5696
    }
5695
    }
5697
5696
5698
  loop_vinfo = dyn_cast <loop_vec_info> (vinfo);
5697
  loop_vinfo = dyn_cast <loop_vec_info> (vinfo);
5699
  gcc_assert (pattern_vectype);
5700
 
5698
 
5701
  /* Found a vectorizable pattern.  */
5699
  /* Found a vectorizable pattern.  */
5702
  if (dump_enabled_p ())
5700
  if (dump_enabled_p ())
5703
- 

Return to bug 102788