public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL)
@ 2004-09-23  0:57 dalej at apple dot com
  2004-09-23  1:11 ` [Bug rtl-optimization/17625] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dalej at apple dot com @ 2004-09-23  0:57 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2004-09-24 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-23  0:57 [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL) dalej at apple dot com
2004-09-23  1:11 ` [Bug rtl-optimization/17625] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-09-23 10:39 ` rakdver at gcc dot gnu dot org
2004-09-24  8:29 ` rakdver at gcc dot gnu dot org
2004-09-24 14:36 ` cvs-commit at gcc dot gnu dot org
2004-09-24 14:52 ` pinskia at gcc dot gnu dot org
2004-09-24 17:06 ` cvs-commit 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).