[llvm-bugs] [Bug 44524] New: Pruning of dead -Wshift-count-overflow suppressed in dead branches of _Generic

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 12 03:35:29 PST 2020


            Bug ID: 44524
           Summary: Pruning of dead -Wshift-count-overflow suppressed in
                    dead branches of _Generic
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pskocik at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

A simple example in which I'm getting undesirable -Wshift-count-overflow

        (void)_Generic(0, int: 0, char: /*untaken*/ 0 ?  1 << 200 : 0);
//-Wshift-count-overflow warning

The warning does not come up in a simple

        (void)_Generic(0, char: 0, int: /*taken*/ 0 ?  1 << 200 : 0); //no
warning as expected

or in a flat

        (void)(  0 ? 1 << 200 : 0 ); //no warning as expected

Examples on Compiler Explorer: https://gcc.godbolt.org/z/dW8h2K

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200112/40d04de6/attachment.html>

More information about the llvm-bugs mailing list