This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL)
- From: "dalej at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2004 00:57:56 -0000
- Subject: [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following small program crashes as shown. This is 64-bit specific, and Darwin 64-bit is
not really all there yet, as you will see if you apply the suggested patch: another Darwin-specific
bug is lurking behind. However this bug is not Darwin specific, and can probably be seen
on other PPC64 OSs. The problem is that the doloop optimizer is creating shared RTL (the
path to the crash is convoluted; I can explain if necessary.) The patch at bottom works, but
I don't know if this is really the best place to fix it.
gcc -Os -m64 3811724.c
3811724.c: In function 'acl_create_entry_np':
3811724.c:23: internal compiler error: in schedule_insns, at sched-rgn.c:2708
Please submit a full bug report,
struct _acl {
unsigned int a_entries;
int a_ace[128];
};
extern int * __error(void);
int acl_create_entry_np(struct _acl **acl_p, int *dummy, int index)
{
struct _acl *ap = *acl_p;
int i;
if (ap->a_entries >= 128) {
(*__error()) = 12;
return(-1);
}
for (i = ap->a_entries; i > index; i--)
ap->a_ace[i] = ap->a_ace[i - 1];
return(0);
}
Index: loop-doloop.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/loop-doloop.c,v
retrieving revision 2.7
diff -u -d -b -w -p -r2.7 loop-doloop.c
--- loop-doloop.c 10 Sep 2004 11:02:24 -0000 2.7
+++ loop-doloop.c 23 Sep 2004 00:53:43 -0000
@@ -333,7 +333,7 @@ doloop_modify (struct loop *loop, struct
}
if (increment_count)
- count = simplify_gen_binary (PLUS, desc->mode, count, const1_rtx);
+ count = simplify_gen_binary (PLUS, desc->mode, copy_rtx (count), const1_rtx);
/* Insert initialization of the count register into the loop header. */
start_sequence ();
@@ -345,7 +345,7 @@ doloop_modify (struct loop *loop, struct
if (desc->noloop_assumptions)
{
- rtx ass = desc->noloop_assumptions;
+ rtx ass = copy_rtx (desc->noloop_assumptions);
basic_block preheader = loop_preheader_edge (loop)->src;
basic_block set_zero
= loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX);
--
Summary: ICE on legal (doloop creates shared RTL)
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dalej at apple dot com
CC: gcc-bugs at gcc dot gnu dot org,rakdver at atrey dot
karlin dot mff dot cuni dot cz
GCC build triplet: powerpc-apple-darwin7.3.0
GCC host triplet: powerpc-darwin-darwin7.3.0
GCC target triplet: powerpc-apple-darwin7.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17625