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

            Bug ID: 113722
           Summary: Folding of __builtin_bswap128 doesn't work anymore
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bouanto at zoho dot com
  Target Milestone: ---

With the following code:

#include <stdio.h>

int main(int argc, char* argv[]) {
    __uint128_t res = __builtin_bswap128 (2);
    printf("Value: %ld\n", res >> 64);
    res = __builtin_bswap128 (argc + 1);
    printf("Value: %ld\n", res >> 64);
}

it gives the following output in gcc 13.2.1:

Value: 144115188075855872
Value: 144115188075855872

while it gives the following output in the master branch, commit
2c27aa8d75113f404bf9cd39364611af386d9719:

Value: 0
Value: 144115188075855872

So it seems to be a regression in the folding of wide_int::bswap.

Reply via email to