We have found a weakness (CWE-401) using PVS-Studio tool. PVS-Studio is a static code analyzer for C, C++ and C#: https://www.viva64.com/en/pvs-studio/ Analyzer warning: V625 Consider inspecting the 'for' operator. Initial and final values of the iterator are the same. sese.c 201 void free_sese_info (sese_info_p region) { region->params.release (); region->loop_nest.release (); for (rename_map_t::iterator it = region->rename_map->begin(); it != region->rename_map->begin (); ++it) // <= (*it).second.release(); .... }
Mine.
Author: rguenth Date: Fri Mar 17 11:03:32 2017 New Revision: 246217 URL: https://gcc.gnu.org/viewcvs?rev=246217&root=gcc&view=rev Log: 2017-03-17 Richard Biener <rguenther@suse.de> PR tree-optimization/80048 * sese.c (free_sese_info): Properly release rename_map and copied_bb_map elements. Modified: trunk/gcc/ChangeLog trunk/gcc/sese.c
Fixed.
I opened bug 80087 to consider enhancing -Wtautological-compare so as to detect and diagnose this class of problems.