On 7/25/2021 7:47 PM, Bin.Cheng wrote:
On Sat, Jul 24, 2021 at 12:30 AM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:


On 7/14/2021 3:14 AM, bin.cheng via Gcc-patches wrote:
Hi,
I ran into a wrong code bug in code with deep template instantiation when 
working on sdx::simd.
The root cause as described in commit summary is we skip prologue insns in 
init_alias_analysis.
This simple patch fixes the issue, however, it's hard to reduce a case because 
of heavy use of
templates.
Bootstrap and test on x86_64, is it OK?
It's a clear correctness improvement, but what's unclear to me is why
we'd want to skip them in the epilogue either.
I can only guess, there is nothing to initialize epilogue for because
no code follows.
Yea, but couldn't the lack of analysis of the epilogue lead to a pass mis-optimizing code within the epilogue itself?  It's not terribly likely, but it just seems wrong to skip the epilogue like this.  Remember, the aliasing bits are just an analysis phase to find the aliasing relationships that exist and we don't necessarily know how that data is going to be used.  It may in fact be safe now, but may not be safe in the future if someone added a late RTL pass that used the aliasing info in a new way.

The more I think about it, the more I think we should remove remove this hunk of code completely.  There is some chance for fallout, but I think it's unlikely.

Jeff

Reply via email to