This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Make TREE_OVERFLOWed constant gimple_min_invariant


On Fri, 2005-03-11 at 12:00 +0100, Zdenek Dvorak wrote:
> Hello,
> 
> TREE_OVERFLOWed constants are not considered gimple_min_invariant 
> now, thus limiting the optimizations performed on them (constant
> propagation etc.).  This was introduced (as far as I recall -- it's
> more than year now), since having TREE_OVERFLOWed constants in arguments
> of COND_EXPR exposed some problems in tree->rtl expansion.  It seems
> likely that these problems were fixed as a side effect of cfg preserving
> tree->rtl expansion.  At the very least, removing the TREE_OVERFLOW
> check from gimple_min_invariant exposes just two clearly unrelated problems:
> 
> 1) find_taken_edge_cond_expr assumes that integer constant is either
>    integer_nonzerop or integer_zerop, which is not true for
>    TREE_OVERFLOWed constants.
> 2) We produce a wrongly typed expression in fortran, which confuses ccp.
> 
> This patch removes the restriction from is_gimple_min_invariant and
> fixes the described problems.
> 
> Bootstrapped & regtested on i686 and x86_64.
> 
> Zdenek
> 
> 	* tree-cfg.c (find_taken_edge_cond_expr): Use zero_p instead of
> 	integer_zerop.
> 	* tree-gimple.c (is_gimple_min_invariant): Consider overflowed
> 	constants invariant.
> 
> 	* fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert
> 	the argument of the shift to the unsigned type.
Approved.

Thanks,
Jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]