2017-05-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2016-09-19 Jakub Jelinek <jakub@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ PR target/77587
+ * cgraph.c (cgraph_node::rtl_info): Pass &avail to
+ ultimate_alias_target call, return NULL if avail < AVAIL_AVAILABLE.
+ Call ultimate_alias_target just once, not up to 4 times.
+
2016-09-16 Jakub Jelinek <jakub@redhat.com>
Eric Botcazou <ebotcazou@adacore.com>
cgraph_node *node = get (decl);
if (!node)
return NULL;
- node = node->ultimate_alias_target ();
- if (node->decl != current_function_decl
- && !TREE_ASM_WRITTEN (node->decl))
+ enum availability avail;
+ node = node->ultimate_alias_target (&avail);
+ if (decl != current_function_decl
+ && (avail < AVAIL_AVAILABLE
+ || (node->decl != current_function_decl
+ && !TREE_ASM_WRITTEN (node->decl))))
return NULL;
- return &node->ultimate_alias_target ()->rtl;
+ return &node->rtl;
}
/* Return a string describing the failure REASON. */
2017-05-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2016-09-19 Jakub Jelinek <jakub@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ PR target/77587
+ * gcc.dg/pr77587.c: New test.
+ * gcc.dg/pr77587a.c: New file.
+
2016-09-16 Jakub Jelinek <jakub@redhat.com>
PR c++/77375
--- /dev/null
+/* PR target/77587 */
+/* { dg-do run } */
+/* { dg-require-weak-override "" } */
+/* { dg-additional-sources "pr77587a.c" } */
+
+void
+bar (long x, long y, long z)
+{
+ struct __attribute__((aligned (16))) S { long a, b, c, d; } s;
+ char *p = (char *) &s;
+ __asm ("" : "+r" (p));
+ if (((__UINTPTR_TYPE__) p) & 15)
+ __builtin_abort ();
+}
--- /dev/null
+/* PR target/77587 */
+/* { dg-do compile } */
+/* { dg-require-weak-override "" } */
+
+void
+foo (long x, long y, long z)
+{
+}
+
+void bar (long x, long y, long z) __attribute__ ((weak, alias ("foo")));
+
+void
+baz (long x, long y, long z)
+{
+ bar (0, 0, 0);
+}
+
+int
+main ()
+{
+ baz (0, 0, 0);
+ return 0;
+}