Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Latest commit

 

History

History
81 lines (73 loc) · 1.75 KB

p_59.md

File metadata and controls

81 lines (73 loc) · 1.75 KB

5.9 "Compiler l’affectation à une lvalue quelconque"

Command for the test (source code):

./chef.py test backend -bw doc/p_57.c
cat build/cpp-bin/assembly.s

Result:

.file  "p_59.c"
.text

.Ltext0:
  .globl main
  .type main, @function


main:
  pushq   %rbp
  movq    %rsp, %rbp
  subq $88, %rsp

  jmp    .L1_innerbeginof_main

.L1_innerbeginof_main:
  movl    $0, -8(%rbp)
  movl    -8(%rbp), %r10d
  movl    %r10d, -12(%rbp)                 # copyInstr
  movl    $0, -24(%rbp)
  movl    -24(%rbp), %r10d
  movl    %r10d, -16(%rbp)                 # copyInstr
  nop
  # empty with returnName=a
  movl    $79, -32(%rbp)
  movl    -32(%rbp), %r10d
  movl    %r10d, -12(%rbp)                 # copyInstr
  movl    $75, -40(%rbp)
  movl    $0, -48(%rbp)
  # common begin of arrayAccess of b
  pushq %rdx
  movl    -48(%rbp), %eax
  cltq
  # begin of local arrayAccess of b
  movl    -40(%rbp), %r10d
  movl    %r10d, -16(%rbp,%rax,4)
  movl    -40(%rbp), %r10d
  movl    %r10d, -52(%rbp)
  # end of local arrayAccess of b
  # empty with returnName=a
  pushq    %rdi
  movl    -12(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  movl    $0, -60(%rbp)
  # common begin of arrayAccess of b
  pushq %rdx
  movl    -60(%rbp), %eax
  cltq
  # begin of local arrayAccess of b
  movl    -16(%rbp,%rax,4), %r10d
  movl    %r10d, -64(%rbp)
  # end of local arrayAccess of b
  pushq    %rdi
  movl    -64(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  movl    $10, -72(%rbp)
  pushq    %rdi
  movl    -72(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  movl    $0, -80(%rbp)
  movl    -80(%rbp), %eax
  jmp    .L0_endof_main
  jmp    .L0_endof_main

.L0_endof_main:
  leave
  ret