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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:456e10f28b36aa417e0db145556831c4f979fbd7

commit r14-9570-g456e10f28b36aa417e0db145556831c4f979fbd7
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Mar 20 10:55:07 2024 +0100

    bitint: Fix handling of conditional bitfield loads [PR114365]

    For the m_var_msb (aka left shift) case of large/huge _BitInt bitfield
loads
    handle_load adds a PHI node, but I forgot to actually update the temporary
    the code later on uses, so the PHI result was unused and the code
    incorrectly used something that wasn't valid SSA form.
    In particular, we emitted
      if (_29 != 2)
        goto <bb 4>; [80.00%]
      else
        goto <bb 5>; [20.00%]

      <bb 4> [local count: 1073741824]:
      _33 = VIEW_CONVERT_EXPR<unsigned long[3]>(s.D.2771)[_31];

      <bb 5> [local count: 1073741824]:
      # _34 = PHI <_33(4), 0(3)>
      _35 = _32 >> 31;
      _36 = _33 << 33;
      _37 = _36 | _35;
      _38 = _37 << _19;
    where instead of _33 the _36 def stmt should be using _34.

    Fixed thusly.

    2024-03-20  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/114365
            * gimple-lower-bitint.cc (bitint_large_huge::handle_load): When
adding
            a PHI node, set iv2 to its result afterwards.

            * gcc.dg/bitint-102.c: New test.
  • [Bug tree-optimization/114365] ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to