public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115278] New: -ftree-vectorize optimizes away volatile write on x86_64
@ 2024-05-29 14:45 raffeck at cs dot fau.de
  2024-05-29 16:48 ` [Bug tree-optimization/115278] [13/14/15 Regression] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: raffeck at cs dot fau.de @ 2024-05-29 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115278
           Summary: -ftree-vectorize optimizes away volatile write on
                    x86_64
           Product: gcc
           Version: 14.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: raffeck at cs dot fau.de
  Target Milestone: ---

Created attachment 58308
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58308&action=edit
minimal example to reproduce bug

The code in the attached minimal example contains two volatile writes to the
same address.

With `gcc -O2 -fno-tree-loop-vectorize`, two writes are present in the
generated object code. With just `gcc -O2` however, only one write is
preserved, the other seems to be optimized away. As these are volatile
accesses, this should be an illegal optimization.

The behavior does not occur with commit 498ad738690, but occurs with
25413fdb2ac, so probably 25413fdb2ac introduced this bug. The behavior still
persists in the current master (commit f46eaad445e).

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

end of thread, other threads:[~2024-06-21 12:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-29 14:45 [Bug tree-optimization/115278] New: -ftree-vectorize optimizes away volatile write on x86_64 raffeck at cs dot fau.de
2024-05-29 16:48 ` [Bug tree-optimization/115278] [13/14/15 Regression] " pinskia at gcc dot gnu.org
2024-05-29 16:49 ` [Bug tree-optimization/115278] [13/14/15 Regression] -ftree-vectorize optimizes away volatile write on x86_64 since r13-3219 pinskia at gcc dot gnu.org
2024-05-31  6:37 ` rguenth at gcc dot gnu.org
2024-05-31  8:04 ` rguenth at gcc dot gnu.org
2024-05-31  8:24 ` avieira at gcc dot gnu.org
2024-05-31  8:25 ` rguenth at gcc dot gnu.org
2024-05-31  8:27 ` pinskia at gcc dot gnu.org
2024-05-31  9:53 ` avieira at gcc dot gnu.org
2024-05-31 12:13 ` cvs-commit at gcc dot gnu.org
2024-05-31 12:13 ` [Bug tree-optimization/115278] [13/14 " rguenth at gcc dot gnu.org
2024-06-21 12:16 ` cvs-commit 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).