http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47025
Summary: Dead stores in varadic functions not eliminated Product: gcc Version: 4.5.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: j...@beniston.com If I compile a varadic function such as this: double d; void func(int a, ...) { va_list ap; va_start(ap, a); d = va_arg(ap, double); va_end(ap); } with: mips-elf-gcc test.c -O2 -S -mhard-float -march=m4k -mabi=eabi The stores of register arguments on to the stack are not eliminated, even if not used. Eg: func: .frame $sp,80,$31 # vars= 16, regs= 0/0, args= 0, gp= 0 .mask 0x00000000,0 .fmask 0x00000000,0 .set noreorder .set nomacro addiu $sp,$sp,-80 addiu $2,$sp,80 sw $2,0($sp) sw $2,4($sp) addiu $2,$sp,48 sw $2,8($sp) li $2,28 sb $2,12($sp) li $2,24 sw $5,52($sp) # redundant stores sw $6,56($sp) sw $7,60($sp) sw $8,64($sp) sw $9,68($sp) sw $10,72($sp) sw $11,76($sp) sdc1 $f12,16($sp) sdc1 $f14,24($sp) sdc1 $f16,32($sp) sdc1 $f18,40($sp) sb $2,13($sp) sdc1 $f12,%gp_rel(d)($28) j $31 addiu $sp,$sp,80