public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilco at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/110791] [12/13/14 Regression] arm: Wrong code with -Os -march=armv8.1-m.main
Date: Mon, 24 Jul 2023 13:09:56 +0000	[thread overview]
Message-ID: <bug-110791-4-QxAPSsfuGz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110791-4@http.gcc.gnu.org/bugzilla/>

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

Wilco <wilco at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilco at gcc dot gnu.org

--- Comment #4 from Wilco <wilco at gcc dot gnu.org> ---
Simpler example:

void f(void);

void bug (char *path, char *p)
{
  while( p > path && p[-1] == '/' )
    p--;
  if (p < path)
    f();
}

bug:
        subs    r3, r1, r0
        cmp     r0, r1
        add     r3, r3, #1
        bhi     .L7
        adds    r0, r0, #1
        bne     .L5
.L7:
        movs    r3, #1
.L5:
        subs    r3, r3, #1
        bne     .L2
        bcc     .L3   ** this is obviously never taken
        bx      lr
.L2:
        ldrb    r2, [r1, #-1]!  @ zero_extendqisi2
        cmp     r2, #47
        beq     .L5
        bx      lr
.L3:
        b       f

  parent reply	other threads:[~2023-07-24 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 10:51 [Bug rtl-optimization/110791] New: " acoplan at gcc dot gnu.org
2023-07-24 11:24 ` [Bug rtl-optimization/110791] " xry111 at gcc dot gnu.org
2023-07-24 11:27 ` acoplan at gcc dot gnu.org
2023-07-24 11:29 ` xry111 at gcc dot gnu.org
2023-07-24 13:09 ` wilco at gcc dot gnu.org [this message]
2023-07-24 13:23 ` rguenth at gcc dot gnu.org
2023-07-24 14:39 ` acoplan at gcc dot gnu.org
2023-07-24 15:14 ` [Bug middle-end/110791] " wilco at gcc dot gnu.org
2024-03-07 23:28 ` [Bug rtl-optimization/110791] [12/13/14 Regression] arm: Wrong code with -Os -march=armv8.1-m.main (maybe fmodulo-sched related) law 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-110791-4-QxAPSsfuGz@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).