public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename
@ 2004-10-13 22:05 schwab at suse dot de
  2004-10-13 23:03 ` [Bug target/17982] " pinskia at gcc dot gnu dot org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: schwab at suse dot de @ 2004-10-13 22:05 UTC (permalink / raw)
  To: gcc-bugs

When an identifier has been used in an inline declaration subsequent renames 
of it are ignored.  That used to work with gcc 3.4 and still works on i386 and 
ppc at least.  This breaks building glibc. 
 
$ cat asm.c 
extern int foo (void); 
extern inline int 
bar (void) 
{ 
  return foo (); 
} 
extern __typeof (foo) foo __asm__ ("mumble"); 
int foobar (void) 
{ 
  return bar (); 
} 
$ gcc-4.0 -O -S asm.c 
asm.c:7: warning: asm declaration ignored due to conflict with previous rename 
$ grep mumble asm.s 
$ grep foo asm.s 
	.global foobar# 
	.proc foobar# 
foobar: 
	br.call.sptk.many b0 = foo# 
	.endp foobar#

-- 
           Summary: [4.0 regression] asm declaration ignored due to conflict
                    with previous rename
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schwab at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: ia64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
@ 2004-10-13 23:03 ` pinskia at gcc dot gnu dot org
  2004-10-13 23:04 ` pinskia at gcc dot gnu dot org
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 23:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-13 23:03 -------
DECL_ASSEMBLER_NAME_SET_P is true on ia64 for some reason which gets set when we call 
make_decl_rtl at c-decl.c:1757, why I don't know.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
  2004-10-13 23:03 ` [Bug target/17982] " pinskia at gcc dot gnu dot org
@ 2004-10-13 23:04 ` pinskia at gcc dot gnu dot org
  2004-10-13 23:18 ` pinskia at gcc dot gnu dot org
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 23:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-13 23:03 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-13 23:03:57
               date|                            |
   Target Milestone|---                         |4.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
  2004-10-13 23:03 ` [Bug target/17982] " pinskia at gcc dot gnu dot org
  2004-10-13 23:04 ` pinskia at gcc dot gnu dot org
@ 2004-10-13 23:18 ` pinskia at gcc dot gnu dot org
  2004-10-13 23:22 ` pinskia at gcc dot gnu dot org
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 23:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-13 23:18 -------
The RTL is set because IA64 has ASM_OUTPUT_EXTERNAL defined.
I think is related to changes which Zack made to c-decl.c.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zack at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (2 preceding siblings ...)
  2004-10-13 23:18 ` pinskia at gcc dot gnu dot org
@ 2004-10-13 23:22 ` pinskia at gcc dot gnu dot org
  2004-10-13 23:29 ` zack at codesourcery dot com
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 23:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-13 23:22 -------
The call to make_decl_rtl is from assemble_external.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (3 preceding siblings ...)
  2004-10-13 23:22 ` pinskia at gcc dot gnu dot org
@ 2004-10-13 23:29 ` zack at codesourcery dot com
  2004-10-13 23:49 ` pinskia at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-10-13 23:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-10-13 23:29 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename


Hmm.  Why are we calling assemble_external before EOF?

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (4 preceding siblings ...)
  2004-10-13 23:29 ` zack at codesourcery dot com
@ 2004-10-13 23:49 ` pinskia at gcc dot gnu dot org
  2004-11-09 15:47 ` schwab at suse dot de
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-13 23:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-13 23:49 -------
1764      if (!skip_evaluation)
1765        assemble_external (ref);

#0  assemble_external (decl=0x41682934) at ../../gcc/varasm.c:1771
#1  0x00043c20 in build_external_ref (id=0x41686ac4, fun=1) at ../../gcc/c-typeck.c:1765
#2  0x0000534c in yyparse () at c-parse.y:626
#3  0x0000ac60 in c_parse_file () at c-parse.y:2903
#4  0x000a0728 in c_common_parse_file (set_yydebug=0) at ../../gcc/c-opts.c:1095
#5  0x0054dc6c in compile_file () at ../../gcc/toplev.c:985
#6  0x00550814 in do_compile () at ../../gcc/toplev.c:2069
#7  0x005508b0 in toplev_main (argc=3, argv=0xbffffd5c) at ../../gcc/toplev.c:2101
#8  0x000c69dc in main (argc=3, argv=0xbffffd5c) at ../../gcc/main.c:35

where the call to build_external_ref:
primary:
        IDENTIFIER
                {
                  if (yychar == YYEMPTY)
                    yychar = YYLEX;
                  $$.value = build_external_ref ($1, yychar == '(');
                  $$.original_code = ERROR_MARK;
                }



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (5 preceding siblings ...)
  2004-10-13 23:49 ` pinskia at gcc dot gnu dot org
@ 2004-11-09 15:47 ` schwab at suse dot de
  2004-11-23 19:13 ` hjl at lucon dot org
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: schwab at suse dot de @ 2004-11-09 15:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-11-09 15:47 -------
This is the change that broke this: 
 
2004-06-20  Zack Weinberg  <zack@codesourcery.com> 
 
	* c-common.h (has_c_linkage): New interface. 
	... 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (6 preceding siblings ...)
  2004-11-09 15:47 ` schwab at suse dot de
@ 2004-11-23 19:13 ` hjl at lucon dot org
  2004-11-23 19:18 ` hjl at lucon dot org
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-23 19:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-23 19:13 -------
*** Bug 18632 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl at lucon dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug target/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (7 preceding siblings ...)
  2004-11-23 19:13 ` hjl at lucon dot org
@ 2004-11-23 19:18 ` hjl at lucon dot org
  2004-11-23 19:22 ` [Bug middle-end/17982] " pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-23 19:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-23 19:18 -------
It also happens on x86_64 and i386 if -O1 or -O0 is used. It has nothing to
do with function inline.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|ia64-linux                  |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (8 preceding siblings ...)
  2004-11-23 19:18 ` hjl at lucon dot org
@ 2004-11-23 19:22 ` pinskia at gcc dot gnu dot org
  2004-11-23 21:13 ` hjl at lucon dot org
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-23 19:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-23 19:22 -------
Actually the example in comment #0 does not fail on x86 or ppc, only ia64 because of the reasons I 
outlined.  Now the testcase in PR 18632 has always failed, we just did not warn about it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |middle-end
 GCC target triplet|                            |ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (9 preceding siblings ...)
  2004-11-23 19:22 ` [Bug middle-end/17982] " pinskia at gcc dot gnu dot org
@ 2004-11-23 21:13 ` hjl at lucon dot org
  2004-11-23 22:20 ` zack at codesourcery dot com
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-23 21:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-23 21:13 -------
Does this patch

--- gcc/c-pragma.c.rename       2004-11-09 12:03:42.000000000 -0800
+++ gcc/c-pragma.c      2004-11-23 13:03:26.020304351 -0800
@@ -473,8 +473,11 @@ maybe_apply_renaming_pragma (tree decl,
     return asmname;

   /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
-     but we may warn about a rename that conflicts.  */
-  if (DECL_ASSEMBLER_NAME_SET_P (decl))
+     but we may warn about a rename that conflicts.
+     FIXME: the DECL_ASSEMBLER_NAME can be set to DECL_NAME (decl)
+     without renaming pragma nor asm declaration involved.  */
+  if (DECL_ASSEMBLER_NAME_SET_P (decl)
+      && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
     {
       const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
       oldname = targetm.strip_name_encoding (oldname);

make any senses? At least, it works with my testcases. -O0 and -O1 still
complain with

[hjl@gnu-4 gcc]$ ./xgcc -B./ -c x.i
x.i:8: warning: foo renamed after being referenced in assembly
[hjl@gnu-4 gcc]$

It may be OK since foo has been referenced in assembly. But I am not sure
about languanges other than C.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (10 preceding siblings ...)
  2004-11-23 21:13 ` hjl at lucon dot org
@ 2004-11-23 22:20 ` zack at codesourcery dot com
  2004-11-23 23:42 ` hjl at lucon dot org
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-11-23 22:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-11-23 22:19 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename

"hjl at lucon dot org" <gcc-bugzilla@gcc.gnu.org> writes:

> ------- Additional Comments From hjl at lucon dot org  2004-11-23 21:13 -------
> Does this patch
>
> --- gcc/c-pragma.c.rename       2004-11-09 12:03:42.000000000 -0800
> +++ gcc/c-pragma.c      2004-11-23 13:03:26.020304351 -0800
> @@ -473,8 +473,11 @@ maybe_apply_renaming_pragma (tree decl,
>      return asmname;
>
>    /* If the DECL_ASSEMBLER_NAME is already set, it does not change,
> -     but we may warn about a rename that conflicts.  */
> -  if (DECL_ASSEMBLER_NAME_SET_P (decl))
> +     but we may warn about a rename that conflicts.
> +     FIXME: the DECL_ASSEMBLER_NAME can be set to DECL_NAME (decl)
> +     without renaming pragma nor asm declaration involved.  */

This will not work.  At this point ia64 has already emitted an
external-reference directive for the old name into the assembly
stream.

The necessary fix is to prevent assemble_external from ever being
called before EOF.

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (11 preceding siblings ...)
  2004-11-23 22:20 ` zack at codesourcery dot com
@ 2004-11-23 23:42 ` hjl at lucon dot org
  2004-11-24  2:01 ` hjl at lucon dot org
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-23 23:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-23 23:42 -------
I have verified that my modification works on Linux/ia64, Linux/ia32 and
Linux/x86_64. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (12 preceding siblings ...)
  2004-11-23 23:42 ` hjl at lucon dot org
@ 2004-11-24  2:01 ` hjl at lucon dot org
  2004-11-27  0:30 ` neroden at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-24  2:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-24 02:01 -------
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01956.html

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (13 preceding siblings ...)
  2004-11-24  2:01 ` hjl at lucon dot org
@ 2004-11-27  0:30 ` neroden at gcc dot gnu dot org
  2004-11-27 20:25 ` zack at codesourcery dot com
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: neroden at gcc dot gnu dot org @ 2004-11-27  0:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From neroden at gcc dot gnu dot org  2004-11-27 00:30 -------
HJ's latest patch probably doesn't fix the problem entirely :-(, but it is 
certainly correct to allow "renames" which don't change anything. 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (14 preceding siblings ...)
  2004-11-27  0:30 ` neroden at gcc dot gnu dot org
@ 2004-11-27 20:25 ` zack at codesourcery dot com
  2004-11-27 20:45 ` hjl at lucon dot org
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-11-27 20:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-11-27 20:25 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename


That's not what HJ's patch does, though.

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (15 preceding siblings ...)
  2004-11-27 20:25 ` zack at codesourcery dot com
@ 2004-11-27 20:45 ` hjl at lucon dot org
  2004-11-28 20:16 ` zack at codesourcery dot com
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-27 20:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-27 20:44 -------
DECL_ASSEMBLER_NAME_SET_P alone is not very reliable to check if a symbol
has been renamed or not. There are

/* The name of the object as the assembler will see it (but before any
   translations made by ASM_OUTPUT_LABELREF).  Often this is the same
   as DECL_NAME.  It is an IDENTIFIER_NODE.  */
#define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)

/* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set.  If zero, 
  the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
   yet.  */ #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
  (DECL_CHECK (NODE)->decl.assembler_name != NULL_TREE)

and

/* The name of the object as the assembler will see it (but before any
   translations made by ASM_OUTPUT_LABELREF).  Often this is the same
   as DECL_NAME.  It is an IDENTIFIER_NODE.  */
tree
decl_assembler_name (tree decl)
{
  if (!DECL_ASSEMBLER_NAME_SET_P (decl))
    lang_hooks.set_decl_assembler_name (decl);
  return DECL_CHECK (decl)->decl.assembler_name;
}

Simply calling DECL_ASSEMBLER_NAME will make DECL_ASSEMBLER_NAME_SET_P to
return TRUE.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (16 preceding siblings ...)
  2004-11-27 20:45 ` hjl at lucon dot org
@ 2004-11-28 20:16 ` zack at codesourcery dot com
  2004-11-28 22:48 ` schwab at suse dot de
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-11-28 20:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-11-28 20:16 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename


You continue not to get it.

In this context, DECL_ASSEMBLER_NAME has been set because
assemble_external has been called on the symbol.  assemble_external is
*not* a no-op on ia64.  It emits a directive to the assembly output,
using the name of the symbol.  It is *not* safe to rename the symbol
after that has happened.  That you are not seeing a problem on
ia64-linux is either because GAS isn't as picky as the reference
assembler, or because your test case is not stringent enough.

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (17 preceding siblings ...)
  2004-11-28 20:16 ` zack at codesourcery dot com
@ 2004-11-28 22:48 ` schwab at suse dot de
  2004-11-29 16:38 ` zack at codesourcery dot com
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: schwab at suse dot de @ 2004-11-28 22:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-11-28 22:47 -------
But the call to assemble_external has been there since the very beginning. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (18 preceding siblings ...)
  2004-11-28 22:48 ` schwab at suse dot de
@ 2004-11-29 16:38 ` zack at codesourcery dot com
  2004-11-29 17:07 ` schwab at suse dot de
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-11-29 16:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-11-29 16:38 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename


... so this has always been broken, is that what you're saying?

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (19 preceding siblings ...)
  2004-11-29 16:38 ` zack at codesourcery dot com
@ 2004-11-29 17:07 ` schwab at suse dot de
  2004-11-29 17:15 ` zack at codesourcery dot com
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: schwab at suse dot de @ 2004-11-29 17:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2004-11-29 17:07 -------
Before your change it hasn't been a problem, apparently.  But if you think it 
was wrong to begin with then please try to fix it. 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (20 preceding siblings ...)
  2004-11-29 17:07 ` schwab at suse dot de
@ 2004-11-29 17:15 ` zack at codesourcery dot com
  2004-11-29 18:47 ` hjl at lucon dot org
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at codesourcery dot com @ 2004-11-29 17:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at codesourcery dot com  2004-11-29 17:15 -------
Subject: Re:  [4.0 regression] asm declaration ignored due to conflict with previous rename


I'm hoping to have some time to work on this this week, but no
promises.

zw


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (21 preceding siblings ...)
  2004-11-29 17:15 ` zack at codesourcery dot com
@ 2004-11-29 18:47 ` hjl at lucon dot org
  2004-12-08 19:13 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: hjl at lucon dot org @ 2004-11-29 18:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hjl at lucon dot org  2004-11-29 18:47 -------
There are only 2 assemblers supported on ia64, GNU assembler and Intel
assembler. If GNU assembler is used, assemble_external is a no-op on Linux.
On HPUX, the actual undefined symbol references are outputed at the very
end. This patch

http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02511.html

will make Linux + Intel assembler to do the same. So, on ia64, it should be
OK to rename a symbol even after assemble_external is called as long as
it hasn't been actually used, in which case, you should get

x.i:8: warning: foo renamed after being referenced in assembly

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (22 preceding siblings ...)
  2004-11-29 18:47 ` hjl at lucon dot org
@ 2004-12-08 19:13 ` cvs-commit at gcc dot gnu dot org
  2004-12-08 20:01 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-08 19:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-08 19:13 -------
Subject: Bug 17982

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	zack@gcc.gnu.org	2004-12-08 19:13:36

Modified files:
	gcc            : ChangeLog cgraphunit.c tree.h varasm.c 
	gcc/config/h8300: h8300.h 

Log message:
	PR 17982
	* varasm.c (pending_assemble_externals): New static.
	(assemble_external_real): Meat of assemble_external split out
	to this new function.
	(process_pending_assemble_externals): New function.
	(assemble_external): Use gcc_assert.  If flag_unit_at_a_time
	is true and the basic test passes, merely cons the decl onto
	the pending list to be handled later.
	* tree.h: Declare process_pending_assemble_externals.
	* cgraphunit.c (cgraph_optimize): Call it.
	
	* config/h8300/h8300.h: Do not define ASM_OUTPUT_EXTERNAL.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6750&r2=2.6751
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cgraphunit.c.diff?cvsroot=gcc&r1=1.90&r2=1.91
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.664&r2=1.665
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.466&r2=1.467
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/h8300/h8300.h.diff?cvsroot=gcc&r1=1.179&r2=1.180



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] [4.0 regression] asm declaration ignored due to conflict with previous rename
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (23 preceding siblings ...)
  2004-12-08 19:13 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-08 20:01 ` pinskia at gcc dot gnu dot org
  2004-12-08 22:04 ` [Bug middle-end/17982] stop calling assemble_external before final assembly output time zack at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-08 20:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-08 20:00 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] stop calling assemble_external before final assembly output time
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (24 preceding siblings ...)
  2004-12-08 20:01 ` pinskia at gcc dot gnu dot org
@ 2004-12-08 22:04 ` zack at gcc dot gnu dot org
  2004-12-08 22:05 ` zack at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-12-08 22:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-12-08 22:04 -------
Uh, no, it's not fixed.  It is, however, papered over adequately for 4.0.  I'm
turning this into a 4.1 enhancement PR.

http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00491.html explains what needs to
happen for 4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|18632                       |
              nThis|                            |
           Severity|critical                    |enhancement
             Status|RESOLVED                    |REOPENED
           Keywords|patch, wrong-code           |
         Resolution|FIXED                       |
            Summary|[4.0 regression] asm        |stop calling
                   |declaration ignored due to  |assemble_external before
                   |conflict with previous      |final assembly output time
                   |rename                      |
   Target Milestone|4.0.0                       |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] stop calling assemble_external before final assembly output time
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (25 preceding siblings ...)
  2004-12-08 22:04 ` [Bug middle-end/17982] stop calling assemble_external before final assembly output time zack at gcc dot gnu dot org
@ 2004-12-08 22:05 ` zack at gcc dot gnu dot org
  2005-04-05  1:54 ` pinskia at gcc dot gnu dot org
  2005-07-05  2:10 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-12-08 22:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-12-08 22:05 -------
... and assigning to self.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |zack at gcc dot gnu dot org
                   |dot org                     |
             Status|REOPENED                    |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] stop calling assemble_external before final assembly output time
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (26 preceding siblings ...)
  2004-12-08 22:05 ` zack at gcc dot gnu dot org
@ 2005-04-05  1:54 ` pinskia at gcc dot gnu dot org
  2005-07-05  2:10 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-05  1:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |---


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

* [Bug middle-end/17982] stop calling assemble_external before final assembly output time
  2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
                   ` (27 preceding siblings ...)
  2005-04-05  1:54 ` pinskia at gcc dot gnu dot org
@ 2005-07-05  2:10 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-05  2:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-05 02:10 -------
Unassigning from Zack since he is gone now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|zack at codesourcery dot com|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17982


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2005-07-05  2:10 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-13 22:05 [Bug target/17982] New: [4.0 regression] asm declaration ignored due to conflict with previous rename schwab at suse dot de
2004-10-13 23:03 ` [Bug target/17982] " pinskia at gcc dot gnu dot org
2004-10-13 23:04 ` pinskia at gcc dot gnu dot org
2004-10-13 23:18 ` pinskia at gcc dot gnu dot org
2004-10-13 23:22 ` pinskia at gcc dot gnu dot org
2004-10-13 23:29 ` zack at codesourcery dot com
2004-10-13 23:49 ` pinskia at gcc dot gnu dot org
2004-11-09 15:47 ` schwab at suse dot de
2004-11-23 19:13 ` hjl at lucon dot org
2004-11-23 19:18 ` hjl at lucon dot org
2004-11-23 19:22 ` [Bug middle-end/17982] " pinskia at gcc dot gnu dot org
2004-11-23 21:13 ` hjl at lucon dot org
2004-11-23 22:20 ` zack at codesourcery dot com
2004-11-23 23:42 ` hjl at lucon dot org
2004-11-24  2:01 ` hjl at lucon dot org
2004-11-27  0:30 ` neroden at gcc dot gnu dot org
2004-11-27 20:25 ` zack at codesourcery dot com
2004-11-27 20:45 ` hjl at lucon dot org
2004-11-28 20:16 ` zack at codesourcery dot com
2004-11-28 22:48 ` schwab at suse dot de
2004-11-29 16:38 ` zack at codesourcery dot com
2004-11-29 17:07 ` schwab at suse dot de
2004-11-29 17:15 ` zack at codesourcery dot com
2004-11-29 18:47 ` hjl at lucon dot org
2004-12-08 19:13 ` cvs-commit at gcc dot gnu dot org
2004-12-08 20:01 ` pinskia at gcc dot gnu dot org
2004-12-08 22:04 ` [Bug middle-end/17982] stop calling assemble_external before final assembly output time zack at gcc dot gnu dot org
2004-12-08 22:05 ` zack at gcc dot gnu dot org
2005-04-05  1:54 ` pinskia at gcc dot gnu dot org
2005-07-05  2:10 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).