On Wed, Oct 22, 2008 at 12:57 PM, Hallvard B Furuseth <[EMAIL PROTECTED]> wrote: > Info node (gcc)Warning Options mentions that gcc warns about > > int save_y; > if (change_y) save_y = y, y = new_y; > ... > if (change_y) y = save_y; > > However that's not always true, so it looks like gcc does have > the smarts to drop the warning. Could that be improved? > > gcc -W -O does not warn about this snippet, but it does warn with > -DMACRO or -O2. So it looks like the information that this code > is safe is available but not used.
Well the reason it is not warning in the -UMACRO case is because jump threading optimization has happened and removes one of the if(change_y) condition. Thanks, Andrew Pinski