How to suppress __ashldi3 for gcc 4.3.2?

Pan ruochen panruochen@gmail.com
Mon Jun 8 02:15:00 GMT 2009


Hi All,

I compile the following code with mips-elf-gcc 4.3.2:
---------------------------------------------------------
unsigned long long shift(unsigned long long x, unsigned int n)
{
	return x << n;
}
---------------------------------------------------------
$mips-elf-gcc -EL -Os -G0 -mips32r2 -fno-pic -fno-builtin
-mno-abicalls -c -o a.o skull.c
$mips-elf-objdump -r -S a.o

a.o:     file format elf32-littlemips

Disassembly of section .text:

00000000 <shift>:
   0:	27bdffe8 	addiu	sp,sp,-24
   4:	afbf0014 	sw	ra,20(sp)
   8:	0c000000 	jal	0 <shift>
			8: R_MIPS_26	__ashldi3
   c:	00000000 	nop
  10:	8fbf0014 	lw	ra,20(sp)
  14:	03e00008 	jr	ra
  18:	27bd0018 	addiu	sp,sp,24
But, with an older version 3.4.0, I get totally different results:
$mips-elf-gcc -EL -Os -G0 -mips32r2 -fno-pic -fno-builtin
-mno-abicalls -c -o a.o skull.c
$mips-elf-objdump -r -S a.o
a.o:     file format elf32-littlemips

Disassembly of section .text:

00000000 <shift>:
   0:	00063e80 	sll	a3,a2,0x1a
   4:	04e10004 	bgez	a3,18 <shift+0x18>
   8:	00000000 	nop
   c:	00c41804 	sllv	v1,a0,a2
  10:	10000007 	b	30 <shift+0x30>
  14:	00001021 	move	v0,zero
  18:	10e00004 	beqz	a3,2c <shift+0x2c>
  1c:	00c51804 	sllv	v1,a1,a2
  20:	00063823 	negu	a3,a2
  24:	00e43806 	srlv	a3,a0,a3
  28:	00671825 	or	v1,v1,a3
  2c:	00c41004 	sllv	v0,a0,a2
  30:	03e00008 	jr	ra
  34:	00000000 	nop
__ashldi3 seems to be an built-in function, but the option
-fno-builtin does not suppress it.
How can I inform gcc not to refer to the function __ashldi3 since
there are no libgcc, libc and libe available in this distribution of
gcc.


Best Regards,
PRC
June 8, 2009



More information about the Gcc-help mailing list