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: RFC: folding of literal array refs


On Thu, 2006-04-27 at 08:07 -0600, Roger Sayle wrote:

> It think the clue to the correct solution is given several lines further
> down in the same if-clause that you cite above:
> 
>           && (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (string))))
>               == MODE_INT)
>           && (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (string))))
> 	      == 1))
> 
> Basically, all the middle-end cares about at this point is whether the
> element types are 1-byte wide integers, and checking that TREE_TYPE (exp)
> is identical to TREE_TYPE (TREE_TYPE (string)) guarantees that for both.
> Instead I think to catch the cases that you care about we should simply
> change the line:
IIRC those tests are to kick out folding of literal references to
arrays of wide chars -- most likely because the code in question hasn't
been audited for correctness with characters which are more than a
single byte.

Jeff


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