public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/101188] [AVR] Miscompilation and function pointers
Date: Wed, 24 May 2023 11:07:00 +0000	[thread overview]
Message-ID: <bug-101188-4-NAHzzxGBxS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101188-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
It happens in postreload.cc::reload_cse_move2add() when


(insn 45 16 17 2 (set (reg/f:HI 30 r30 [60])
        (reg/v/f:HI 16 r16 [orig:51 self ] [51])) "fail1.c":29:9 101
{*movhi_split} (nil))
(insn 17 45 18 2 (parallel [
            (set (reg/f:HI 30 r30 [60])
                (plus:HI (reg/f:HI 30 r30 [60])
                    (const_int 66 [0x42])))
            (clobber (scratch:QI))
        ]) "fail1.c":29:9 175 {addhi3_clobber} (nil))

is transformed to:

(insn 17 16 18 2 (set (reg/f:HI 30 r30 [60])
        (plus:HI (reg/f:HI 30 r30 [60])
            (const_int 2 [0x2]))) "fail1.c":29:9 165 {*addhi3_split} (nil))

The wrong setting of "success" is in postreload.cc:2028 as of the following, so
the condition that leads to there is bogus.

https://gcc.gnu.org/git/?p=gcc.git;a=blame;f=gcc/postreload.cc;h=fb392651e1b6a60e12bf3d36bc302bf9be8bc608;hb=03c7c418baa01f0642817bc9b44192d134102aa9#l2028

  parent reply	other threads:[~2023-05-24 11:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  7:36 [Bug c/101188] New: " joel.bertrand at systella dot fr
2021-06-25  8:09 ` [Bug target/101188] " saaadhu at gcc dot gnu.org
2023-05-24  6:56 ` gjl at gcc dot gnu.org
2023-05-24  7:21 ` [Bug rtl-optimization/101188] " gjl at gcc dot gnu.org
2023-05-24  7:44 ` gjl at gcc dot gnu.org
2023-05-24 11:07 ` gjl at gcc dot gnu.org [this message]
2023-05-24 19:07 ` gjl at gcc dot gnu.org
2023-05-25  9:47 ` gjl at gcc dot gnu.org
2023-05-28  9:24 ` [Bug rtl-optimization/101188] [postreload] Uses content of a clobbered register gjl at gcc dot gnu.org
2023-05-28 19:26 ` gjl at gcc dot gnu.org
2023-05-29 19:35 ` gjl at gcc dot gnu.org
2023-05-30 19:05 ` gjl at gcc dot gnu.org
2023-06-02 10:36 ` uweigand at gcc dot gnu.org
2023-06-02 11:27 ` gjl at gcc dot gnu.org
2023-06-02 15:35 ` uweigand at gcc dot gnu.org
2023-06-12 18:55 ` cvs-commit at gcc dot gnu.org
2023-06-13 11:42 ` gjl at gcc dot gnu.org
2023-06-13 11:45 ` gjl at gcc dot gnu.org
2023-08-09 18:57 ` gjl at gcc dot gnu.org
2024-02-09 11:23 ` [Bug rtl-optimization/101188] [11/12/13 Regression] " gjl at gcc dot gnu.org
2024-02-09 13:02 ` rguenth at gcc dot gnu.org
2024-05-08 11:47 ` rguenth 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-101188-4-NAHzzxGBxS@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).