https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127475

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-09-18

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
gdb) p debug_tree (elt)
 <integer_cst 0x7ffff7408f60 type <boolean_type 0x7ffff77c9348 bool8> constant
public overflow 16>

{ 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF),
16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF) }

  <bb 5> [local count: 744103079]:
  # vect_vec_iv_.8_37 = PHI <{ 0(OVF), 1(OVF), 2(OVF), 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15 }(4), _40(5)>
  # ivtmp.25_6 = PHI <ivtmp.25_27(4), ivtmp.25_4(5)>
  vect__7.9_41 = VIEW_CONVERT_EXPR<vector(16) unsigned
char>(vect_vec_iv_.8_37);
  _26 = (void *) ivtmp.25_6;
  MEM <vector(16) unsigned char> [(unsigned char *)_26] = vect__7.9_41;
  _38 = (vector(16) <signed-boolean:8>) vect_vec_iv_.8_37;
  _39 = _38 + { 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF),
16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF), 16(OVF)
};
  _40 = (vector(16) signed char) _39;
  ivtmp.25_4 = ivtmp.25_6 + 16;
  if (ivtmp.25_4 != _48)

the thing is that I'd consider the input broken:

  __BB(3):
  i_10 = __PHI (__BB2: 0, __BB4: i_11);
  j_20 = __PHI (__BB2: _Literal (bool8) 0, __BB4: j_21);
...
  j_21 = j_20 + _Literal (bool8) 1;

unless we iterate exactly once.

But the issue is of course that we mistake the signed BOOLEAN_TYPE : 8 as
mask when it is actually data.

Not sure where we get the (OVF)s from.

So the issue seems that get_same_sized_vectype, for a scalar boolean
type always produces a truth type.  And it's vectorizable_induction
using that.  I'm a bit confused as to why we have both a vector type
for the step and one for the actual induction.  They should be always
the same ...

Reply via email to