c++/1482: va_start generates call to memcpy
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Thu Dec 21 11:36:00 GMT 2000
The following reply was made to PR c++/1482; it has been noted by GNATS.
From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: andyj@mc.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/1482: va_start generates call to memcpy
Date: Thu, 21 Dec 2000 20:30:28 +0100
--=====================_31675899==_
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 23:07 2000-12-20, andyj@mc.com wrote:
> >Number: 1482
> >Category: c++
> >Synopsis: va_start generates call to memcpy
> >Confidential: no
> >Severity: serious
> >Priority: high
> >Responsible: unassigned
> >State: open
> >Class: sw-bug
> >Submitter-Id: net
> >Arrival-Date: Wed Dec 20 14:16:00 PST 2000
> >Closed-Date:
> >Last-Modified:
> >Originator: E. Andrew Johnson
> >Release: g++-2.95.2
> >Organization:
> >Environment:
>target=powerpc with Altivec 2.95.2 patches
> >Description:
>The expansion of va_start includes a call to _builtin_memcpy. When
>compiling with the gcc-2.95.2 C compiler, this generates the inline
>expansion of the code. When compiling with the gcc-2.95.2 C++ compiler,
>it generates an external call to memcpy. The problem is that the
>type.align for "va_list ap" is set to 1, whereas it is
>set to 8 (1 byte) in C. Why does it behave differently
>with the C++ compiler?
Nobody knows :-). This was fixed a few days after gcc-2.95 came out, Bernd
Schmidt and others commonized the tree node handling with C/C++ and thus
fixed the bug. For gcc-2.95.2 you can try the appended patch which copies
the void_type_node TYPE_ALIGN handling from c-decl.c to cp/decl.c.
Franz.
* decl.c (init_decl_processing): Align void_type_node to
BITS_PER_UNIT as in C.
--=====================_31675899==_
Content-Type: application/octet-stream; name="cplus-void_type_node-align.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="cplus-void_type_node-align.patch"
SW5kZXg6IGdjYy9jcC9kZWNsLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2cy9nY2MvZWdjcy9n
Y2MvY3AvZGVjbC5jLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjM1OC40LjEzCmRpZmYgLXUgLXAg
LXIxLjM1OC40LjEzIGRlY2wuYwotLS0gZ2NjL2NwL2RlY2wuYwkyMDAwLzA2LzEwIDAwOjA2OjQy
CTEuMzU4LjQuMTMKKysrIGdjYy9jcC9kZWNsLmMJMjAwMC8xMi8yMSAxODo0Mjo1MwpAQCAtNjQ3
Myw2ICs2NDczLDkgQEAgaW5pdF9kZWNsX3Byb2Nlc3NpbmcgKCkKICAgdm9pZF90eXBlX25vZGUg
PSBtYWtlX25vZGUgKFZPSURfVFlQRSk7CiAgIHJlY29yZF9idWlsdGluX3R5cGUgKFJJRF9WT0lE
LCBOVUxMX1BUUiwgdm9pZF90eXBlX25vZGUpOwogICBsYXlvdXRfdHlwZSAodm9pZF90eXBlX25v
ZGUpOyAvKiBVc2VzIGludGVnZXJfemVyb19ub2RlLiAgKi8KKyAgLyogV2UgYXJlIG5vdCBnb2lu
ZyB0byBoYXZlIHJlYWwgdHlwZXMgaW4gQyB3aXRoIGxlc3MgdGhhbiBieXRlIGFsaWdubWVudCwK
KyAgICAgc28gd2UgbWlnaHQgYXMgd2VsbCBub3QgaGF2ZSBhbnkgdHlwZXMgdGhhdCBjbGFpbSB0
byBoYXZlIGl0LiAgKi8KKyAgVFlQRV9BTElHTiAodm9pZF90eXBlX25vZGUpID0gQklUU19QRVJf
VU5JVDsKICAgdm9pZF9saXN0X25vZGUgPSBidWlsZF90cmVlX2xpc3QgKE5VTExfVFJFRSwgdm9p
ZF90eXBlX25vZGUpOwogICBUUkVFX1BBUk1MSVNUICh2b2lkX2xpc3Rfbm9kZSkgPSAxOwogCg==
--=====================_31675899==_--
More information about the Gcc-prs
mailing list