Function average_num_loop_insns forgets to free loop body in early
return. Besides, overflow comparison checks
1000000 (e6) but the
return value is 100000 (e5), fix this typo.
gcc/ChangeLog
2020-01-14 Kewen Lin <linkw@gcc.gnu.org>
* cfgloopanal.c (average_num_loop_insns): Free bbs when early
return, fix typo on return value.
+2020-01-14 Kewen Lin <linkw@gcc.gnu.org>
+
+ * cfgloopanal.c (average_num_loop_insns): Free bbs when early return,
+ fix typo on return value.
+
2020-01-14 Xiong Hu Luo <luoxhu@linux.ibm.com>
PR ipa/69678
ninsns += (sreal)binsns * bb->count.to_sreal_scale (loop->header->count);
/* Avoid overflows. */
if (ninsns > 1000000)
- return 100000;
+ {
+ free (bbs);
+ return 1000000;
+ }
}
free (bbs);