[Bug debug/91611] debug info for register keyword variables at O0
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 30 14:33:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91611
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
FWIW, the debug experience does not feel very O0-ish because of the missing "b
= a" assignment.
Using this demonstrator patch:
...
diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c
index a322da81544..db18ff43281 100644
--- a/gcc/lra-spills.c
+++ b/gcc/lra-spills.c
@@ -785,7 +785,7 @@ lra_final_code_change (void)
unless next insn is USE marking the return reg (we should
save this as some subsequent optimizations assume that
such original insns are saved). */
- if (NONJUMP_INSN_P (insn) && GET_CODE (pat) == SET
+ if (0 && NONJUMP_INSN_P (insn) && GET_CODE (pat) == SET
&& REG_P (SET_SRC (pat)) && REG_P (SET_DEST (pat))
&& REGNO (SET_SRC (pat)) == REGNO (SET_DEST (pat))
&& (! return_regno_p (REGNO (SET_SRC (pat)))
@@ -834,7 +834,7 @@ lra_final_code_change (void)
if (insn_change_p)
lra_update_operator_dups (id);
- if ((set = single_set (insn)) != NULL
+ if (0 && (set = single_set (insn)) != NULL
&& REG_P (SET_SRC (set)) && REG_P (SET_DEST (set))
&& REGNO (SET_SRC (set)) == REGNO (SET_DEST (set)))
{
diff --git a/gcc/recog.c b/gcc/recog.c
index a9f584bc0dc..1ae158cb69d 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2995,7 +2995,7 @@ split_all_insns (void)
is too risky to try to do this before register
allocation, and there are unlikely to be very many
nops then anyways. */
- if (reload_completed)
+ if (0 && reload_completed)
delete_insn_and_edges (insn);
if (note)
need_cfg_cleanup = true;
...
we manage to produce the "b = a" assignment in the assembly:
...
#(insn 6 26 30 2 (set (reg/v:SF 21 xmm1 [orig:84 b ] [84])
# (reg/v:SF 21 xmm1 [orig:83 a ] [83])) "test.c":7:5 112
{*movsf_internal}
# (nil))
movaps %xmm1, %xmm1 # 6 [c=4 l=3] *movsf_internal/6
...
and get O0-ish behaviour:
...
$ gdb -q a.out -ex start
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x4004b0: file test.c, line 3.
Starting program: /data/gcc_versions/devel/a.out
Temporary breakpoint 1, main () at test.c:3
3 {
(gdb) n
6 a = 1.0;
(gdb)
7 b = a;
(gdb) p a
$1 = 1
(gdb) n
8 return b == 1.0;
(gdb) p b
$2 = 1
...
More information about the Gcc-bugs
mailing list