From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22875 invoked by alias); 22 Apr 2002 16:46:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22852 invoked by uid 71); 22 Apr 2002 16:46:03 -0000 Date: Mon, 22 Apr 2002 09:46:00 -0000 Message-ID: <20020422164603.22850.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: lucho Subject: Re: optimization/6398: faulty code when inlining in a var-arged function Reply-To: lucho X-SW-Source: 2002-04/txt/msg01114.txt.bz2 List-Id: The following reply was made to PR optimization/6398; it has been noted by GNATS. From: lucho To: jakub@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, lucho@haemimont.bg, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: optimization/6398: faulty code when inlining in a var-arged function Date: Mon, 22 Apr 2002 18:45:29 +0300 This is a multi-part message in MIME format. --------------010302030908040209010702 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit here is the preprocessed source (as attachment) i haven't installed other gcc than 3.0 yet and so cannot test other versions --------------010302030908040209010702 Content-Type: text/plain; name="bug.i" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bug.i" # 1 "bug.c" # 1 "/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/include/stdarg.h" 1 3 # 43 "/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/include/stdarg.h" 3 typedef __builtin_va_list __gnuc_va_list; # 110 "/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0/include/stdarg.h" 3 typedef __gnuc_va_list va_list; # 2 "bug.c" 2 static void f1(int p, char *fmt, va_list args) { char *hdr[2] = {"AAAA", "BBBB"}; char buf[128]; int l; if (p > 2) return; l = strlen(hdr[p]); memcpy(buf, hdr[p], l); vsnprintf(buf + l, 128 - l, fmt, args); puts(buf); } void f2(int p, char *fmt, ...) { va_list args; __builtin_stdarg_start((args),fmt); f1(p, fmt, args); __builtin_va_end(args); } int main() { f2(0, "xyz"); return 0; } --------------010302030908040209010702--