Menu

#1896 ds390: gcc-torture-execute-loop-5 fails

closed-fixed
DS390
5
2014-01-03
2011-12-21
No

Compilation of support/regression/tests/gcc-torture-execute-loop-5.c fails for ds390 in current (rev. #7116) svn ("Error: <p> phase error: label location changing between passes 2 and 3") . To reproduce: remove #if !defined(SDCC_ds390).

Philipp

Discussion

  • Erik Petrich

    Erik Petrich - 2011-12-23

    The ds390 code generator declares and uses a register with the name "_ap" which then clashes with the C source declaration of a function with the name "ap". The code generator also declares a register "ap" at the same address as "_ap". Probably we should eliminate the "_ap" definition to avoid the namespace clash, but I hesitate to change this without first understanding why this register is being declared in this unusual fashion.

     
  • Maarten Brock

    Maarten Brock - 2014-01-03

    I think "_ap" is created as an alias for either ap on ds390 or r5 in bank 3 on tini native. The choice to add an underscore is a bad one. I suggest to rename "_ap" in the code generator to "a1" or "acc1" as it is used as some sort of secondary accumulator register. The underlying ap register is never used for its real purpose: 22-bit paged addressing mode "Address Page" as SDCC only supports 22-bit contiguous addressing mode.

     
  • Maarten Brock

    Maarten Brock - 2014-01-03
    • summary: Compiling loop fails'' --> ds390: gcc-torture-execute-loop-5 fails
    • status: open --> closed-fixed
    • assigned_to: Maarten Brock
    • Category: --> DS390
     
  • Maarten Brock

    Maarten Brock - 2014-01-03

    Fixed in SDCC 3.3.2 #8936 by renaming _ap to acc1.

     

Log in to post a comment.