From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Wilson To: Richard Henderson Cc: egcs@cygnus.com Subject: Re: array reference optimization Date: Sun, 17 May 1998 17:58:00 -0000 Message-id: <199805172119.OAA03966@rtl.cygnus.com> References: <19980513172502.54262@dot.cygnus.com> X-SW-Source: 1998-05/msg00598.html This looks OK to me. However, I don't think that adding a new field to the tree types is strictly necessary to solve this. One could just as well do the divide at the point we need it instead of saving it in all tree type nodes. E.g. instead of what the old code does: ! index = fold (build (MULT_EXPR, sbitsizetype, index, ! convert (sbitsizetype, ! TYPE_SIZE (TREE_TYPE (exp))))); ... ! offset = ... size_binop (FLOOR_DIV_EXPR, index, ! size_int (BITS_PER_UNIT))); which requires doing the multiply in bitsizetype, we could do the divide first and then the multiple, something like this: oset = ... fold (build (MULT_EXPR, ssizetype, index, size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (...) size_int (BITS_PER_UNIT)))) which keeps everything in range of sizetype. Jim