Current IPA does not propagate aggregate constant for by-ref argument
if it is simple pass-through of caller parameter. Here is an example,

   f1 (int *p)
   {
     ... = *p;
     ...
   }

   f2 (int *p)
   {
      *p = 2;
      f1 (p);
   }

It is easy to know that in f1(), *p should be 2 after a simple propagation
from f2() to f1(). But this is missed due to some bug, which is targeted
by this patch.

Bootstrapped/regtested on x86_64-linux and aarch64-linux.

Feng
---
2020-01-27  Feng Xue  <f...@os.amperecomputing.com>

        PR ipa/93429
        * ipa-cp.c (propagate_aggs_across_jump_function): Further
        check aggregate jump functions if by-ref argument is simple
        pass through.
        (intersect_aggregates_with_edge): Likewise.

Attachment: 0001-Fix-missed-IPA-CP-on-by-ref-argument-directly-passed.patch
Description: 0001-Fix-missed-IPA-CP-on-by-ref-argument-directly-passed.patch

Reply via email to