jkmcnk / sx-gcc

The GNU Compiler Collection port to NEC SX CPU architecture.
GNU General Public License v2.0
0 stars 2 forks source link

trashing call address #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
gcc.c-torture/execute/multi-ix.c testcase.

with -O>0, the first call from f() (to s()), is compiled into:

    lds $s36,.LC2   #movdi case3
    lea $s36,41
    sts $s36,-608(,$s2)
    lea $s34,-608(,$s2)
    or  $s33,0,$s36
    bsic    $s32,($s33)

the lea trashes the proper call address (loaded from .LC2 prior to lea).

Original issue reported on code.google.com by jmoc...@gmail.com on 15 Jan 2009 at 1:16

GoogleCodeExporter commented 8 years ago
this was caused because the 2nd alternative of call_indirect insn was chosen, 
which
did not have the scratch reg marked as earlyclobber. namely, earlyclobber 
constraint
modifier must be, as opposed to most other modifiers, written explicitly for 
*every*
alternative.

with r194 it is, and this fixes the bug.

Original comment by jmoc...@gmail.com on 15 Jan 2009 at 1:42