[PATCH, c++]: Fix PR c++/31488 by Introducing LANG_HOOKS_SET_IS_AGGR_TYPE language hook.

Uros Bizjak ubizjak@gmail.com
Tue Dec 30 15:24:00 GMT 2008


Hello!

There is currently no way to communicate from target backend to the 
frontend that certain RECORD_TYPE structure is an aggregate. An example 
is alpha backend that creates RECORD_TYPE to pass variable arguments. 
Since this structure is not considered as non-POD by c++ frontend, 
several java testcases fail (please see PR c++/31488 and a classpath bug 
it blocks for more info):

FAIL: natgetargssize.cc compilation
FAIL: natgetlocalvartable.cc compilation
FAIL: natgetstacktrace.cc compilation
FAIL: natevents.cc compilation
FAIL: natgetallthreads.cc compilation
FAIL: natgeterrorname.cc compilation
FAIL: natgetmethodname.cc compilation

Attached patch introduces LANG_HOOKS_SET_IS_AGGR_TYPE language hook to 
give backends the ability to mark certain structures as POD.

2008-12-30  Uros Bizjak  <ubizjak@gmail.com>

    PR c++/31488
    * langhooks-def.h (LANG_HOOKS_SET_IS_AGGR_TYPE): New language hook.
    (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_SET_IS_AGGR_TYPE.
    * langhooks.h (struct lang_hooks_for_types): Add (*set_is_aggr_type).

    * config/alpha/alpha.c (alpha_build_builtin_va_list):
    Call set_is_aggr_type language hook.

cp/ChangeLog:

2008-12-30  Uros Bizjak  <ubizjak@gmail.com>

    PR c++/31488
    * cp-objcp-common.h (LANG_HOOKS_SET_IS_AGGR_TYPE): New language hook.
    * cp-tree.h (set_is_aggr_type): New prototype.
    * lex.c (set_is_aggr_type): New function.

testsuite/ChangeLog:

2008-12-30  Uros Bizjak  <ubizjak@gmail.com>

    PR c++/31488
    * g++.dg/other/vararg-3.C: New test.

Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu 
{,-m32} and alphaev56-unknown-linux-gnu.

The patch fixes above compilation failures. OK for 4.3/4.4?

Uros.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: p.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081230/d8ad0e80/attachment.txt>


More information about the Gcc-patches mailing list