This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13414] New: insn setting global register is deleted in istribute_notes()
- From: "zlomek at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Dec 2003 17:16:36 -0000
- Subject: [Bug optimization/13414] New: insn setting global register is deleted in istribute_notes()
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When compiling attached testcase with "-O2 -fpic" on s390 (or crosscompiler for
s390) the insn storing to the global register r9 is deleted in block containing
the call to fehler().
It is deleted in combine.c:distribute_notes() when trying to combine insn 39 and
41 (see dump files) because insn 36 (setting the global reg) is in log link of
insn 41 and r9 has REG_DEAD note on it.
This fails in current 3.3 branch. Although mainline does not produce wrong code
for this testcase the bug does not seem to be fixed there, it is only fixed by
accident.
/* ./cc1 -O2 -fPIC s.c */
typedef void *object;
register object *STACK __asm__ ("9");
extern object subr_self;
extern void __attribute__ ((__noreturn__)) fehler ();
extern void f();
void
foo (void)
{
extern unsigned long n;
STACK[0] = subr_self;
STACK -= -1;
f();
STACK -= 1;
subr_self = STACK[0];
if (n < 1)
{
STACK[0] = subr_self;
STACK -= -1;
fehler ();
}
}
--
Summary: insn setting global register is deleted in
istribute_notes()
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Keywords: wrong-code, ice-on-valid-code, ice-checking
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: zlomek at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: s390-ibm-linux
GCC host triplet: s390-ibm-linux
GCC target triplet: s390-ibm-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13414