This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, tree-optimization]: Fix PR tree-optimization/32821, segfault with -ftree-dump-tree-ifcvt-details


On 9/6/07, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> As described in PR, compiler segfaults when trying to iterate through bb
> with no stmt. Attached patch adds checking for NULL bb_stmt_list in
> [c]bsi_start() and [c]bsi_last() to solve this problem.
>
> Patch was bootstrapped on x86_64-pc-linux-gnu. Regression test {,-m32}
> is in progress. OK if it passes?
>
> [BTW: Yes, -ftree-vectorize is enough , we don't need to add -msse2 or
> -altivec or whatever to trigger this bug.]

The problem is because tree-if-conv.c does

     /* Update stmt list.  */
      last = tsi_last (bb_stmt_list (merge_target_bb));
      tsi_link_after (&last, bb_stmt_list (bb), TSI_NEW_STMT);
      set_bb_stmt_list (bb, NULL);

but NULL statement lists are not allowed.  Instead the set_bb_stmt_list call
should read

set_bb_stmt_list (bb, alloc_stmt_list());

matching what create_bb does.

This change is pre-approved.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]