public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/96235] New: Segmentation fault with "-Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra"
@ 2020-07-17 15:48 suochenyao at 163 dot com
  2020-07-20  7:13 ` [Bug ipa/96235] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: suochenyao at 163 dot com @ 2020-07-17 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96235
           Summary: Segmentation fault with "-Og -fno-dce -fno-tree-dce
                    -finline-small-functions -fipa-sra"
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: suochenyao at 163 dot com
  Target Milestone: ---

Hi,

I've got a problem when using gcc new trunk version. I compile the following
source code with "-Og -fno-dce -fno-tree-dce -finline-small-functions
-fipa-sra" on x86_64 GNU/Linux. It reports "Segmentation fault (core dumped)".
If I using "gcc -O2 -Wall -Wextra", it will only say "variable ‘g’ set but not
used". But with only optimization level, the problem will not occur. And if I
reduce any one of "-fno-dce -fno-tree-dce -finline-small-functions -fipa-sra",
this problem will not occur as well.
Looking forward to your reply, Thanks!

$ gcc --version
$ gcc (GCC) 11.0.0 20200717 (experimental)
$ 
$ gcc -O2  -Wall -Wextra -fno-strict-aliasing -fwrapv a.c
a.c: In function ‘e’:
a.c:5:7: warning: variable ‘g’ set but not used [-Wunused-but-set-variable]
    5 |   int g = (b >= *f);
      |       ^
$
$ gcc -Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c;
./a.out
Segmentation fault (core dumped)
$ 
$ gcc -O0 a.c; ./a.out
$ gcc -O1 a.c; ./a.out
$ gcc -O2 a.c; ./a.out
$ gcc -O3 a.c; ./a.out
$ gcc -Og a.c; ./a.out
$ gcc -Os a.c; ./a.out
$ 
$ gcc -O1 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c;
./a.out
$ gcc -O2 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c;
./a.out
$ gcc -O3 -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c;
./a.out
$ gcc -Os -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra a.c;
./a.out
$ gcc -Og -fno-tree-dce -finline-small-functions -fipa-sra a.c; ./a.out
$ gcc -Og -fno-dce -finline-small-functions -fipa-sra a.c; ./a.out
$ gcc -Og -fno-dce -fno-tree-dce -fipa-sra a.c; ./a.out
$ gcc -Og -fno-dce -fno-tree-dce -finline-small-functions a.c; ./a.out
$
-------------------------------
int b=1;
long d=1L;
long c=1L;
static int e(long *f) {
  int g = (b >= *f);
  g = (d && c);
  return 0;
}
int main() {
  long a=1L;
  e(&a);
  return 0;
}

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

end of thread, other threads:[~2020-07-29  0:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 15:48 [Bug c/96235] New: Segmentation fault with "-Og -fno-dce -fno-tree-dce -finline-small-functions -fipa-sra" suochenyao at 163 dot com
2020-07-20  7:13 ` [Bug ipa/96235] " rguenth at gcc dot gnu.org
2020-07-20 15:58 ` josephcsible at gmail dot com
2020-07-23  9:01 ` marxin at gcc dot gnu.org
2020-07-23 14:08 ` marxin at gcc dot gnu.org
2020-07-23 14:12 ` marxin at gcc dot gnu.org
2020-07-23 14:13 ` jamborm at gcc dot gnu.org
2020-07-23 14:28 ` marxin at gcc dot gnu.org
2020-07-27 15:04 ` jamborm at gcc dot gnu.org
2020-07-29  0:58 ` suochenyao at 163 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).