public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110754] New: assume create spurious load for volatile variable
@ 2023-07-20 19:16 muecker at gwdg dot de
  2023-07-20 22:34 ` [Bug c++/110754] " xry111 at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: muecker at gwdg dot de @ 2023-07-20 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110754
           Summary: assume create spurious load for volatile variable
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: muecker at gwdg dot de
  Target Milestone: ---

With optimization, using assume with volatile create spurious loads:

int bar(int p)
{
    volatile int n = p;
    [[assume (1 == n)]];
    return 1 + n;
}


bar(int):
        mov     DWORD PTR [rsp-4], edi
        mov     eax, DWORD PTR [rsp-4]
        mov     eax, DWORD PTR [rsp-4]
        add     eax, 1
        ret

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

end of thread, other threads:[~2024-03-04 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-20 19:16 [Bug c++/110754] New: assume create spurious load for volatile variable muecker at gwdg dot de
2023-07-20 22:34 ` [Bug c++/110754] " xry111 at gcc dot gnu.org
2023-07-20 22:42 ` [Bug middle-end/110754] " pinskia at gcc dot gnu.org
2023-07-20 22:44 ` pinskia at gcc dot gnu.org
2023-07-20 22:45 ` xry111 at gcc dot gnu.org
2023-07-21  6:44 ` rguenth at gcc dot gnu.org
2023-07-21  8:33 ` muecker at gwdg dot de
2024-02-09  9:15 ` jakub at gcc dot gnu.org
2024-02-09 15:00 ` jakub at gcc dot gnu.org
2024-02-10 10:28 ` cvs-commit at gcc dot gnu.org
2024-03-02  0:38 ` cvs-commit at gcc dot gnu.org
2024-03-04 12:09 ` jakub 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).