re PR c++/43375 (ICE during compiling SSE code)

Fix for PR c++/43375

gcc/cp/ChangeLog:
	PR c++/43375
	* method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
	is NULL.
	* decl2.c (vague_linkage_p): Likewise.

gcc/testsuite/g++.dg/ChangeLog:
	PR c++/43375
	* g++.dg/abi/mangle42.C: New test.

From-SVN: r157590
This commit is contained in:
Dodji Seketeli 2010-03-20 08:55:32 +00:00 committed by Dodji Seketeli
parent 4dd9ee924b
commit 39bac0102c
5 changed files with 34 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2010-03-20 Dodji Seketeli <dodji@redhat.com>
PR c++/43375
* method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
is NULL.
* decl2.c (vague_linkage_p): Likewise.
2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/43418

View file

@ -1655,7 +1655,8 @@ vague_linkage_p (tree decl)
return (DECL_COMDAT (decl)
|| (((TREE_CODE (decl) == FUNCTION_DECL
&& DECL_DECLARED_INLINE_P (decl))
|| DECL_TEMPLATE_INSTANTIATION (decl))
|| (DECL_LANG_SPECIFIC (decl)
&& DECL_TEMPLATE_INSTANTIATION (decl)))
&& TREE_PUBLIC (decl)));
}

View file

@ -221,12 +221,15 @@ make_alias_for (tree target, tree newid)
TREE_THIS_VOLATILE (alias) = TREE_THIS_VOLATILE (target);
TREE_PUBLIC (alias) = 0;
DECL_INTERFACE_KNOWN (alias) = 1;
DECL_NOT_REALLY_EXTERN (alias) = 1;
if (DECL_LANG_SPECIFIC (alias))
{
DECL_NOT_REALLY_EXTERN (alias) = 1;
DECL_USE_TEMPLATE (alias) = 0;
DECL_TEMPLATE_INFO (alias) = NULL;
}
DECL_EXTERNAL (alias) = 0;
DECL_ARTIFICIAL (alias) = 1;
DECL_USE_TEMPLATE (alias) = 0;
DECL_TEMPLATE_INSTANTIATED (alias) = 0;
DECL_TEMPLATE_INFO (alias) = NULL;
if (TREE_CODE (alias) == FUNCTION_DECL)
{
DECL_SAVED_FUNCTION_DATA (alias) = NULL;

View file

@ -1,3 +1,8 @@
2010-03-20 Dodji Seketeli <dodji@redhat.com>
PR c++/43375
* g++.dg/abi/mangle42.C: New test.
2010-03-19 Andrew Pinski <andrew_pinski@caviumnetworks.com>
PR C/43211

View file

@ -0,0 +1,14 @@
// Origin: PR c++/43375
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-msse2 -std=gnu++0x" }
typedef float __v4sf __attribute__ ((__vector_size__ (16)));
typedef int __v4si __attribute__ ((__vector_size__ (16)));
__v4sf my_asin(__v4sf x)
{
static const __v4si g_Mask{0x7fffffff,
0x00000000,
0x7fffffff,
0x7fffffff };
return __builtin_ia32_andnps ((__v4sf) g_Mask, x);
}