public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aoliva at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/13819] [3.5 Regression] sh-elf broken; abort in sh_reorg()
Date: Fri, 23 Jan 2004 15:29:00 -0000	[thread overview]
Message-ID: <20040123152907.26390.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040122205844.13819.tm@kloo.net>


------- Additional Comments From aoliva at redhat dot com  2004-01-23 15:28 -------
Subject: Re:  New: sh-elf broken; abort in sh_reorg()

On Jan 22, 2004, "tm at kloo dot net" <gcc-bugzilla@gcc.gnu.org> wrote:

> ../../gcc/gcc/libgcc2.c: In function `__fixunsdfdi':
> ../../gcc/gcc/libgcc2.c:1200: internal compiler error: in sh_reorg, at
> config/sh/sh.c:4100

> The SH build invokes this abort:

>                       if (GET_CODE (clobber) != CLOBBER
>                           || ! rtx_equal_p (XEXP (clobber, 0), r0_rtx))
>                         abort ();

That's because the CLOBBER was shared with the insn this was copied
from, and when we adjusted one of them, we broke the other.  This was
introduced by:

2004-01-20  Jan Hubicka  <jh@suse.cz>

	* genemit.c [...]
	(copy_rtx): Do not copy clobbers containing hard regs.

This patch compensates for the change.  I'm checking it in.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR optimization/13819
	* config/sh/sh.c (sh_reorg): Compensate for sharing of CLOBBERs 
	introduced by 2004-01-20's Jan Hubicka's copy_insn change.
	(sh_handle_sp_switch_attribute): Remove warning.

Index: gcc/config/sh/sh.c
===================================================================
RCS file: /cvs/uberbaum/gcc/config/sh/sh.c,v
retrieving revision 1.249
diff -u -p -r1.249 sh.c
--- gcc/config/sh/sh.c 18 Jan 2004 22:37:29 -0000 1.249
+++ gcc/config/sh/sh.c 23 Jan 2004 15:24:07 -0000
@@ -4092,8 +4092,10 @@ sh_reorg (void)
 		  if (GET_CODE (dst) == REG && FP_ANY_REGISTER_P (REGNO (dst)))
 		    {
 		      /* This must be an insn that clobbers r0.  */
-		      rtx clobber = XVECEXP (PATTERN (scan), 0,
-					     XVECLEN (PATTERN (scan), 0) - 1);
+		      rtx *clobberp = &XVECEXP (PATTERN (scan), 0,
+						XVECLEN (PATTERN (scan), 0)
+						- 1);
+		      rtx clobber = *clobberp;
 
 		      if (GET_CODE (clobber) != CLOBBER
 			  || ! rtx_equal_p (XEXP (clobber, 0), r0_rtx))
@@ -4137,7 +4139,8 @@ sh_reorg (void)
 		      last_float_addr = &XEXP (newsrc, 0);
 
 		      /* Remove the clobber of r0.  */
-		      XEXP (clobber, 0) = gen_rtx_SCRATCH (Pmode);
+		      *clobberp = gen_rtx_CLOBBER (GET_MODE (clobber),
+						   gen_rtx_SCRATCH (Pmode));
 		      RTX_UNCHANGING_P (newsrc) = 1;
 		    }
 		  /* This is a mova needing a label.  Create it.  */
@@ -6775,7 +6778,7 @@ sh_handle_sp_switch_attribute (tree *nod
     }
   else
     {
-      char *s = ggc_strdup (TREE_STRING_POINTER (TREE_VALUE (args)));
+      const char *s = ggc_strdup (TREE_STRING_POINTER (TREE_VALUE (args)));
       sp_switch = gen_rtx_SYMBOL_REF (VOIDmode, s);
     }
 

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Happy GNU Year!                     oliva@{lsd.ic.unicamp.br, gnu.org}
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist                Professional serial bug killer


-- 


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


  parent reply	other threads:[~2004-01-23 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-22 20:58 [Bug optimization/13819] New: " tm at kloo dot net
2004-01-23  3:34 ` [Bug target/13819] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-01-23 15:28 ` [Bug optimization/13819] New: " Alexandre Oliva
2004-01-23 15:29 ` aoliva at redhat dot com [this message]
2004-01-23 15:31 ` [Bug target/13819] [3.5 Regression] " aoliva at gcc dot gnu dot org
2004-01-27 13:04 ` cvs-commit at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040123152907.26390.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).