This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/20117] New: [4.0.0 Regression] duplicated labels in PIC
- From: "kkojima at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2005 02:21:52 -0000
- Subject: [Bug target/20117] New: [4.0.0 Regression] duplicated labels in PIC
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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