diff options
author | Martin Liska <mliska@suse.cz> | 2018-04-03 15:27:26 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2018-04-03 15:27:26 +0200 |
commit | b93f25ad50bd186cc9a9e7951a9d8caf0f4184ee (patch) | |
tree | 00fed89c780b4d7654668bf4f39ebb5dd41cce09 | |
parent | b79861dc95ab7e737f11f84e0e1250c76e16fcab (diff) | |
download | gcc-b93f25ad50bd186cc9a9e7951a9d8caf0f4184ee.zip gcc-b93f25ad50bd186cc9a9e7951a9d8caf0f4184ee.tar.gz gcc-b93f25ad50bd186cc9a9e7951a9d8caf0f4184ee.tar.bz2 |
Bits propagation only for int and ptr types
2018-03-29 Martin Liska <mliska@suse.cz>
Martin Jambor <mjambor@suse.cz>
PR ipa/84947
* ipa-cp.c (propagate_bits_across_jump_function): Bail out if
param_type is not an integral or pointer type.
Co-Authored-By: Martin Jambor <mjambor@suse.cz>
From-SVN: r259029
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 14 |
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ebd57de..2a43c39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-03-29 Martin Liska <mliska@suse.cz> + Martin Jambor <mjambor@suse.cz> + + PR ipa/84947 + * ipa-cp.c (propagate_bits_across_jump_function): Bail out if + param_type is not an integral or pointer type. + 2018-04-03 Richard Biener <rguenther@suse.de> * sese.h (recompute_all_dominators): Remove. diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index ee41a8d..ec21601 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1811,14 +1811,16 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int idx, struct ipa_node_params *callee_info = IPA_NODE_REF (callee); tree parm_type = ipa_get_type (callee_info, idx); - /* For K&R C programs, ipa_get_type() could return NULL_TREE. - Avoid the transform for these cases. */ - if (!parm_type) + /* For K&R C programs, ipa_get_type() could return NULL_TREE. Avoid the + transform for these cases. Similarly, we can have bad type mismatches + with LTO, avoid doing anything with those too. */ + if (!parm_type + || (!INTEGRAL_TYPE_P (parm_type) && !POINTER_TYPE_P (parm_type))) { if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, "Setting dest_lattice to bottom, because" - " param %i type is NULL for %s\n", idx, - cs->callee->name ()); + fprintf (dump_file, "Setting dest_lattice to bottom, because type of " + "param %i of %s is NULL or unsuitable for bits propagation\n", + idx, cs->callee->name ()); return dest_lattice->set_to_bottom (); } |