public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/113756] [14 regression] Wrong code at -O2 on x86_64-linux-gnu since r14-2780-g39f117d6c87
Date: Wed, 07 Feb 2024 09:59:58 +0000	[thread overview]
Message-ID: <bug-113756-4-IzS6J5zJIs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113756-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:29998cc8a21b3a52f706275923166cd1f95d0555

commit r14-8837-g29998cc8a21b3a52f706275923166cd1f95d0555
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Feb 7 10:59:06 2024 +0100

    range-op: Fix up ABSU_EXPR handling [PR113756]

    ABSU_EXPR unary expr is special because it has a signed integer
    argument and unsigned integer result (of the same precision).

    The following testcase is miscompiled since ABSU_EXPR handling has
    been added to range-op because it uses widest_int::from with the
    result sign (i.e. UNSIGNED) rather than the operand sign (i.e. SIGNED),
    so e.g. for the 32-bit int argument mask ends up 0xffffffc1 or something
    similar and even when it has most significant bit in the precision set,
    in widest_int (tree-ssa-ccp.cc really should stop using widest_int, but
    that is I think stage1 task) it doesn't appear to be negative and so
    bit_value_unop ABSU_EXPR doesn't set the resulting mask/value from
    oring of the argument and its negation.

    Fixed thusly, not doing that for GIMPLE_BINARY_RHS because I don't know
    about a binary op that would need something similar.

    2024-02-06  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/113756
            * range-op.cc (update_known_bitmask): For GIMPLE_UNARY_RHS,
            use TYPE_SIGN (lh.type ()) instead of sign for widest_int::from
            of lh_bits value and mask.

            * gcc.dg/pr113756.c: New test.

  parent reply	other threads:[~2024-02-07  9:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 14:14 [Bug tree-optimization/113756] New: " shaohua.li at inf dot ethz.ch
2024-02-04 18:13 ` [Bug tree-optimization/113756] " pinskia at gcc dot gnu.org
2024-02-04 18:17 ` pinskia at gcc dot gnu.org
2024-02-05  9:04 ` [Bug tree-optimization/113756] [14 regression] " rguenth at gcc dot gnu.org
2024-02-06 15:59 ` jakub at gcc dot gnu.org
2024-02-06 16:05 ` jakub at gcc dot gnu.org
2024-02-07  9:59 ` cvs-commit at gcc dot gnu.org [this message]
2024-02-07 10:00 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113756-4-IzS6J5zJIs@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).