Re: [PATCH] Improve fold_compare (PR c++/71537)

2016-12-05 Thread Jeff Law
On 12/05/2016 10:00 AM, Jakub Jelinek wrote: Hi! As the testcase shows, we also want to fold "abcd" + 3 != NULL at constant time. The following patch fixes that. Additionally, I think if !indirect_base0 then we basically want to compare whether the base0's value rather than address is non-NULL,

[PATCH] Improve fold_compare (PR c++/71537)

2016-12-05 Thread Jakub Jelinek
Hi! As the testcase shows, we also want to fold "abcd" + 3 != NULL at constant time. The following patch fixes that. Additionally, I think if !indirect_base0 then we basically want to compare whether the base0's value rather than address is non-NULL, which we can't optimize. All we can optimize