[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trying to track down problem with packed.com from testsuite
From: |
Gaius Mulley |
Subject: |
Re: Trying to track down problem with packed.com from testsuite |
Date: |
Sun, 11 Aug 2024 19:30:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
john o goyo <jog37@riddermarkfarm.ca> writes:
> Greetings, Gaius.
>
> Here is an oddity:
>
> [~/opt/gm2/testsuite]=> gm2-14 -c -O -fomit-frame-pointer
> -finline-functions -fiso packed.mod
> [~/opt/gm2/testsuite]=> gm2-14 -c -O0 -fomit-frame-pointer
> -finline-functions -fiso packed.mod
> [~/opt/gm2/testsuite]=> gm2-14 -c -O1 -fomit-frame-pointer
> -finline-functions -fiso packed.mod
> [~/opt/gm2/testsuite]=> gm2-14 -c -O2 -fomit-frame-pointer
> -finline-functions -fiso packed.mod
> gm2: internal compiler error: Segmentation Fault signal terminated
> program cc1gm2
> Please submit a full bug report, with preprocessed source (by using
> -freport-bug).
> See <https://gcc.gnu.org/bugs/> for instructions.
> [~/opt/gm2/testsuite]=> gm2-14 -c -Ofast -fomit-frame-pointer
> -finline-functions -fiso packed.mod
> gm2: internal compiler error: Segmentation Fault signal terminated
> program cc1gm2
> Please submit a full bug report, with preprocessed source (by using
> -freport-bug).
> See <https://gcc.gnu.org/bugs/> for instructions.
>
> Basically, optimisation level 2 and above causes problems.
>
> I am trying to chase down the problem but I have clue where the gm2
> compilation starts. Please inform me on which function to break.
>
> Sincerely,
> john
Hi John,
that is an interesting observation.
One way to debug is to set a break point on: gimplify_function_tree(tree_node*)
which is called by the front end at each end of function when the
statement tree is complete. The statement tree can be dumped as follows
below. For small test programs this can be useful - even to see which
function causes the sigsegv. You can also dump the gimple IR via
command line -fm2-dump=all.
Anyway back to gdb (the following is a rather noisy dump and the first
line "<function decl 0xhexval name>", is initially all I'd use to
perform the breadth first analysis,
hope this helps
regards,
Gaius
$ gm2 -c ~/GCC/hello/hello.mod -wrapper gdb,--args
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from
/home/gaius/opt/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/cc1gm2...
(gdb) break gimplify_function_tree(tree_node*)
Breakpoint 1 at 0xe1e1a0: file ../../gcc/tree.h, line 3631.
(gdb) run
Starting program: /home/gaius/opt/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/cc1gm2
-imultiarch x86_64-linux-gnu -quiet -dumpbase hello.mod -dumpbase-ext .mod
-mtune=generic -march=x86-64 -fm2-pathname=- -fm2-pathnameI. -fscaffold-dynamic
-flibs=m2cor,m2log,m2pim,m2iso -fm2-pathname=- -fm2-pathnameI.
/home/gaius/GCC/hello/hello.mod -c -o /tmp/cckFaJpo.s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, gimplify_function_tree (fndecl=0x7ffff765a700) at
../../gcc/tree.h:3631
3631 if (TREE_CODE (__t) != __c)
(gdb) print debug_tree(fndecl)
<function_decl 0x7ffff765a700 _M2_hello_init
type <function_type 0x7ffff76501f8
type <void_type 0x7ffff761cf18 PROC VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761cf18
pointer_to_this <pointer_type 0x7ffff7624000 ADDRESS>>
QI
size <integer_cst 0x7ffff7602eb8 constant 8>
unit-size <integer_cst 0x7ffff7602ed0 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff76501f8
arg-types <tree_list 0x7ffff764aa00 value <integer_type 0x7ffff761c5e8
INTEGER>
chain <tree_list 0x7ffff764a9d8 value <pointer_type 0x7ffff7624000
ADDRESS>
chain <tree_list 0x7ffff764a9b0 value <pointer_type
0x7ffff7624000 ADDRESS>
chain <tree_list 0x7ffff761bde8 value <void_type
0x7ffff761cf18 PROC>>>>>
pointer_to_this <pointer_type 0x7ffff7642a80>>
addressable used public static QI (null):0:0 align:8 warn_if_not_align:0
context <translation_unit_decl 0x7ffff760c168 D.57> initial <block
0x7ffff7671000>
result <result_decl 0x7ffff7656b40 D.468 type <void_type 0x7ffff761cf18
PROC>
VOID (null):0:0
align:8 warn_if_not_align:0 context <function_decl 0x7ffff765a700
_M2_hello_init>>
arguments <parm_decl 0x7ffff7659a00 argc
type <integer_type 0x7ffff761c5e8 INTEGER public SI
size <integer_cst 0x7ffff7620018 constant 32>
unit-size <integer_cst 0x7ffff7620030 constant 4>
align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761c5e8 precision:32 min <integer_cst 0x7ffff7602fc0 -2147483648> max
<integer_cst 0x7ffff7602fd8 2147483647>
pointer_to_this <pointer_type 0x7ffff7624b28>>
SI /home/gaius/GCC/hello/hello.mod:5:1 size <integer_cst 0x7ffff7620018
32> unit-size <integer_cst 0x7ffff7620030 4>
align:32 warn_if_not_align:0 context <function_decl 0x7ffff765a700
_M2_hello_init> arg-type <integer_type 0x7ffff761c5e8 INTEGER>
chain <parm_decl 0x7ffff7659980 argv type <pointer_type 0x7ffff7624000
ADDRESS>
unsigned DI /home/gaius/GCC/hello/hello.mod:5:1
size <integer_cst 0x7ffff7602dc8 constant 64>
unit-size <integer_cst 0x7ffff7602de0 constant 8>
align:64 warn_if_not_align:0 context <function_decl 0x7ffff765a700
_M2_hello_init> arg-type <pointer_type 0x7ffff7624000 ADDRESS> chain <parm_decl
0x7ffff7659900 envp>>>
struct-function 0x7ffff7670000 chain <function_decl 0x7ffff765a600
_M2_hello_dep>>
$1 = void
(gdb) cont
Continuing.
Breakpoint 1, gimplify_function_tree (fndecl=0x7ffff765a800) at
../../gcc/tree.h:3631
3631 if (TREE_CODE (__t) != __c)
(gdb) print debug_tree(fndecl)
<function_decl 0x7ffff765a800 _M2_hello_fini
type <function_type 0x7ffff76501f8
type <void_type 0x7ffff761cf18 PROC VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761cf18
pointer_to_this <pointer_type 0x7ffff7624000 ADDRESS>>
QI
size <integer_cst 0x7ffff7602eb8 constant 8>
unit-size <integer_cst 0x7ffff7602ed0 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff76501f8
arg-types <tree_list 0x7ffff764aa00 value <integer_type 0x7ffff761c5e8
INTEGER>
chain <tree_list 0x7ffff764a9d8 value <pointer_type 0x7ffff7624000
ADDRESS>
chain <tree_list 0x7ffff764a9b0 value <pointer_type
0x7ffff7624000 ADDRESS>
chain <tree_list 0x7ffff761bde8 value <void_type
0x7ffff761cf18 PROC>>>>>
pointer_to_this <pointer_type 0x7ffff7642a80>>
addressable used public static QI (null):0:0 align:8 warn_if_not_align:0
context <translation_unit_decl 0x7ffff760c168 D.57> initial <block
0x7ffff7671060>
result <result_decl 0x7ffff7656bb8 D.473 type <void_type 0x7ffff761cf18
PROC>
VOID (null):0:0
align:8 warn_if_not_align:0 context <function_decl 0x7ffff765a800
_M2_hello_fini>>
arguments <parm_decl 0x7ffff7659b80 argc
type <integer_type 0x7ffff761c5e8 INTEGER sizes-gimplified public SI
size <integer_cst 0x7ffff7620018 constant 32>
unit-size <integer_cst 0x7ffff7620030 constant 4>
align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761c5e8 precision:32 min <integer_cst 0x7ffff7602fc0 -2147483648> max
<integer_cst 0x7ffff7602fd8 2147483647>
pointer_to_this <pointer_type 0x7ffff7624b28>>
SI /home/gaius/GCC/hello/hello.mod:5:1 size <integer_cst 0x7ffff7620018
32> unit-size <integer_cst 0x7ffff7620030 4>
align:32 warn_if_not_align:0 context <function_decl 0x7ffff765a800
_M2_hello_fini> arg-type <integer_type 0x7ffff761c5e8 INTEGER>
chain <parm_decl 0x7ffff7659b00 argv type <pointer_type 0x7ffff7624000
ADDRESS>
unsigned DI /home/gaius/GCC/hello/hello.mod:5:1
size <integer_cst 0x7ffff7602dc8 constant 64>
unit-size <integer_cst 0x7ffff7602de0 constant 8>
align:64 warn_if_not_align:0 context <function_decl 0x7ffff765a800
_M2_hello_fini> arg-type <pointer_type 0x7ffff7624000 ADDRESS> chain <parm_decl
0x7ffff7659a80 envp>>>
struct-function 0x7ffff76700c0 chain <function_decl 0x7ffff765a700
_M2_hello_init>>
$2 = void
(gdb) cont
Continuing.
Breakpoint 1, gimplify_function_tree (fndecl=0x7ffff765a500) at
../../gcc/tree.h:3631
3631 if (TREE_CODE (__t) != __c)
(gdb) print debug_tree(fndecl)
<function_decl 0x7ffff765a500 _M2_hello_ctor
type <function_type 0x7ffff7629150
type <void_type 0x7ffff761cf18 PROC VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761cf18
pointer_to_this <pointer_type 0x7ffff7624000 ADDRESS>>
QI
size <integer_cst 0x7ffff7602eb8 constant 8>
unit-size <integer_cst 0x7ffff7602ed0 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7629150
arg-types <tree_list 0x7ffff761bde8 value <void_type 0x7ffff761cf18
PROC>>
pointer_to_this <pointer_type 0x7ffff76500a8>>
addressable used public static QI /home/gaius/GCC/hello/hello.mod:3:1
align:8 warn_if_not_align:0 context <translation_unit_decl 0x7ffff760c168 D.57>
initial <block 0x7ffff76710c0>
result <result_decl 0x7ffff7656a50 D.461 type <void_type 0x7ffff761cf18
PROC>
VOID /home/gaius/GCC/hello/hello.mod:1:14
align:8 warn_if_not_align:0 context <function_decl 0x7ffff765a500
_M2_hello_ctor>>
struct-function 0x7ffff7670180 chain <function_decl 0x7ffff765a400 execv>>
$3 = void
(gdb) cont
Continuing.
Breakpoint 1, gimplify_function_tree (fndecl=0x7ffff765a600) at
../../gcc/tree.h:3631
3631 if (TREE_CODE (__t) != __c)
(gdb) print debug_tree(fndecl)
<function_decl 0x7ffff765a600 _M2_hello_dep
type <function_type 0x7ffff7629150
type <void_type 0x7ffff761cf18 PROC VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff761cf18
pointer_to_this <pointer_type 0x7ffff7624000 ADDRESS>>
QI
size <integer_cst 0x7ffff7602eb8 constant 8>
unit-size <integer_cst 0x7ffff7602ed0 constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7629150
arg-types <tree_list 0x7ffff761bde8 value <void_type 0x7ffff761cf18
PROC>>
pointer_to_this <pointer_type 0x7ffff76500a8>>
addressable used static QI /home/gaius/GCC/hello/hello.mod:3:1 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7ffff760c168 D.57> initial
<block 0x7ffff7671120>
result <result_decl 0x7ffff7656ac8 D.463 type <void_type 0x7ffff761cf18
PROC>
VOID /home/gaius/GCC/hello/hello.mod:1:14
align:8 warn_if_not_align:0 context <function_decl 0x7ffff765a600
_M2_hello_dep>>
struct-function 0x7ffff7670240 chain <function_decl 0x7ffff765a500
_M2_hello_ctor>>
$4 = void
(gdb) cont
Continuing.
[Inferior 1 (process 2547686) exited normally]
(gdb)