]> git.ipfire.org Git - thirdparty/gcc.git/commit
ipa-cp: Fix constant dumping
authorMartin Jambor <mjambor@suse.cz>
Thu, 14 Nov 2024 13:42:27 +0000 (14:42 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Thu, 14 Nov 2024 13:42:59 +0000 (14:42 +0100)
commitda29560711b2a66b26738caf46dbf67d3f7cff85
treea3dd843aad5ee0fe60905e7f47446833f96ae2bd
parent20faea418d580d4db99aa5293c976ab16867aca5
ipa-cp: Fix constant dumping

Commit gcc-14-5368-ge0787da2633 removed an overloaded variant of
function print_ipcp_constant_value for tree constants.  That did not
break build because the other overloaded variant for polymorphic
contexts-has a parameter which is constructible from a tree, but it
prints polymorphic contexts, not tree constants, so we in dumps we got
things like:

  param [0]: VARIABLE
       ctxs: VARIABLE
       Bits: value = 0x0, mask = 0xfffffffffffffffc
       [prange] struct S * [1, +INF] MASK 0xfffffffffffffffc VALUE 0x0
      ref offset 0:     nothing known [scc: 1, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]
      ref offset 32:     nothing known [scc: 2, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]
      ref offset 64:     nothing known [scc: 3, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]

instead of:

  param [0]: VARIABLE
       ctxs: VARIABLE
       Bits: value = 0x0, mask = 0xfffffffffffffffc
       [prange] struct S * [1, +INF] MASK 0xfffffffffffffffc VALUE 0x0
      ref offset 0: 1 [scc: 1, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]
      ref offset 32: 64 [scc: 2, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]
      ref offset 64: 32 [scc: 3, from: 1(1.000000)] [loc_time: 0, loc_size: 0, prop_time: 0, prop_size: 0]

This commit re-adds the needed overloaded variant though it uses the
printing function added in the aforementioned commit instead of
printing it itself.

gcc/ChangeLog:

2024-11-13  Martin Jambor  <mjambor@suse.cz>

* ipa-prop.h (ipa_print_constant_value): Declare.
* ipa-prop.cc (ipa_print_constant_value): Make public.
* ipa-cp.cc (print_ipcp_constant_value): Re-add this overloaded
function for printing tree constants.

gcc/testsuite/ChangeLog:

2024-11-14  Martin Jambor  <mjambor@suse.cz>

* gcc.dg/ipa/ipcp-agg-1.c: Add a scan dump for a constant value in
the latice dump.
gcc/ipa-cp.cc
gcc/ipa-prop.cc
gcc/ipa-prop.h
gcc/testsuite/gcc.dg/ipa/ipcp-agg-1.c