This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Constant folding and Constant propagation
Bernd Schmidt <bernds_cb1@t-online.de> writes:
> Take a look at reload_cse_move2add.
I don't think that powerful enough; it requires the same destination
registers:
/* Try to transform (set (REGX) (CONST_INT A))
...
(set (REGX) (CONST_INT B))
to
(set (REGX) (CONST_INT A))
...
(set (REGX) (plus (REGX) (CONST_INT B-A)))
I think you really need the Joern's optmize_related_values patch. Also see
PR33699.
Adam