On Thu, Oct 10, 2019 at 06:12:02PM +0200, Paolo Carlini wrote: > while working on cp_build_binary_op I noticed that the testsuite wasn't > exercising the warnings in case RROTATE_EXPR / LROTATE_EXPR, even more the > code handling those tree codes seemed completely unused. Turned out that the > C front-end doesn't handle those tree codes at all: I'm coming to the > conclusion that the C++ front-end bits too are now obsolete and may be > removed, because only the middle-end generates those codes in order to > implement optimizations. Anything I'm missing? Any additional testing?
I guess it depends on where. fold_binary_loc certainly has code to create {L,R}ROTATE_EXPR, just look at unsigned foo (unsigned x) { return (x << 3) + (x >> (__SIZEOF_INT__ * __CHAR_BIT__ - 3)); } unsigned bar (unsigned x, unsigned y) { return (x << y) | (x >> (__SIZEOF_INT__ * __CHAR_BIT__ - y)); } and the *.original dump. The cp_build_binary_op case is unlikely to ever trigger, unless we'd rerun it on cp_folded trees. cxx_eval_constant_expression is unlikely, because recently we've switched to performing constexpr evaluation on pre-cp_folded bodies, not sure if we never encounter folded trees though. cp_fold itself depends on whether we ever reprocess the already folded trees, I'd be afraid we could. pt.c again unlikely, we should be cp_folding only later on. Jakub