This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/71331] New: target-tilegx: nested-function-4.c: r10 is conflict which is both in function frame and in parameter.


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71331

            Bug ID: 71331
           Summary: target-tilegx: nested-function-4.c: r10 is conflict
                    which is both in function frame and in parameter.
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gang.chen.5i5j at gmail dot com
  Target Milestone: ---

Created attachment 38591
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38591&action=edit
The related insns for nested-function-4.c

The nest function:

extern void abort(void);

void foo(int i)
{
  void bar(void)
  {
    if (i != 2)
      abort ();
  }

  bar();
}

int main(void)
{
  foo (2);
  return 0;
}


The command:

/upstream/build-gcc-tile/gcc/xgcc -B/upstream/build-gcc-tile/gcc/
./nested-func-4.c -fno-diagnostics-show-caret -fdiagnostics-color=never -pg
-I/upstream/release-tile/usr/include -fno-asynchronous-unwind-tables -m64
-mcpu=tilegx -mcmodel=large -mlittle-endian -L /upstream/release-tile/lib -lm
-o ./nested-func-4.exe -save-temps -fdump-final-insns=./insns.s


The asm output:

  1         .file   "nested-func-4.c"
  2         .text
  3         .align 8
  4         .type   bar.1690, @function
  5 bar.1690:
  6         {
  7         move    r10, lr
  8         jal     __mcount
  9         }
 10         st      sp, lr
 11         move    r29, r52
 12         move    r52, sp
 13         addi    r28, sp, -40
 14         addi    sp, sp, -48
 15         st      r28, r52
 16         addi    r27, r52, -8
 17         st      r27, r29
 18 
 19         move    r12, r10
 20         addi    r11, r52, -24
 21         st      r11, r10
 22         ld4s    r10, r12
 23         xori    r10, r10, 2; bfextu     r10, r10, 0, 31; cmpeqi r10, r10, 0
 24         bnez    r10, .L3
 25         moveli  r10, hw2_last(abort)
 26         shl16insli      r10, r10, hw1(abort)
 27         shl16insli      r10, r10, hw0(abort)
 28         jalr    r10
 29 .L3:
 30         nop
 31         ld      lr, r52
 32         addi    r28, r52, -8
 33         ld      r29, r28
 34 
 35         move    sp, r52
 36         move    r52, r29
 37         jrp     lr
 38         .size   bar.1690, .-bar.1690
 39         .align 8
 40 .global foo
 41         .type   foo, @function
 42 foo:
 43         {
 44         move    r10, lr
 45         jal     __mcount
 46         }
 47         st      sp, lr
 48         move    r29, r52
 49         move    r52, sp
 50         addi    r28, sp, -56
 51         addi    sp, sp, -64
 52         st      r28, r52
 53         addi    r27, r52, -8
 54         st      r27, r29
 55 
 56         move    r10, r0
 57         addxi   r11, r10, 0
 58         addi    r10, r52, -36
 59         st4     r10, r11
 60         move    r11, r52
 61         addi    r10, r52, -32
 62         addi    r10, r10, 8
 63         st      r10, r11
 64         addi    r10, r52, -32
 65         addi    r11, r52, -36
 66         ld4s    r11, r11
 67         st4     r10, r11
 68         addi    r10, r52, -32
 69         moveli  r11, hw2_last(bar.1690)
 70         shl16insli      r11, r11, hw1(bar.1690)
 71         shl16insli      r11, r11, hw0(bar.1690)
 72         jalr    r11
 73         nop
 74         ld      lr, r52
 75         addi    r28, r52, -8
 76         ld      r29, r28
 77 
 78         move    sp, r52
 79         move    r52, r29
 80         jrp     lr
 81         .size   foo, .-foo
 82         .align 8
 83 .global main
 84         .type   main, @function
 85 main:
 86         {
 87         move    r10, lr
 88         jal     __mcount
 89         }
 90         st      sp, lr
 91         move    r29, r52
 92         move    r52, sp
 93         addi    r28, sp, -24
 94         addi    sp, sp, -32
 95         st      r28, r52
 96         addi    r27, r52, -8
 97         st      r27, r29
 98 
 99         movei   r0, 2
100         moveli  r10, hw2_last(foo)
101         shl16insli      r10, r10, hw1(foo)
102         shl16insli      r10, r10, hw0(foo)
103         jalr    r10
104         movei   r10, 0
105         move    r0, r10
106         ld      lr, r52
107         addi    r28, r52, -8
108         ld      r29, r28
109 
110         move    sp, r52
111         move    r52, r29
112         jrp     lr
113         .size   main, .-main
114         .ident  "GCC: (GNU) 7.0.0 20160529 (experimental)"
115         .section        .note.GNU-stack,"",@progbits

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]