public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111904] New: Miscompilation with -O3 -fharden-control-flow-redundancy?
@ 2023-10-20 22:25 sjames at gcc dot gnu.org
  2023-10-20 22:28 ` [Bug c/111904] " sjames at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-10-20 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111904
           Summary: Miscompilation with -O3
                    -fharden-control-flow-redundancy?
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: aoliva at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56161&action=edit
memset_explicit-gone-wrong.tar.xz

Needs a trunk build from today or newer for -fharden-control-flow-redundancy.

1. git clone https://git.savannah.gnu.org/git/gnulib.git
2. ./gnulib-tool --single-configure --conditional-dependencies --create-testdir
--dir=uhoh memset_explicit
3. cd uhoh
4. ./configure CFLAGS="-O3 -fharden-control-flow-redundancy" # passes with -O2
5. make TESTS=test-memset_explicit check -j$(nproc)

```
$ ./test-memset_explicit
test_heap: address range is still mapped after free().
test_stack: count = 1000
test-memset_explicit.c:191: assertion 'count < 50' failed
Aborted (core dumped)
```

I'm not sure where it goes wrong yet. Attached
memset_explicit-gone-wrong.tar.xz has uhoh-O2 (good) and uhoh-O3 (bad) for
x86_64, but I reproduced this on arm64 too.

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

end of thread, other threads:[~2023-10-23  0:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 22:25 [Bug c/111904] New: Miscompilation with -O3 -fharden-control-flow-redundancy? sjames at gcc dot gnu.org
2023-10-20 22:28 ` [Bug c/111904] " sjames at gcc dot gnu.org
2023-10-21  4:47 ` [Bug middle-end/111904] " aoliva at gcc dot gnu.org
2023-10-22 23:37 ` sjames at gcc dot gnu.org
2023-10-23  0:09 ` bruno at clisp dot 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).