public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103860] New: wrong code at -O3 with -fPIC on x86_64-linux-gnu
@ 2021-12-29 16:08 zhendong.su at inf dot ethz.ch
  2021-12-29 17:17 ` [Bug rtl-optimization/103860] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2021-12-29 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103860
           Summary: wrong code at -O3 with -fPIC on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a regression from GCC 5.4, and impact GCC 6.1 and later. 

[591] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211228 (experimental) (GCC) 
[592] % 
[592] % gcctk -O3 small.c; ./a.out
[593] % gcctk -O2 -fPIC small.c; ./a.out
[594] % 
[594] % gcctk -O3 -fPIC small.c
[595] % ./a.out
Segmentation fault
[596] % 
[596] % cat small.c
char a(char b, char c) { return b + c; }
static int d, *e;
int f;
int main() {
  char l = -1;
  for (; l; l = a(l, 1)) {
    while (d < 0)
      ;
    if (d > 0) {
      f = 0;
      *e = 0;
    }
  }
  d = 0;
  return 0;
}

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

end of thread, other threads:[~2022-05-11  6:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 16:08 [Bug tree-optimization/103860] New: wrong code at -O3 with -fPIC on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2021-12-29 17:17 ` [Bug rtl-optimization/103860] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
2021-12-29 17:32 ` jakub at gcc dot gnu.org
2021-12-29 18:10 ` jakub at gcc dot gnu.org
2021-12-29 18:23 ` jakub at gcc dot gnu.org
2021-12-29 19:43 ` segher at gcc dot gnu.org
2021-12-29 19:58 ` jakub at gcc dot gnu.org
2021-12-29 20:30 ` segher at gcc dot gnu.org
2021-12-30 13:24 ` cvs-commit at gcc dot gnu.org
2021-12-30 13:39 ` [Bug rtl-optimization/103860] [9/10/11 " jakub at gcc dot gnu.org
2022-01-04  9:13 ` cvs-commit at gcc dot gnu.org
2022-01-04 13:59 ` rguenth at gcc dot gnu.org
2022-01-24  9:20 ` cvs-commit at gcc dot gnu.org
2022-01-24  9:30 ` [Bug rtl-optimization/103860] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:22 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:23 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub at gcc dot gnu.org

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