public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95475] New: Imprecise column number of runtime error in unreachable program point
@ 2020-06-02  7:26 haoxintu at gmail dot com
  2020-06-02  7:39 ` [Bug c++/95475] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-02  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95475
           Summary: Imprecise column number of runtime error in
                    unreachable program point
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

$cat test.cc
int main(){
int var = 2;
    switch (var) {
        case 1:                  
        default:                   
            __builtin_unreachable();
    }
}

$cat test.c
int main(){
int var = 2;
    switch (var) {
        case 1:                  
        default:                   
            __builtin_unreachable();

    }
}

$g++ -fsanitize=undefined test.cc ; ./a.out
test.cc:6:34: runtime error: execution reached an unreachable program point

$gcc -fsanitize=undefined test.c ; ./a.out
test.c:6:13: runtime error: execution reached an unreachable program point

In clang-trunk

$clang++ -fsanitize=undefined test.cc ; ./a.out
test.cc:6:13: runtime error: execution reached an unreachable program point
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior test.cc:6:13 in 

$clang -fsanitize=undefined test.c ; ./a.out
test.c:6:13: runtime error: execution reached an unreachable program point
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior test.c:6:13 in 

$g++ --version
g++ (GCC) 11.0.0 20200526 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

end of thread, other threads:[~2020-06-02  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02  7:26 [Bug c++/95475] New: Imprecise column number of runtime error in unreachable program point haoxintu at gmail dot com
2020-06-02  7:39 ` [Bug c++/95475] " pinskia at gcc dot gnu.org
2020-06-02  8:04 ` haoxintu at gmail dot com
2020-06-02  8:57 ` 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).