ipa/94245 - avoid folding when we want an ADDR_EXPR
authorRichard Biener <rguenther@suse.de>
Mon, 23 Mar 2020 08:33:25 +0000 (09:33 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 23 Mar 2020 10:23:29 +0000 (11:23 +0100)
Another case where build_fold_addr_expr is harmful.

2020-03-23  Richard Biener  <rguenther@suse.de>

PR ipa/94245
* ipa-prop.c (ipa_read_jump_function): Build the ADDR_EXRP
directly rather than also folding it via build_fold_addr_expr.

gcc/ChangeLog
gcc/ipa-prop.c

index 5df915d78003bb645be62c4ac11a6245f8e7b765..c33327e61b26bf207fb0157bc5291ca9a857a4ba 100644 (file)
@@ -1,3 +1,9 @@
+2020-03-23  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/94245
+       * ipa-prop.c (ipa_read_jump_function): Build the ADDR_EXRP
+       directly rather than also folding it via build_fold_addr_expr.
+
 2020-03-23  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/94266
index a77130ded397825a2f0948177539b26b140c4b1c..71ac0e104d240b41ceba6f453163a086d453740a 100644 (file)
@@ -4625,7 +4625,7 @@ ipa_read_jump_function (class lto_input_block *ib,
       {
        tree t = stream_read_tree (ib, data_in);
        if (flag && prevails)
-         t = build_fold_addr_expr (t);
+         t = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
        ipa_set_jf_constant (jump_func, t, cs);
       }
       break;