don't ICE when section attribute is used on things in comdats
gcc/ PR ipa/63621 * symtab.c (symtab_node::verify): Check for section attribute before asserting something isn't in a section and a comdat group. From-SVN: r218476
This commit is contained in:
parent
35efb9ac39
commit
b0122457bc
@ -1,3 +1,8 @@
|
||||
2014-12-07 Trevor Saunders <tsaunders@mozilla.com>
|
||||
|
||||
* symtab.c (symtab_node::verify): Check for section attribute before
|
||||
asserting something isn't in a section and a comdat group.
|
||||
|
||||
2014-12-07 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/50751
|
||||
|
@ -1102,7 +1102,8 @@ symtab_node::verify_base (void)
|
||||
error_found = true;
|
||||
}
|
||||
if (get_section () && get_comdat_group ()
|
||||
&& !implicit_section)
|
||||
&& !implicit_section
|
||||
&& !lookup_attribute ("section", DECL_ATTRIBUTES (decl)))
|
||||
{
|
||||
error ("Both section and comdat group is set");
|
||||
error_found = true;
|
||||
|
29
gcc/testsuite/g++.dg/ipa/pr63621.C
Normal file
29
gcc/testsuite/g++.dg/ipa/pr63621.C
Normal file
@ -0,0 +1,29 @@
|
||||
// { dg-do compile }
|
||||
class A
|
||||
{
|
||||
public:
|
||||
int __attribute__((section("a"))) f1(bool);
|
||||
int f2(void *);
|
||||
int f3(bool);
|
||||
};
|
||||
|
||||
inline int A::f1(bool b)
|
||||
{
|
||||
static int c;
|
||||
if (c)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline int A::f3(bool b)
|
||||
{
|
||||
static __attribute__((section(""))) int c;
|
||||
if (c)
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int A::f2(void *c)
|
||||
{
|
||||
return f1(c) + f3(c);
|
||||
}
|
Loading…
Reference in New Issue
Block a user