[Bug tree-optimization/103855] Missed optimization: 64bit division used instead of 32bit division

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 29 09:41:12 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103855

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
vect_get_range_info is meant for the vectorizer only, what you want is I think
get_min_precision which would need to be exported out of internal-fn.c.
In any case, it needs to be called still on the trees (SSA_NAMEs or
INTEGER_CSTs etc.) during expansion.
expand_expr_divmod already performs a different optimization - if both operands
are known to have the most significant bit clear (checked with
get_range_pos_neg), then it expands it as both signed and unsigned division or
modulo and checks if one of them isn't cheaper.


More information about the Gcc-bugs mailing list