public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27697] New: Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h
@ 2021-04-05 23:11 brooks at gcc dot gnu.org
  2021-04-06 18:29 ` [Bug libc/27697] " joseph at codesourcery dot com
  2021-04-08  6:35 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: brooks at gcc dot gnu.org @ 2021-04-05 23:11 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 27697
           Summary: Technically-undefined shifts in
                    sysdeps/x86/dl-cacheinfo.h
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: brooks at gcc dot gnu.org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

We recently got some positives on a "shift sanitizer" check, in
sysdeps/x86/dl-cacheinfo.h.

Specifically, at lines 611 and 628, we have:
    count_mask = ~(-1 << (count_mask + 1));

Technically, left shifts of negative numbers are undefined; we can avoid the
undefined behavior by respelling this as
    count_mask = ~(~0U << (count_mask + 1));

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

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

* [Bug libc/27697] Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h
  2021-04-05 23:11 [Bug libc/27697] New: Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h brooks at gcc dot gnu.org
@ 2021-04-06 18:29 ` joseph at codesourcery dot com
  2021-04-08  6:35 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: joseph at codesourcery dot com @ 2021-04-06 18:29 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
See <https://sourceware.org/legacy-ml/libc-alpha/2019-02/msg00177.html> - 
I failed to get consensus for that patch (my goal there was fixing 
warnings that appeared with -Wextra).

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

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

* [Bug libc/27697] Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h
  2021-04-05 23:11 [Bug libc/27697] New: Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h brooks at gcc dot gnu.org
  2021-04-06 18:29 ` [Bug libc/27697] " joseph at codesourcery dot com
@ 2021-04-08  6:35 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2021-04-08  6:35 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
GCC makes these shifts defined as an extension, but still flags them in the
sanitizers. So we are in a bit of an awkward situation here.

I think we should make the change if it helps with testing glibc with the
sanitizers. This piece of information wasn't available when the patch was
proposed the last time, I think.

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

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

end of thread, other threads:[~2021-04-08  6:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 23:11 [Bug libc/27697] New: Technically-undefined shifts in sysdeps/x86/dl-cacheinfo.h brooks at gcc dot gnu.org
2021-04-06 18:29 ` [Bug libc/27697] " joseph at codesourcery dot com
2021-04-08  6:35 ` fweimer at redhat dot com

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).