[Bug tree-optimization/100934] [9/10/11/12 Regression] wrong code at -O3 during unrolling since r9-6299

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 14 12:59:57 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100934

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #8)
> --- a/gcc/tree-ssa-threadupdate.c
> +++ b/gcc/tree-ssa-threadupdate.c
> @@ -2379,12 +2379,15 @@ jump_thread_path_registry::duplicate_thread_path
> (edge entry,
>       missuses of the functions.  I.e. if you ask to copy something weird,
>       it will work, but the state of structures probably will not be
>       correct.  */
> +  bool loop_header_duplicated = false;
>    for (i = 0; i < n_region; i++)
>      {
>        /* We do not handle subloops, i.e. all the blocks must belong to the
>          same loop.  */
>        if (region[i]->loop_father != loop)
>         return false;
> +      if (region[i]->loop_father == loop)
> +       loop_header_duplicated = true;

The if right above this returns false if loop_father is not loop, so
wouldn't be loop_header_duplicated == true whenever n_region != 0 (or always)?


More information about the Gcc-bugs mailing list