[Bug analyzer/94999] New: internal compiler error: in saved_diagnostic

2020-05-08 Thread tommy-gccbugs at thorn dot ws
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94999

Bug ID: 94999
   Summary: internal compiler error: in saved_diagnostic
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: tommy-gccbugs at thorn dot ws
  Target Milestone: ---

Created attachment 48478
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48478&action=edit
Reproduces the internal bug

GCC 10 just landed in Ubuntu Focal, identifying itself as

  gcc version 10.0.1 20200411 (experimental) [master revision
  bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566]
  (Ubuntu 10-20200411-0ubuntu1)

I gave the analyzer a try and immediately hit an internal error with

  $ gcc-10 -fanalyzer -std=c99 bug.c

during IPA pass: analyzer
memory.c: In function ‘mk_entry’:
memory.c:116:12: internal compiler error: in saved_diagnostic, at
analyzer/diagnostic-manager.cc:84
  116 | return (struct entry) {safe_calloc(end - start, 1), start, end};
  |^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug c/54176] New: lm32-elf-gcc: internal compiler error: Segmentation fault (program cc1)

2012-08-04 Thread tommy-gccbugs at thorn dot ws
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54176

 Bug #: 54176
   Summary: lm32-elf-gcc: internal compiler error: Segmentation
fault (program cc1)
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: tommy-gccb...@thorn.ws


Created attachment 27938
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27938
Silly Sieve program

lm32-elf-gcc -std=c99 -S sieve.c
lm32-elf-gcc: internal compiler error: Segmentation fault (program cc1)

sieve.c attached.

Host: x86_64/openSUSE 12.1

Configured as as:
  ../binutils-2.22/configure --prefix=/opt/lm32 --target=lm32-elf
  ../gcc-4.7.1/configure --prefix=/opt/lm32 --target=lm32-elf
--enable-languages=c --disable-libssp --disable-libgcc


[Bug c/54176] lm32-elf-gcc: internal compiler error: Segmentation fault (program cc1)

2012-08-04 Thread tommy-gccbugs at thorn dot ws
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54176

--- Comment #1 from Tommy Thorn  2012-08-05 
03:14:30 UTC ---
Looks like the front end is looping (recursively):

gdb --args /home/opt/lm32/bin/../lib/gcc/lm32-elf/4.7.1/cc1 -quiet -v -iprefix
/home/opt/lm32/bin/../lib64/gcc/lm32-elf/4.7.1/ sieve.c -quiet -dumpbase
sieve.c -auxbase sieve -std=c99 -version -o sieve.s
...
(gdb) r
GNU C (GCC) version 4.7.1 (lm32-elf)
compiled by GNU C version 4.6.2, GMP version 5.0.2, MPFR version 3.0.1, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/home/opt/lm32/bin/../lib64/gcc/lm32-elf/4.7.1/../../../../lm32-elf/sys-include"
ignoring nonexistent directory
"/home/opt/lm32/bin/../lib64/gcc/lm32-elf/4.7.1/../../../../lm32-elf/include"
ignoring duplicate directory "/opt/lm32/lib64/gcc/lm32-elf/4.7.1/include"
ignoring duplicate directory "/opt/lm32/lib64/gcc/lm32-elf/4.7.1/include-fixed"
ignoring nonexistent directory
"/opt/lm32/lib64/gcc/lm32-elf/4.7.1/../../../../lm32-elf/sys-include"
ignoring nonexistent directory
"/opt/lm32/lib64/gcc/lm32-elf/4.7.1/../../../../lm32-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/opt/lm32/bin/../lib64/gcc/lm32-elf/4.7.1/include
 /home/opt/lm32/bin/../lib64/gcc/lm32-elf/4.7.1/include-fixed
End of search list.
GNU C (GCC) version 4.7.1 (lm32-elf)
compiled by GNU C version 4.6.2, GMP version 5.0.2, MPFR version 3.0.1, MPC
version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 78ab8beae59d165771ba0b05d4300149

Program received signal SIGSEGV, Segmentation fault.
build_decl_stat (loc=0, code=VAR_DECL, name=0x0, type=0x76f6f5e8) at
../../gcc-4.7.1/gcc/tree.c:4069
4069{
(gdb) bt
#0  build_decl_stat (loc=0, code=VAR_DECL, name=0x0, type=0x76f6f5e8) at
../../gcc-4.7.1/gcc/tree.c:4069
#1  0x005a66ce in make_tree (type=0x76f6f5e8, x=) at
../../gcc-4.7.1/gcc/expmed.c:5069
#2  0x0088e32d in force_const_mem (mode=SImode, x=0x726f50e0) at
../../gcc-4.7.1/gcc/varasm.c:3580
#3  0x005b3116 in emit_move_insn (x=, y=)
at ../../gcc-4.7.1/gcc/expr.c:3448
#4  0x0059ee9d in force_reg (x=0x726f50e0, mode=SImode) at
../../gcc-4.7.1/gcc/explow.c:676
#5  force_reg (mode=SImode, x=0x726f50e0) at
../../gcc-4.7.1/gcc/explow.c:656
#6  0x0059f44c in memory_address_addr_space (mode=SImode,
x=0x726f50e0, as=0 '\000') at ../../gcc-4.7.1/gcc/explow.c:505
#7  0x00592955 in change_address_1 (memref=0x726f7078, mode=SImode,
addr=0x726f50e0, validate=) at
../../gcc-4.7.1/gcc/emit-rtl.c:1998
#8  0x005b3172 in emit_move_insn (x=0x726f50c0, y=0x726f7078)
at ../../gcc-4.7.1/gcc/expr.c:3471
#9  0x0059ee9d in force_reg (x=0x726f50a0, mode=SImode) at
../../gcc-4.7.1/gcc/explow.c:676
#10 force_reg (mode=SImode, x=0x726f50a0) at
../../gcc-4.7.1/gcc/explow.c:656
#11 0x0059f44c in memory_address_addr_space (mode=SImode,
x=0x726f50a0, as=0 '\000') at ../../gcc-4.7.1/gcc/explow.c:505
#12 0x00592955 in change_address_1 (memref=0x726f7048, mode=SImode,
addr=0x726f50a0, validate=) at
../../gcc-4.7.1/gcc/emit-rtl.c:1998
#13 0x005b3172 in emit_move_insn (x=0x726f5080, y=0x726f7048)
at ../../gcc-4.7.1/gcc/expr.c:3471
#14 0x0059ee9d in force_reg (x=0x726f5060, mode=SImode) at
../../gcc-4.7.1/gcc/explow.c:676
#15 force_reg (mode=SImode, x=0x726f5060) at
../../gcc-4.7.1/gcc/explow.c:656
#16 0x0059f44c in memory_address_addr_space (mode=SImode,
x=0x726f5060, as=0 '\000') at ../../gcc-4.7.1/gcc/explow.c:505
#17 0x00592955 in change_address_1 (memref=0x726f7018, mode=SImode,
addr=0x726f5060, validate=) at
../../gcc-4.7.1/gcc/emit-rtl.c:1998
#18 0x005b3172 in emit_move_insn (x=0x726f5040, y=0x726f7018)
at ../../gcc-4.7.1/gcc/expr.c:3471
#19 0x0059ee9d in force_reg (x=0x726f5020, mode=SImode) at
../../gcc-4.7.1/gcc/explow.c:676

goes on indefinitely (> 8000 entries).


[Bug c/54176] lm32-elf-gcc: internal compiler error: Segmentation fault (program cc1)

2012-08-04 Thread tommy-gccbugs at thorn dot ws
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54176

--- Comment #2 from Tommy Thorn  2012-08-05 
03:26:16 UTC ---
Forget the attached example, lm32-elf-gcc breaks as soon as any static or
extern variable is used in a function. Fx:

  int x;
  int foo() { return x; }


[Bug target/54176] lm32-elf-gcc: internal compiler error: Segmentation fault (program cc1)

2012-08-06 Thread tommy-gccbugs at thorn dot ws
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54176

--- Comment #4 from Tommy Thorn  2012-08-06 
19:42:45 UTC ---
FWIW, it works in 4.5.3.  I can narrow down the range if that's helpful.