This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/7928: Regression: spurious external references generated with switch statement


>Number:         7928
>Category:       c
>Synopsis:       Regression: spurious external references generated with switch statement
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 16 05:36:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kaveh Ghazi
>Release:        gcc version 3.3 20020915 (experimental)
>Organization:
>Environment:
sparc-sun-solaris2.7
>Description:
The attached file is a reduced testcase originally from insn-attrtab.c from today's gcc cross-targetted to frv-unknown-elf.  When I compile it on solaris2.7 with optimization turned on, I get three unexplained external references.  The end result was that cc1 wouldn't link for the frv cross-target but you can see them here with nm in the reduced file:

gcc -O -c insn-attrtab.c -o insn-attrtab.o
nm insn-attrtab.o


insn-attrtab.o:

[Index]   Value      Size    Type  Bind  Other Shndx   Name

[2]     |         0|       0|SECT |LOCL |0    |2      |
[4]     |         0|       0|NOTY |GLOB |0    |UNDEF  |.LL10
[5]     |         0|       0|NOTY |GLOB |0    |UNDEF  |.LL19
[6]     |         0|       0|NOTY |GLOB |0    |UNDEF  |.LL28
[1]     |         0|       0|FILE |LOCL |0    |ABS    |insn-attrtab.c
[3]     |         0|     220|FUNC |LOCL |0    |2      |internal_insn_latency


This is a REGRESSION from the previous release and only started happening recently, like within the last month or so.
>How-To-Repeat:
It might be target specific, I don't know.  So target to sparc-sun-solaris2.7 and compile the attached file with:

cc1 -fpreprocessed insn-attrtab.i -quiet -dumpbase insn-attrtab.c -auxbase-strip insn-attrtab.o -O -version -o insn-attrtab.s
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="insn-attrtab.i"
Content-Disposition: inline; filename="insn-attrtab.i"

# 1 "insn-attrtab.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "insn-attrtab.c"
static int internal_insn_latency (int, int);
static int
internal_insn_latency (insn_code, insn2_code)
        int insn_code;
        int insn2_code;
{
  switch (insn_code)
    {
    case 20:
      switch (insn2_code)
        {
        case 34:
          return 4;
        case 33:
          return 4;
        case 32:
          return 4;
        case 31:
          return 4;
        case 30:
          return 4;
        }
    case 21:
      switch (insn2_code)
        {
        case 34:
          return 4;
        case 33:
          return 4;
        case 32:
          return 4;
        case 31:
          return 4;
        case 30:
          return 4;
        }
    case 22:
      switch (insn2_code)
        {
        case 34:
          return 4;
        case 33:
          return 4;
        case 32:
          return 4;
        case 31:
          return 4;
        case 30:
          return 4;
        }
    case 25:
      switch (insn2_code)
        {
        case 34:
          return 4;
        case 33:
          return 4;
        case 32:
          return 4;
        case 31:
          return 4;
        case 30:
          return 4;
        }
    default:
      return 0;
    }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]