Setting inferred volatile on symbol affected by address-of main::q = &main::p

CONTROL FLOW GRAPH SSA

void main()
main: scope:[main]  from __start
  main::p = 2w=3
  main::$0 = byte0  *main::q
  main::SCREEN[0] = main::$0
  main::$1 = byte1  *main::q
  main::SCREEN[1] = main::$1
  to:main::@return
main::@return: scope:[main]  from main
  return 
  to:@return

void __start()
__start: scope:[__start]  from
  call main
  to:__start::@1
__start::@1: scope:[__start]  from __start
  to:__start::@return
__start::@return: scope:[__start]  from __start::@1
  return 
  to:@return

SYMBOL TABLE SSA
void __start()
void main()
char main::$0
char main::$1
__constant char * const main::SCREEN = (char *)$400
__loadstore volatile unsigned int main::p
__constant unsigned int *main::q = &main::p

Adding number conversion cast (unumber) 0 in main::SCREEN[0] = main::$0
Adding number conversion cast (unumber) 1 in main::SCREEN[1] = main::$1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (char *) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simplifying expression containing zero main::SCREEN in [2] main::SCREEN[0] = main::$0
Successful SSA optimization PassNSimplifyExpressionWithZero
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Consolidated array index constant in *(main::SCREEN+1)
Successful SSA optimization Pass2ConstantAdditionElimination
Finalized unsigned number type (char) 2
Finalized unsigned number type (char) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
CALL GRAPH

Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes

FINAL CONTROL FLOW GRAPH

void main()
main: scope:[main]  from
  [0] main::p = 2w=3
  [1] main::$0 = byte0  *main::q
  [2] *main::SCREEN = main::$0
  [3] main::$1 = byte1  *main::q
  [4] *(main::SCREEN+1) = main::$1
  to:main::@return
main::@return: scope:[main]  from main
  [5] return 
  to:@return


VARIABLE REGISTER WEIGHTS
void main()
char main::$0 // 4.0
char main::$1 // 4.0
__loadstore volatile unsigned int main::p // 20.0

Initial phi equivalence classes
Added variable main::p to live range equivalence class [ main::p ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Complete equivalence classes
[ main::p ]
[ main::$0 ]
[ main::$1 ]
Allocated zp[2]:2 [ main::p ]
Allocated zp[1]:4 [ main::$0 ]
Allocated zp[1]:5 [ main::$1 ]
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [0] main::p = 2w=3 [ ] (  [ ] { }  ) always clobbers reg byte a 
Potential registers zp[2]:2 [ main::p ] : zp[2]:2 , 
Potential registers zp[1]:4 [ main::$0 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y , 
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y , 

REGISTER UPLIFT SCOPES
Uplift Scope [main] 20: zp[2]:2 [ main::p ] 4: zp[1]:4 [ main::$0 ] 4: zp[1]:5 [ main::$1 ] 
Uplift Scope [] 

Uplifting [main] best 33 combination zp[2]:2 [ main::p ] reg byte a [ main::$0 ] reg byte a [ main::$1 ] 
Uplifting [] best 33 combination 

ASSEMBLER BEFORE OPTIMIZATION
  // File Comments
// Reference file for Minimal struct -  using address-of
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-ptr-12-ref.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
.segment Code
  // main
main: {
    .label SCREEN = $400
    .label q = p
    .label p = 2
    // [0] main::p = 2w=3 -- vwuz1=vwuc1 
    lda #<2*$100+3
    sta.z p
    lda #>2*$100+3
    sta.z p+1
    // [1] main::$0 = byte0  *main::q -- vbuaa=_byte0__deref_pwuc1 
    lda.z q
    // [2] *main::SCREEN = main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // [3] main::$1 = byte1  *main::q -- vbuaa=_byte1__deref_pwuc1 
    lda.z q+1
    // [4] *(main::SCREEN+1) = main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    jmp __breturn
    // main::@return
  __breturn:
    // [5] return 
    rts
}
  // File Data

ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination

FINAL SYMBOL TABLE
void main()
char main::$0 // reg byte a 4.0
char main::$1 // reg byte a 4.0
__constant char * const main::SCREEN = (char *) 1024
__loadstore volatile unsigned int main::p // zp[2]:2 20.0
__constant unsigned int *main::q = &main::p

zp[2]:2 [ main::p ]
reg byte a [ main::$0 ]
reg byte a [ main::$1 ]


FINAL ASSEMBLER
Score: 30

  // File Comments
// Reference file for Minimal struct -  using address-of
  // Upstart
  // Commodore 64 PRG executable file
.file [name="struct-ptr-12-ref.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
  // Global Constants & labels
.segment Code
  // main
main: {
    .label SCREEN = $400
    .label q = p
    .label p = 2
    // word p = MAKEWORD( 2, 3 )
    // [0] main::p = 2w=3 -- vwuz1=vwuc1 
    lda #<2*$100+3
    sta.z p
    lda #>2*$100+3
    sta.z p+1
    // BYTE0(*q)
    // [1] main::$0 = byte0  *main::q -- vbuaa=_byte0__deref_pwuc1 
    lda.z q
    // SCREEN[0] = BYTE0(*q)
    // [2] *main::SCREEN = main::$0 -- _deref_pbuc1=vbuaa 
    sta SCREEN
    // BYTE1(*q)
    // [3] main::$1 = byte1  *main::q -- vbuaa=_byte1__deref_pwuc1 
    lda.z q+1
    // SCREEN[1] = BYTE1(*q)
    // [4] *(main::SCREEN+1) = main::$1 -- _deref_pbuc1=vbuaa 
    sta SCREEN+1
    // main::@return
    // }
    // [5] return 
    rts
}
  // File Data

