public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94620] New: GCC 9.2.1 segfaults when compiling file with -O3
@ 2020-04-16 15:03 ola.olsson at acconeer dot com
  2020-04-16 15:07 ` [Bug c/94620] " ola.olsson at acconeer dot com
  2020-04-16 15:08 ` jakub at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: ola.olsson at acconeer dot com @ 2020-04-16 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94620
           Summary: GCC 9.2.1 segfaults when compiling file with -O3
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ola.olsson at acconeer dot com
  Target Milestone: ---

Created attachment 48291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48291&action=edit
Preprocessed ffile of the smallest example I could make

Hi,
I compiled the c-file version of the attached file with:
$ gcc -v -save-temps -fsanitize=undefined  -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -Wall -Wextra -O3 -c segfault.c  > gcc_info
2>&1

The issue does not happen if I use -O0.

$ cat gcc_info 
Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.2.1-9ubuntu2'
--with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-9
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--with-target-system-zlib=auto --enable-multiarch --disable-werror
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.2.1 20191008 (Ubuntu 9.2.1-9ubuntu2) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fsanitize=undefined'
'-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations' '-Wall'
'-Wextra' '-O3' '-c' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -E -quiet -v -imultiarch x86_64-linux-gnu
segfault.c -mtune=generic -march=x86-64 -Wall -Wextra -fsanitize=undefined
-fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations -O3
-fpch-preprocess -fasynchronous-unwind-tables -fstack-protector-strong
-Wformat-security -fstack-clash-protection -fcf-protection -o segfault.i
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/9/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/9/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fsanitize=undefined'
'-fno-strict-aliasing' '-fwrapv' '-fno-aggressive-loop-optimizations' '-Wall'
'-Wextra' '-O3' '-c' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -fpreprocessed segfault.i -quiet -dumpbase
segfault.c -mtune=generic -march=x86-64 -auxbase segfault -O3 -Wall -Wextra
-version -fsanitize=undefined -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations -fasynchronous-unwind-tables
-fstack-protector-strong -Wformat-security -fstack-clash-protection
-fcf-protection -o segfault.s
GNU C17 (Ubuntu 9.2.1-9ubuntu2) version 9.2.1 20191008 (x86_64-linux-gnu)
        compiled by GNU C version 9.2.1 20191008, GMP version 6.1.2, MPFR
version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C17 (Ubuntu 9.2.1-9ubuntu2) version 9.2.1 20191008 (x86_64-linux-gnu)
        compiled by GNU C version 9.2.1 20191008, GMP version 6.1.2, MPFR
version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: dd54e5384b34908287640134d9f8a49c
during IPA pass: inline
segfault.c: In function ‘get_element’:
segfault.c:8:5: internal compiler error: Segmentation fault
    8 | int get_element(a_struct *m, int row, int col)
      |     ^~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.

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

* [Bug c/94620] GCC 9.2.1 segfaults when compiling file with -O3
  2020-04-16 15:03 [Bug c/94620] New: GCC 9.2.1 segfaults when compiling file with -O3 ola.olsson at acconeer dot com
@ 2020-04-16 15:07 ` ola.olsson at acconeer dot com
  2020-04-16 15:08 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ola.olsson at acconeer dot com @ 2020-04-16 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ola Olsson <ola.olsson at acconeer dot com> ---
Somehow I managed to create two bugs. Sorry about this. Let's do the
conversation in the other one (94621).

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

* [Bug c/94620] GCC 9.2.1 segfaults when compiling file with -O3
  2020-04-16 15:03 [Bug c/94620] New: GCC 9.2.1 segfaults when compiling file with -O3 ola.olsson at acconeer dot com
  2020-04-16 15:07 ` [Bug c/94620] " ola.olsson at acconeer dot com
@ 2020-04-16 15:08 ` jakub at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-16 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
.

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

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

end of thread, other threads:[~2020-04-16 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16 15:03 [Bug c/94620] New: GCC 9.2.1 segfaults when compiling file with -O3 ola.olsson at acconeer dot com
2020-04-16 15:07 ` [Bug c/94620] " ola.olsson at acconeer dot com
2020-04-16 15:08 ` 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).