https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66442
--- Comment #1 from vries at gcc dot gnu.org ---
The problem is here:
...
static bool
try_transform_to_exit_first_loop_alt (struct loop *loop,
reduction_info_table_type
*reduction_list,
tree nit)
{
/* Check whether the latch contains a single statement. */
if (!gimple_seq_singleton_p (bb_seq (loop->latch)))
return true;
...
First of all, the 'return true' should be 'return false'. That fixes the
-fcompare-debug failure, but means that with and without -g, we return false at
a different location in try_transform_to_exit_first_loop_alt.
The gimple_seq_singleton_p returns different results with and without -g, we
need to use a 'gimple_seq_nondebug_singleton_p'.