On 10/16/2015 07:35 AM, Marek Polacek wrote:
This code path seems to be for pushing a conversion down into a binary expression. We shouldn't do this at all when we aren't folding.I tend to agree, but this case is tricky. What's this code about is e.g. for int fn (long p, long o) { return p + o; } we want to narrow the operation and do the addition on unsigned ints and then convert to int. We do it here because we're still missing the promotion/demotion pass on GIMPLE (PR45397 / PR47477). Disabling this optimization here would regress a few testcases, so I kept the code as it was. Thoughts?
That makes sense, but please add a comment referring to one of those PRs and also add a note to the PR about this place. OK with that change.
Moreover, there are some places in the C++ FE where we still call convert_to_integer and not convert_to_integer_nofold -- should they be changed to the _nofold variant?
Not in build_base_path; its arithmetic is compiler generated and should really be delayed until genericize anyway. Likewise for get_delta_difference.
I think the call in finish_omp_clauses could change. Jason
