This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
egcs-20000925 code generation bug
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Subject: egcs-20000925 code generation bug
- From: Richard Zidlicky <Richard dot Zidlicky at stud dot informatik dot uni-erlangen dot de>
- Date: Sat, 30 Sep 2000 22:51:49 +0200
Hello,
the snapshot almost works for me, but fails on
this varargs like code:
/*
* oprintf functional equivalent to printf that writes
* to output instead of stdout.
*/
/*PRINTFLIKE1 */
void oprintf (const char * formatstr)
{
va_list ap;
VA_START (ap, formatstr);
vprint (output, formatstr, ap);
va_end (ap);
}
# preprocessed to
void oprintf (const char * formatstr, ...)
{
va_list ap;
((ap) = (va_list)&formatstr + ((sizeof(formatstr)+sizeof(int)-(size_t)1) & ~(sizeof(int) -(size_t)1)));
vprint (output, formatstr, ap);
;
}
# produces this code:
_oprintf:
pea 8(sp)
move.l 4(sp),-(sp) # !!!! gcc lost track that previous
# insn pushed the stack - needs be 8(sp) now
move.l _output,-(sp)
bsr _vprint
lea 12(sp),sp
rts
# for comparison code produced by 2.95.1, the link insn avoids all trouble
_oprintf:
link a6,#0
pea 12(a6)
move.l 8(a6),-(sp)
move.l _output,-(sp)
bsr _vprint
lea 12(sp),sp
unlk a6
rts
The code was generated with -O2 -fomit-frame-pointer in both cases.
The target is m68k-qdos which I should merge into official gcc
asap - how is that supposed to be done?
Bye
Richard