On Thu, Mar 7, 2024 at 11:37 AM Jakub Jelinek <ja...@redhat.com> wrote: > > On Thu, Mar 07, 2024 at 11:11:35AM +0100, Uros Bizjak wrote: > > > Since you CCed me - looking at the code I wonder why we fatally fail. > > > The following might also fix the issue and preserve more of the > > > rest of the flow of the function. > > > > > > If that works I'd prefer it. But I'll defer approval to the combine > > > maintainer which is Segher. > > > > Your patch is basically what v1 did [1], but it was suggested (in a > > reply by you ;) ) that we should stop the attempt to combine if we > > can't handle the use. So, the v2 patch undoes the combine and records > > a nice message in this case. > > My understanding of Richi's patch is that it it treats the non-COMPARISON_P > the same as if find_single_use fails, which is a common case that certainly > has to be handled right and it doesn't seem that we are giving up completely > for that case. So, I think it is reasonable to treat the non-COMPARISON_P > *cc_use_loc as NULL cc_use_loc.
Please see the logic in my v1 patch. For COMPARISON_P (*cc_use_loc), we execute the same code in the first hunk of the patch, but for non-COMPARISON_P, my patch zeroes cc_use_loc. The cc_use_loc is used only in the "if (cc_use_loc)" protected part, so clearing cc_use_loc when !COMPARISON_P (*cc_use_loc) has exactly the same effect as adding COMPARISON_P check to existing "if (cc_use_loc) - we can execute the "if" part only when *cc_use_loc is a comparison. The functionality of Richi's patch is exactly the same as my v1 patch which was rejected for the reason mentioned in my previous post. Uros.