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.


-- 
           Summary: [4.0/4.1/4.2 Regression] Unfounded warnings from the AVR
                    backend
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: berndtrog at yahoo dot com
GCC target triplet: avr


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

Reply via email to