This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH for c++/19407 (attributes on template parms)
On 9/26/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> On 9/23/07, Jason Merrill <jason@redhat.com> wrote:
> > It's nice to have all these PRs with different testcases, as it means I
> > have to keep refining my code to make it deal with the different
> > situations. I wasn't very happy with my first pass, but I'm quite
> > pleased with the code now.
> >
> > This patch deals with the problem that we didn't know how to deal with
> > applying attributes to template type parms: now we can just defer all of
> > them until instantiation time.
>
> I don't know if exactly this patch is the culprit, but I see segfaults
> with tramp3d
> since 070924:
>
> Starting program: /abuild/rguenther/gimple-types-g/gcc/cc1plus -quiet
> -O0 /space/rguenther/tramp3d/tramp3d-v4.ii
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000545c5a in is_late_template_attribute (attr=0x2b2f2b957b70,
> decl=0x2b2f2f438a00)
> at /space/rguenther/src/svn/pointer_plus/gcc/cp/decl2.c:994
> 994 else if (TREE_CODE (decl) == TYPE_DECL || spec->type_required)
> (gdb) print spec
> $1 = (const struct attribute_spec *) 0x0
> (gdb) call debug_tree (decl)
> <function_decl 0x2b2f2f438a00 evaluate
> type <function_type 0x2b2f2bd620d0
>
> You can find tramp3d-v4.cpp source at
> http://www.suse.de/~rguenther/tramp3d/tramp3d-v4.cpp.gz
Short testcase:
struct foo {
template <class T>
void __attribute__((leafify)) bar() {}
};
void bar(void)
{
foo f;
f.bar<int>();
}
that is, an unknown attribute does it.
Richard.