Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 25448
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: berndtrog@yahoo.com
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
avr.c.patch proposed patch patch 2005-12-16 17:13 229 bytes Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 25448 depends on: Show dependency tree
Show dependency graph
Bug 25448 blocks: 34299

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2005-12-25 01:20 Opened: 2005-12-16 17:11
Hello,

when compiling this code:

   procedure My_int;
   pragma Machine_Attribute (My_int, "signal");
   pragma Export (C, My_int, "__vector_1");
   procedure My_int is begin null; end;

with avr-gcc-4.x I get this warning:

demo_ada.adb:9: warning: `demo_ada__my_int' appears to be a misspelled
signal handler

I do not get this warning with gcc-3.4.x.

IMO, this is caused by the misspelled-signames patch
from Theodore A. Roth:

avr.c:
[...]
{
 const char *func_name = IDENTIFIER_POINTER (DECL_NAME (*node));
 const char *attr = IDENTIFIER_POINTER (name);

 /* If the function has the 'signal' or 'interrupt' attribute, test to
    make sure that the name of the function is "__vector_NN" so as to
    catch when the user misspells the interrupt vector name.  */

 if (strncmp (attr, "interrupt", strlen ("interrupt")) == 0)
   {
   if (strncmp (func_name, "__vector", strlen ("__vector")) != 0)
     {
      warning (0, "%qs appears to be a misspelled interrupt handler",
               func_name);
[...]

Ted's patch is a bit too C specific, because it assumes that the source
code function name is equal the symbol name. 
(__vector_1 = __vector_1)

In Ada, the source code function name (demo_ada__my_int) for interrupts is
translated to__vector_xx with the "Pragma Export (..)" statement.
Its not possible to define "__vector_1" as a source code function name.

------- Comment #1 From berndtrog@yahoo.com 2005-12-16 17:13 -------
Created an attachment (id=10516) [edit]
proposed patch

patch to replace DECL_NAME by DECL_ASSEMBLER_NAME

------- Comment #2 From Andrew Pinski 2005-12-25 01:20 -------
Confirmed, it also can be reproduced with normal C and using asm on the
function to change what the assembly name is.

------- Comment #3 From Gabriel Dos Reis 2007-02-03 16:09 -------
Won't fix in GCC-4.0.x.  Adjusting milestone.

------- Comment #4 From aesok@gcc.gnu.org 2007-04-05 16:43 -------
Subject: Bug 25448

Author: aesok
Date: Thu Apr  5 16:43:35 2007
New Revision: 123519

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123519
Log:
        PR target/25448
        * config/avr/avr.c (avr_handle_fndecl_attribute): Use the 
        DECL_ASSEMBLER_NAME, not the DECL_NAME.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c

------- Comment #5 From aesok@gcc.gnu.org 2007-04-05 16:50 -------
Subject: Bug 25448

Author: aesok
Date: Thu Apr  5 16:50:27 2007
New Revision: 123520

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123520
Log:
        PR target/25448
        * config/avr/avr.c (avr_handle_fndecl_attribute): Use the 
        DECL_ASSEMBLER_NAME, not the DECL_NAME.

Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/config/avr/avr.c

------- Comment #6 From aesok@gcc.gnu.org 2007-04-05 16:56 -------
Subject: Bug 25448

Author: aesok
Date: Thu Apr  5 16:56:43 2007
New Revision: 123521

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123521
Log:
        PR target/25448
        * config/avr/avr.c (avr_handle_fndecl_attribute): Use the 
        DECL_ASSEMBLER_NAME, not the DECL_NAME.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/avr/avr.c

------- Comment #7 From aesok@gcc.gnu.org 2007-04-05 16:59 -------
Fixsed in 4.1.3, 4.2 and 4.3.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug