diff options
author | jiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-02 04:09:58 +0000 |
---|---|---|
committer | jiez <jiez@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-02 04:09:58 +0000 |
commit | de9f96f2397d28b640d2b457a715ecec4e658556 (patch) | |
tree | 0d324330ed956478e577c015886740f35584d137 /gcc | |
parent | dee9f0c70a72f06f373f706d42e9e3cf86778b37 (diff) | |
download | gcc-de9f96f2397d28b640d2b457a715ecec4e658556.tar.gz |
PR middle-end/46674
* varasm.c (compute_visible_aliases): Handle user set
assembler name.
testsuite/
PR middle-end/46674
* gcc.dg/pr46674.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167365 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr46674.c | 11 | ||||
-rw-r--r-- | gcc/varasm.c | 11 |
4 files changed, 32 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1f051c0ef20..f4302dc8b75 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-12-02 Jie Zhang <jie@codesourcery.com> + + PR middle-end/46674 + * varasm.c (compute_visible_aliases): Handle user set + assembler name. + 2010-12-01 Michael Meissner <meissner@linux.vnet.ibm.com> * config/rs6000/rs6000.c (rs6000_option_override_internal): Fix diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51b34fcbbe5..d70e0b19953 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-12-02 Jie Zhang <jie@codesourcery.com> + + PR middle-end/46674 + * gcc.dg/pr46674.c: New test. + 2010-12-02 Nicola Pero <nicola.pero@meta-innovation.com> * objc.dg/exceptions-6.m: New. diff --git a/gcc/testsuite/gcc.dg/pr46674.c b/gcc/testsuite/gcc.dg/pr46674.c new file mode 100644 index 00000000000..cf6dfc77fb5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr46674.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-require-alias "" } */ +/* { dg-options "-O2" } */ + +int yum; +void dessert (void) { ++yum; } +extern void jelly (void) __asm__ ("jelly2") __attribute__ ((alias ("dessert"), weak)); +extern void wobbly (void) __attribute__ ((alias ("jelly2"), weak)); + +/* { dg-final { scan-assembler "wobbly" } } */ +/* { dg-final { scan-assembler "jelly2" } } */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 5f79ece7001..921ee2e1d29 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5525,12 +5525,21 @@ compute_visible_aliases (void) { struct cgraph_node *fnode = NULL; struct varpool_node *vnode = NULL; + tree asmname = DECL_ASSEMBLER_NAME (p->decl); + const char *str = IDENTIFIER_POINTER (asmname); + + if (str[0] == '*') + { + str ++; + asmname = get_identifier (str); + } + fnode = cgraph_node_for_asm (p->target); vnode = (fnode == NULL) ? varpool_node_for_asm (p->target) : NULL; if ((fnode || vnode || pointer_set_contains (visible, p->target)) - && !pointer_set_insert (visible, DECL_ASSEMBLER_NAME (p->decl))) + && !pointer_set_insert (visible, asmname)) changed = true; } } |