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

--- Comment #40 from Bernd Schmidt <bernds at gcc dot gnu.org> ---
(In reply to Pierre-Marie de Rodat from comment #38)
> Besides, Eric told me live that instead of artificially clearing the
> entry basic block’s IN set, we could use the confluence_0 for that. I
> did this and took this opportunity to minimize code duplication: the
> df_mir_init function now just calls df_mir_reset.

Hmm, is that actually the right thing for the entry block? I notice that we
simulate artificial defs, but it seems like that set is not conservatively
correct. For a simple function taking a single integer argument:

;;  entry block defs     0 [ax] 1 [dx] 2 [cx] 4 [si] 5 [di] 7 [sp] 21 [xmm0] 22
[xmm1] 23 [xmm2] 24 [xmm3] 25 [xmm4] 26 [xmm5] 27 [xmm6] 28 [xmm7] 37 [r8] 38
[r9]

where it would appear that only regs 5 (DI) and 7 (SP) are actually reliably
defined, but df_get_entry_block_def_set adds everything that's a
FUNCTION_ARG_REGNO. But the entire set makes it through the mir in/out sets in
the entire function.

(gdb) p df_dump(stdout)
[...]
; mir   in       0 [ax] 1 [dx] 2 [cx] 4 [si] 5 [di] 7 [sp] 21 [xmm0] 22 [xmm1]
23 [xmm2] 24 [xmm3] 25 [xmm4] 26 [xmm5] 27 [xmm6] 28 [xmm7] 37 [r8] 38 [r9]
[...]
;; mir   out     0 [ax] 1 [dx] 2 [cx] 4 [si] 5 [di] 7 [sp] 17 [flags] 21 [xmm0]
22 [xmm1] 23 [xmm2] 24 [xmm3] 25 [xmm4] 26 [xmm5] 27 [xmm6] 28 [xmm7] 37 [r8]
38 [r9]


Maybe it's best _not_ to include artificial defs, except for a subset of things
that are known good - such as the stack pointer.

Apart from that, starting to look good, thanks for the effort. Future versions
should probably go to gcc-patches.

Reply via email to