------- Comment #1 from pinskia at gcc dot gnu dot org 2006-12-28 23:42 ------- > [I think most of these "interesting" foldings should be deferred] This is not an interesting fold anyways, unlike say the range generator.
Also this is really a reassociate issue. if we wrote the function like: int bar(int i) { return -i-1+1+i; } We get the correct result as we get: ((~i) + 1) + i which gets folded into: -i + i which then gets folded into: 0 > needs to do tree-combining Won't help because this still needs a reassociate. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Summary|fold folds -i-1+i+1 to |((-i-1) + i) +1) is turned |~i+i+1 |into ~i + (i+1) and never | |into 0 on the tree level http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30322