public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/20117] New: [4.0.0 Regression] duplicated labels in PIC
@ 2005-02-21 18:23 kkojima at gcc dot gnu dot org
  2005-02-21 18:45 ` [Bug target/20117] " kkojima at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2005-02-21 18:23 UTC (permalink / raw)
  To: gcc-bugs

4.0.0 generates duplicated labels on sh4-unknown-linux-gnu with -fPIC -O2
for the code below:

void bar (void);

int f(int i, int j)
{
  static void *a[5] = {&&b,&&c,&&d,&&e,&&f};

    if (i >=5) i = 0; if (i<=0)i=5;
    goto *a[i];
  e:
    i++;  if (i >=5) i = 0; if (i<=0)i=5;
    j++;
    goto *a[i];
  f:
    i--;  if (i >=5) i = 0; if (i<=0)i=5;
    j--;
    goto *a[i];
  b:
    i+=2;  if (i >=5) i = 0; if (i<=0)i=5;
    goto *a[i];
  c:
    i*=2;  if (i >=5) i = 0; if (i<=0)i=5;
    bar ();
    goto *a[i];
  d:;
}

which is a slightly modified testcase in PR 15242.  SH uses the unique
label for PIC call insn and it's noncopyable.  duplicate_computed_gotos
which was introduced to solve PR 15242 copies the block including call
insn for bar and produces duplicated labels.  I'm proposing a patch
http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00924.html to avoid this.

-- 
           Summary: [4.0.0 Regression] duplicated labels in PIC
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gn
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh4-unknown-linux-gnu


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


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

end of thread, other threads:[~2005-02-25 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-21 18:23 [Bug target/20117] New: [4.0.0 Regression] duplicated labels in PIC kkojima at gcc dot gnu dot org
2005-02-21 18:45 ` [Bug target/20117] " kkojima at gcc dot gnu dot org
2005-02-22  0:48 ` [Bug rtl-optimization/20117] [4.0 " pinskia at gcc dot gnu dot org
2005-02-25 16:20 ` cvs-commit at gcc dot gnu dot org
2005-02-25 17:04 ` 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).