diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-18 16:44:08 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-18 16:44:08 +0000 |
commit | be951c5998ecb9dec5574fdf3998912ff3e972b6 (patch) | |
tree | 1276e4f905c6f856a6887cb3e4bc04c542e58392 /gcc/ipa-cp.c | |
parent | ab4891c2b5851a2921e10eadfa7c47da432e6757 (diff) | |
download | gcc-be951c5998ecb9dec5574fdf3998912ff3e972b6.tar.gz |
Allow constant global VAR_DECLs in constant jump functions
2016-05-18 Martin Jambor <mjambor@suse.cz>
PR ipa/69708
* ipa-cp.c (ipa_get_jf_pass_through_result): Allow non-ip constant
input for NOP_EXPR pass-through functions.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Allow
aggregate global constant VAR_DECLs in constant jump functions.
testsuite/
* gcc.dg/ipa/iinline-cstagg-2.c: New test.
* gcc.dg/ipa/ipcp-cstagg-5.c: Likewise.
* gcc.dg/ipa/ipcp-cstagg-6.c: Likewise.
* gcc.dg/ipa/ipcp-cstagg-7.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236418 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 2183da07b68..8caa973e46c 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1026,9 +1026,10 @@ ipa_get_jf_pass_through_result (struct ipa_jump_func *jfunc, tree input) { tree restype, res; - gcc_checking_assert (is_gimple_ip_invariant (input)); if (ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR) return input; + if (!is_gimple_ip_invariant (input)) + return NULL_TREE; if (TREE_CODE_CLASS (ipa_get_jf_pass_through_operation (jfunc)) == tcc_comparison) |