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] Avoid division by zero during prediction merging


> Hi!
> 
> gcc ICEs when doing combine_predictions_for_insn on:
> (jump_insn 6083 6082 6084 (set (pc)
>         (if_then_else (eq (reg/v:DI 2478)
>                 (const_int 0 [0x0]))
>             (label_ref 6132)
>             (pc))) 175 {*bcc_normal} (nil)
>     (expr_list:REG_BR_PRED (concat (const_int 17 [0x11])
>             (const_int 3000 [0xbb8]))
>         (expr_list:REG_BR_PRED (concat (const_int 9 [0x9])
>                 (const_int 28 [0x1c]))
>             (expr_list:REG_BR_PRED (concat (const_int 9 [0x9])
>                     (const_int 28 [0x1c]))
>                 (expr_list:REG_BR_PRED (concat (const_int 9 [0x9])
>                         (const_int 10000 [0x2710]))
>                     (expr_list:REG_BR_PRED (concat (const_int 9 [0x9])
>                             (const_int 10000 [0x2710]))
>                         (nil)))))))
> 
> (the testcase is quite large and cannot be easily simplified, I'll try
> harder when I find time to create a testcase from it).
I guess all you need is to builtin_expect condition doing noreturn call.

I would still like to see the testcase personally, as the prediction appears to
be comming from loop exit heuristic that is basically OK, but it looks strange
that single edge may exit two loops in each direction.

Thanks for caring it!

Honza


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