aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-07-07 21:53:36 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-07-07 19:53:36 +0000
commit72732f3ef0f08c0547228a295c1f3a00907d061b (patch)
treeef51f4e4b972b0a3c0c64d2b10245d76bee936cf /gcc
parent3ca588d3e21439abfa36302defba9aaae83f9860 (diff)
downloadgcc-72732f3ef0f08c0547228a295c1f3a00907d061b.zip
gcc-72732f3ef0f08c0547228a295c1f3a00907d061b.tar.gz
gcc-72732f3ef0f08c0547228a295c1f3a00907d061b.tar.bz2
symtab.c: Include calls.h
* symtab.c: Include calls.h (symtab_nonoverwritable_alias_1): Check sanity of the local alias. From-SVN: r212337
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/symtab.c14
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8eec932..1e06ded 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-07 Jan Hubicka <hubicka@ucw.cz>
+
+ * symtab.c: Include calls.h
+ (symtab_nonoverwritable_alias_1): Check sanity of the local
+ alias.
+
2014-07-07 Maciej W. Rozycki <macro@codesourcery.com>
* config/rs6000/rs6000.c (output_vec_const_move): Handle
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 80ea94a..deb317d 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "lto-streamer.h"
#include "output.h"
#include "ipa-utils.h"
+#include "calls.h"
static const char *ipa_ref_use_name[] = {"read","write","addr","alias"};
@@ -1727,6 +1728,19 @@ symtab_nonoverwritable_alias_1 (symtab_node *node, void *data)
{
if (decl_binds_to_current_def_p (node->decl))
{
+ symtab_node *fn = symtab_alias_ultimate_target (node);
+
+ /* Ensure that the alias is well formed this may not be the case
+ of user defined aliases and currently it is not always the case
+ of C++ same body aliases (that is a bug). */
+ if (TREE_TYPE (node->decl) != TREE_TYPE (fn->decl)
+ || DECL_CONTEXT (node->decl) != DECL_CONTEXT (fn->decl)
+ || (TREE_CODE (node->decl) == FUNCTION_DECL
+ && flags_from_decl_or_type (node->decl)
+ != flags_from_decl_or_type (fn->decl))
+ || DECL_ATTRIBUTES (node->decl) != DECL_ATTRIBUTES (fn->decl))
+ return false;
+
*(symtab_node **)data = node;
return true;
}