public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/114203] New: Miscompilation: A possible miscompilation in GCC 13 and 14 with option -Os
@ 2024-03-02  4:19 141242068 at smail dot nju.edu.cn
  2024-03-02  4:40 ` [Bug tree-optimization/114203] [13/14 Regression] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: 141242068 at smail dot nju.edu.cn @ 2024-03-02  4:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114203
           Summary: Miscompilation: A possible miscompilation in GCC 13
                    and 14 with option -Os
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

The reproduce link: https://gcc.godbolt.org/z/T48jbo5e7

The reproducer (diff: `gcc-14 -O0` and `gcc-14 -Os`):
```
int foo (unsigned char b) {
    int c = 0;

    while (b) {
        b >>= 1;
        c++;
    }

    return c;
}

int main()
{
  if (foo(0) != 0)
    __builtin_abort ();
  return 0;
}
```

I have sanitized this program using ubsan and asan, ubsan and asans outputs
nothing, so I think this is likely a miscompilation bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-21 11:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02  4:19 [Bug c/114203] New: Miscompilation: A possible miscompilation in GCC 13 and 14 with option -Os 141242068 at smail dot nju.edu.cn
2024-03-02  4:40 ` [Bug tree-optimization/114203] [13/14 Regression] " pinskia at gcc dot gnu.org
2024-03-04  9:36 ` rguenth at gcc dot gnu.org
2024-03-04 10:45 ` cvs-commit at gcc dot gnu.org
2024-03-04 10:46 ` [Bug tree-optimization/114203] [13 " rguenth at gcc dot gnu.org
2024-03-21 11:49 ` cvs-commit at gcc dot gnu.org
2024-03-21 11:51 ` rguenth at gcc dot gnu.org

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).