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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  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 ` pinskia at gcc dot gnu dot org
  2004-09-23 10:39 ` rakdver at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-23  1:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-23 01:11 -------
Confirmed, I almost think this is a regression even though 64bit mode is new for 4.0.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-23 01:11:27
               date|                            |
            Summary|ICE on legal (doloop creates|[4.0 Regression] ICE on
                   |shared RTL)                 |legal (doloop creates shared
                   |                            |RTL)
   Target Milestone|---                         |4.0.0


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


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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-09-23 10:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-09-23 10:39 -------
The fix should be basically OK, except that it would be a bit safer to
unshare the count earlier; I am testing this patch.

Index: loop-doloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-doloop.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 loop-doloop.c
*** loop-doloop.c       10 Sep 2004 11:02:24 -0000      2.7
--- loop-doloop.c       23 Sep 2004 10:37:00 -0000
*************** doloop_modify (struct loop *loop, struct
*** 292,298 ****
    if (GET_CODE (counter_reg) == PLUS)
      counter_reg = XEXP (counter_reg, 0);

!   count = desc->niter_expr;
    increment_count = false;
    switch (GET_CODE (condition))
      {
--- 292,298 ----
    if (GET_CODE (counter_reg) == PLUS)
      counter_reg = XEXP (counter_reg, 0);

!   count = copy_rtx (desc->niter_expr);
    increment_count = false;
    switch (GET_CODE (condition))
      {
*************** doloop_modify (struct loop *loop, struct
*** 345,351 ****

    if (desc->noloop_assumptions)
      {
!       rtx ass = 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);
--- 345,351 ----

    if (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);


-- 


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


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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-09-24  8:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-09-24 08:29 -------
Patch:

http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02517.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  2004-09-23  0:57 [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL) dalej at apple dot com
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-24 14:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-24 14:36 -------
Subject: Bug 17625

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rakdver@gcc.gnu.org	2004-09-24 14:36:29

Modified files:
	gcc            : ChangeLog loop-doloop.c 

Log message:
	PR rtl-optimization/17625
	* loop-doloop.c (doloop_modify): Unshare rtl before emitting it.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5600&r2=2.5601
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-doloop.c.diff?cvsroot=gcc&r1=2.7&r2=2.8



-- 


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


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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  2004-09-23  0:57 [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL) dalej at apple dot com
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-24 14:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-24 14:52 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug rtl-optimization/17625] [4.0 Regression] ICE on legal (doloop creates shared RTL)
  2004-09-23  0:57 [Bug rtl-optimization/17625] New: ICE on legal (doloop creates shared RTL) dalej at apple dot com
                   ` (4 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-24 17:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-24 17:06 -------
Subject: Bug 17625

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	apple-ppc-branch
Changes by:	dalej@gcc.gnu.org	2004-09-24 17:06:36

Modified files:
	gcc            : ChangeLog.apple-ppc loop-doloop.c 

Log message:
	Radar 3811274 / PR 17625.  Roll in fix from FSF.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.apple-ppc.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=1.1.2.149&r2=1.1.2.150
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-doloop.c.diff?cvsroot=gcc&only_with_tag=apple-ppc-branch&r1=2.2.10.7&r2=2.2.10.8



-- 


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).