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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On the trunk, the distribute_subreg stuff on NOT is only triggered when doing
expand_compound_operation on
(sign_extend:SI (not:QI (subreg:QI (reg:SI 108 [ iftmp.6_16 ]) 0)))
Though, nonzero_bits ((reg:SI 108 [ iftmp.6_16 ]) 0), SImode) says 1.
And at least looking at GIMPLE
  _74 = pretmp_73 != 0;
...
  <bb 10> [local count: 399973127]:
  # iftmp.2_49 = PHI <iftmp.2_48(9), _40(6)>
  _36 = (int) _74;

  <bb 11> [local count: 606019893]:
  # iftmp.6_16 = PHI <_36(10), 0(9)>
  # iftmp.2_50 = PHI <iftmp.2_49(10), iftmp.2_48(9)>
  _9 = (char) iftmp.6_16;
  l_27 = ~_9;
  _10 = (int) l_27;
I think it shoiuld be [0, 1] ranged, so either -1 or -2 result in SImode.

But if I compile with r16-3123 with -O2 and put a breakpoint on that
=> 0x00000000004003cc <+108>:   not    %eax
   0x00000000004003ce <+110>:   movsbl %al,%eax
I see $eax is 0xf7f8bf00 initially, so garbage in the upper bits, bitwise not
turns
that into 0x80740ff and sign extension (missing since r16-3124) changes that to
the
desired 0xffffffff.

Reply via email to