public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27901] New: TEST_STACK_ALIGN doesn't work
@ 2021-05-23 15:55 hjl.tools at gmail dot com
  2021-05-24 14:45 ` [Bug libc/27901] " hjl.tools at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2021-05-23 15:55 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 27901
           Summary: TEST_STACK_ALIGN doesn't work
           Product: glibc
           Version: 2.34
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

tst-stack-align.h has

#define TEST_STACK_ALIGN() \
  ({                                                                         \
    double _d = 12.0;                                                        \
    long double _ld = 15.0;                                                  \
    int _ret = 0;                                                            \
    printf ("double:  %g %p %zu\n", _d, &_d, __alignof (double));            \
    if ((((uintptr_t) &_d) & (__alignof (double) - 1)) != 0)                 \
      _ret = 1;                                                              \
                                                                             \
    printf ("ldouble: %Lg %p %zu\n", _ld, &_ld, __alignof (long double));    \
    if ((((uintptr_t) &_ld) & (__alignof (long double) - 1)) != 0)           \
      _ret = 1;                                                              \
    _ret;                                                                    \
    })

But compiler may optimize out

if ((((uintptr_t) &_d) & (__alignof (double) - 1)) != 0)

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

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

* [Bug libc/27901] TEST_STACK_ALIGN doesn't work
  2021-05-23 15:55 [Bug libc/27901] New: TEST_STACK_ALIGN doesn't work hjl.tools at gmail dot com
@ 2021-05-24 14:45 ` hjl.tools at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2021-05-24 14:45 UTC (permalink / raw)
  To: glibc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.34
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.34 by

commit 79aec841029c160a85f46564f8bad132af008e30
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun May 23 09:15:52 2021 -0700

    Properly check stack alignment [BZ #27901]

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

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

end of thread, other threads:[~2021-05-24 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-23 15:55 [Bug libc/27901] New: TEST_STACK_ALIGN doesn't work hjl.tools at gmail dot com
2021-05-24 14:45 ` [Bug libc/27901] " hjl.tools at gmail 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).