Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1477282 Details for
Bug 1619354
wrong result when compiled with -funroll-loops
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
reduced standalone test case
file_1619354.txt (text/plain), 1.29 KB, created by
Dan Horák
on 2018-08-20 15:10:30 UTC
(
hide
)
Description:
reduced standalone test case
Filename:
MIME Type:
Creator:
Dan Horák
Created:
2018-08-20 15:10:30 UTC
Size:
1.29 KB
patch
obsolete
>// gcc -std=gnu11 -Wall -pipe -g3 -O2 -funroll-loops -o t t.c > >#include <stdint.h> >#include <stdio.h> >#include <stdlib.h> >#include <assert.h> > >#define JEMALLOC_HAVE_BUILTIN_CLZ 1 > >static inline uint32_t pow2_ceil_u32(uint32_t x) { >#if defined(JEMALLOC_HAVE_BUILTIN_CLZ) > if (x <= 1) { > return x; > } > size_t msb_on_index; > msb_on_index = (31 ^ __builtin_clz(x - 1)); > assert(msb_on_index < 31); > return 1U << (msb_on_index + 1); >#else > x--; > x |= x >> 1; > x |= x >> 2; > x |= x >> 4; > x |= x >> 8; > x |= x >> 16; > x++; > return x; >#endif >} > > >void test_pow2_ceil_u32(void) { > unsigned i; > > for (i = 0; i < sizeof(uint32_t) * 8; i++) { > do { > uint32_t a_ = (pow2_ceil_u32(((uint32_t)1) << i)); > uint32_t b_ = (((uint32_t)1) << i); > if (!(a_ == b_)) { > char prefix[256]; > char message[256]; > snprintf(prefix, sizeof(prefix), "Failed assertion: (%s) == (%s) --> %u != %u: ", "pow2_ceil_u32(((uint32_t)1) << i)", "((uint32_t)1) << i", a_, b_); > snprintf(message, sizeof(message), "Unexpected result, i=%u", (uint32_t)i); > printf("%s%s\n", prefix, message); > } > } while (0); > } >} > >int >main(void) { > test_pow2_ceil_u32(); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1619354
: 1477282