[Bug target/37593] -mlong-calls doesn't affect calls to _mcount generated with -pg
daney at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Sep 20 00:39:00 GMT 2008
------- Comment #1 from daney at gcc dot gnu dot org 2008-09-20 00:38 -------
This may be an ABI issue, but since -mlong-calls -mno-abicalls doesn't seem to
have a very rigorous ABI definition, we probably have some latitude with
respect to implementing this.
foo.c:
--------------
extern int a;
int foo(int, int, int);
int b(int i, int j, int k)
{
a++;
return foo(i, k, j) + 5;
}
--------------
$ mipsel-linux-gcc -mabi=64 -march=r5000 -O2 -S -fno-pic -pg -mno-abicalls
-mlong-calls foo.c
$ cat foo.s
.file 1 "foo.c"
.section .mdebug.abiN64
.previous
.gnu_attribute 4, 3
.text
.align 2
.align 3
.globl b
.ent b
.type b, @function
b:
.set nomips16
.frame $sp,16,$31 # vars= 0, regs= 1/0, args= 0, gp= 0
.mask 0x80000000,-8
.fmask 0x00000000,0
daddiu $sp,$sp,-16
sd $31,8($sp)
.set noat
move $1,$31 # save current return address
jal _mcount
.set at
lui $8,%highest(a)
daddiu $8,$8,%higher(a)
lui $2,%hi(a)
dsll $8,$8,32
daddu $8,$8,$2
lw $2,%lo(a)($8)
move $7,$5
lui $3,%highest(foo)
move $5,$6
daddiu $3,$3,%higher(foo)
move $6,$7
lui $7,%hi(foo)
addiu $2,$2,1
daddiu $7,$7,%lo(foo)
dsll $3,$3,32
daddu $3,$3,$7
.set noreorder
.set nomacro
jalr $3
sw $2,%lo(a)($8)
.set macro
.set reorder
ld $31,8($sp)
addiu $2,$2,5
.set noreorder
.set nomacro
j $31
daddiu $sp,$sp,16
.set macro
.set reorder
.end b
.ident "GCC: (GNU) 4.3.2"
--
daney at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-09-20 00:38:15
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37593
More information about the Gcc-bugs
mailing list