Skip to content

Fix ASG struct (copy) with different src and dst sizes after global morph. #39128

@sandreenko

Description

@sandreenko

#39066 (comment) has a detailed description of the issue, shortly we should not allow IR with mismatched src and dst size under `ASG struct (copy) like:

               [000008] -A-XG+------              *  ASG       struct (copy)
               [000000] D----+-N----              +--*  LCL_VAR   struct<B, 8> V02 loc1 <- 8 byte size
               [000004] ---XG+-N----              \--*  IND       byte                                 <- 1 byte size
               [000003] *--XG+------                 \--*  IND       long   Zero Fseq[a]
               [000002] -----+------                    \--*  LCL_VAR   long   V00 arg0

I am going to:

  1. reenable the IL test;
  2. finish the fix in fgMorphCopyBlock (sandreenko@6b07be7);
  3. add more asserts and reenable the optimization;
  4. check how it works for primitive types and sizes that do not match struct borders;

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIbug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions