public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/27126] New: Step will skip prior statements for statements with omp atomic directive at -O1 (bug or feature?)
@ 2020-12-29  1:46 yangyibiao at outlook dot com
  2020-12-29  2:12 ` [Bug breakpoints/27126] " yangyibiao at outlook dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: yangyibiao at outlook dot com @ 2020-12-29  1:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27126

            Bug ID: 27126
           Summary: Step will skip prior statements for statements with
                    omp atomic directive at -O1 (bug or feature?)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: yangyibiao at outlook dot com
                CC: vries at gcc dot gnu.org
  Target Milestone: ---

Created attachment 13083
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13083&action=edit
the binary

Consider the following program:
---
$ cat small.c
int x = 6;

int main ()
{ // L4
  #pragma omp atomic
    x = x * 7 + 6; // L6
  #pragma omp atomic
    x = x - 8 + 6; // L8
  #pragma omp atomic
    x = x * 7 ^ 6; // L10
  return 0; // L11
}
---

If compiled with optimization enabled(-O1, -O2, -O3 et.al), gdb behaves
incorrect)

$ gcc -O1 -g small.c
$ gdb a.out
(gdb) start
Temporary breakpoint 1, main () at small.c:4
4       { // L4
(gdb) s
10          x = x * 7 ^ 6; // L10
(gdb) s
11        return 0; // L11


##############################
Line L6 and Line L8 are skipped when stepping. However, LLDB behaves like my
expectation: LLDB will stop at L6 and L8.


$ gdb -v
GNU gdb (GDB) 11.0.50.20201224-git
$ gcc -v
gcc version 10.2.0 (Ubuntu 10.2.0-5ubuntu1~20.04)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-01-05  8:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-29  1:46 [Bug breakpoints/27126] New: Step will skip prior statements for statements with omp atomic directive at -O1 (bug or feature?) yangyibiao at outlook dot com
2020-12-29  2:12 ` [Bug breakpoints/27126] " yangyibiao at outlook dot com
2021-01-04  8:25 ` vries at gcc dot gnu.org
2021-01-05  1:49 ` yangyibiao at outlook dot com
2021-01-05  8:00 ` vries 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).