On Mon, Jan 24, 2011 at 16:49, Ian Lance Taylor <i...@google.com> wrote: > Daniel Marjamäki <daniel.marjam...@gmail.com> writes: > >> Do you have any opinion about adding a warning for: >> >> int f(char c) >> { >> return 10 * (c == 13) ? 1 : 2; >> }
>> As far as I see the multiplication doesn't exist in the gimple format >> (looking at a.c.004t.gimple generated by -fdump-tree-all). > > It gets constant folded in the front end. Is that ever going to be fixed? If a front end mangles its AST representation, then it cannot be used for static analysis. Even if the constant folding in the front end is necessary for checking semantics, you could still keep the original source in the AST and simply attach the result of constant folding as some sort of tag to the expression node.