Bug 106417 - [13 Regression] Wrong code with -O0 since r13-1779-g375668e0508fbe17
Summary: [13 Regression] Wrong code with -O0 since r13-1779-g375668e0508fbe17
Status: RESOLVED DUPLICATE of bug 106414
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 13.0
: P1 normal
Target Milestone: 13.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks: yarpgen
  Show dependency treegraph
 
Reported: 2022-07-23 04:03 UTC by Vsevolod Livinskii
Modified: 2022-07-25 07:04 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work: 12.0
Known to fail:
Last reconfirmed: 2022-07-25 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Livinskii 2022-07-23 04:03:08 UTC
Reproducer:
#include <stdio.h>

signed char var_84 = (signed char)-125;

int a;
void test() __attribute__((noipa));
void test() { var_84 = ~((a < 4094) ^ int(!a)); }

int main() {
  test();
  printf("%d\n", var_84);
  if (var_84 != -1)
    __builtin_abort();
}

Error:
>$ /usr/bin/g++ -O0 driver.cpp && ./a.out 
-1
>$ g++ -O0 driver.cpp && ./a.out 
1
Aborted (core dumped)

gcc version 13.0.0 20220722 (3c4af0f0549a07799d76e9e48d3d3bd85197b92a)
Comment 1 Martin Liška 2022-07-25 06:51:51 UTC
Started with r13-1779-g375668e0508fbe17.
Comment 2 Martin Liška 2022-07-25 07:04:18 UTC
Dup.

*** This bug has been marked as a duplicate of bug 106414 ***