Change double_int calls to new interface.

Mark Kettenis mark.kettenis@xs4all.nl
Tue Sep 11 15:34:00 GMT 2012


> Index: gcc/ChangeLog
> 
> 2012-09-04  Lawrence Crowl  <crowl@google.com>
> 
> 	    * double-int.h (double_int::operator &=): New.
> 	    (double_int::operator ^=): New.
> 	    (double_int::operator |=): New.
> 	    (double_int::mul_with_sign): Modify overflow parameter to bool*.
> 	    (double_int::add_with_sign): New.
> 	    (double_int::ule): New.
> 	    (double_int::sle): New.
> 	    (binary double_int::operator *): Remove parameter name.
> 	    (binary double_int::operator +): Likewise.
> 	    (binary double_int::operator -): Likewise.
> 	    (binary double_int::operator &): Likewise.
> 	    (double_int::operator |): Likewise.
> 	    (double_int::operator ^): Likewise.
> 	    (double_int::and_not): Likewise.
> 	    (double_int::from_shwi): Tidy formatting.
> 	    (double_int::from_uhwi): Likewise.
> 	    (double_int::from_uhwi): Likewise.
> 	    * double-int.c (double_int::mul_with_sign): Modify overflow parameter
> 	    to bool*.
> 	    (double_int::add_with_sign): New.
> 	    (double_int::ule): New.
> 	    (double_int::sle): New.
> 	    * builtins.c: Modify to use the new double_int interface.
> 	    * cgraph.c: Likewise.
> 	    * combine.c: Likewise.
> 	    * dwarf2out.c: Likewise.
> 	    * emit-rtl.c: Likewise.
> 	    * expmed.c: Likewise.
> 	    * expr.c: Likewise.
> 	    * fixed-value.c: Likewise.
> 	    * fold-const.c: Likewise.
> 	    * gimple-fold.c: Likewise.
> 	    * gimple-ssa-strength-reduction.c: Likewise.
> 	    * gimplify-rtx.c: Likewise.
> 	    * ipa-prop.c: Likewise.
> 	    * loop-iv.c: Likewise.
> 	    * optabs.c: Likewise.
> 	    * stor-layout.c: Likewise.
> 	    * tree-affine.c: Likewise.
> 	    * tree-cfg.c: Likewise.
> 	    * tree-dfa.c: Likewise.
> 	    * tree-flow-inline.h: Likewise.
> 	    * tree-object-size.c: Likewise.
> 	    * tree-predcom.c: Likewise.
> 	    * tree-pretty-print.c: Likewise.
> 	    * tree-sra.c: Likewise.
> 	    * tree-ssa-address.c: Likewise.
> 	    * tree-ssa-alias.c: Likewise.
> 	    * tree-ssa-ccp.c: Likewise.
> 	    * tree-ssa-forwprop.c: Likewise.
> 	    * tree-ssa-loop-ivopts.c: Likewise.
> 	    * tree-ssa-loop-niter.c: Likewise.
> 	    * tree-ssa-phiopt.c: Likewise.
> 	    * tree-ssa-pre.c: Likewise.
> 	    * tree-ssa-sccvn: Likewise.
> 	    * tree-ssa-structalias.c: Likewise.
> 	    * tree-ssa.c: Likewise.
> 	    * tree-switch-conversion.c: Likewise.
> 	    * tree-vect-loop-manip.c: Likewise.
> 	    * tree-vrp.c: Likewise.
> 	    * tree.h: Likewise.
> 	    * tree.c: Likewise.
> 	    * varasm.c: Likewise.

I fear this has broken hppa.  Bootstrap on OpenBSD/hppa now fails with:


In file included from ../../../src/gcc/gcc/mcf.c:47:0:
../../../src/gcc/gcc/mcf.c: In function 'void dump_fixup_edge(FILE*, fixup_graph_type*, fixup_edge_p)':
../../../src/gcc/gcc/system.h:288:78: error: integer overflow in expression [-Werror=overflow]
                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
                                                                              ^
../../../src/gcc/gcc/system.h:289:44: note: in expansion of macro 'INTTYPE_MINIMUM'
 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
                                            ^
../../../src/gcc/gcc/mcf.c:55:22: note: in expansion of macro 'INTTYPE_MAXIMUM'
 #define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
                      ^
../../../src/gcc/gcc/mcf.c:211:34: note: in expansion of macro 'CAP_INFINITY'
       if (fedge->max_capacity == CAP_INFINITY)
                                  ^

Something must be wrong with the overflow detection logic in the new
double_int interfaces.  I suspect this is because for hppa
HOST_WIDE_INT is 32 bits wide, since on i386 and x86_64 I don't hit this.



More information about the Gcc-patches mailing list