public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix ICE in simplify_immed_subreg on SPU
Date: Sun, 15 Jun 2008 15:53:00 -0000	[thread overview]
Message-ID: <200806151546.m5FFksow018979@d12av02.megacenter.de.ibm.com> (raw)

Hello,

the test cases for PR 34856 ICE on SPU because simplify_subreg is 
called on a CONST_VECTOR RTX of the form:

(const_vector:V4SI [
        (const:SI (plus:SI (symbol_ref:SI ("g") [flags 0x40] <var_decl 0xf70b05a0 g>)
                (const_int 32 [0x20])))
        (const_int 0 [0x0])
        (const_int 0 [0x0])
        (const_int 0 [0x0])
    ])

and everything but CONST_INT, CONST_DOUBLE or CONST_FIXED within
a CONST_VECTOR leads to an ICE in simplify_immed_subreg.

It seems to me that having an address constant like the above appear
within a CONST_VECTOR should be OK -- it just cannot be simplified
by simplify_immed_subreg so that function should return NULL_RTX.

The patch below implements this.  Tested on spu-elf with no regressions,
fixing the following test suite FAILs:

FAIL: gcc.c-torture/compile/pr34856.c  -O2  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer -funroll-loops  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer -funroll-loops  (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -g  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/pr34856.c  -Os  (internal compiler error)
FAIL: gcc.c-torture/compile/pr34856.c  -Os  (test for excess errors)
FAIL: gcc.dg/pr34856.c (internal compiler error)
FAIL: gcc.dg/pr34856.c (test for excess errors)


OK for mainline and 4.3 branch?

Bye,
Ulrich


ChangeLog:

	* simplify-rtx.c (simplify_immed_subreg): Do not ICE when seeing
	a CONST_VECTOR with an address constant as element.


Index: gcc/simplify-rtx.c
===================================================================
*** gcc/simplify-rtx.c	(revision 136680)
--- gcc/simplify-rtx.c	(working copy)
*************** simplify_immed_subreg (enum machine_mode
*** 4792,4798 ****
  		*vp++ = 0;
  	    }
            break;
! 	  
  	default:
  	  gcc_unreachable ();
  	}
--- 4792,4804 ----
  		*vp++ = 0;
  	    }
            break;
! 
! 	case CONST:
! 	case SYMBOL_REF:
! 	case LABEL_REF:
! 	  /* We cannot decompose an address constant.  */
! 	  return NULL_RTX;
! 
  	default:
  	  gcc_unreachable ();
  	}
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com

             reply	other threads:[~2008-06-15 15:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-15 15:53 Ulrich Weigand [this message]
2008-06-15 17:27 ` Eric Botcazou
2008-06-15 17:43   ` Ulrich Weigand
2008-06-15 22:24     ` Eric Botcazou
2008-06-15 22:25     ` Ian Lance Taylor
2008-06-15 22:45       ` Eric Botcazou
2008-06-15 22:49         ` Andrew Pinski
2008-06-26 22:15         ` [PATCH, v2] " Ulrich Weigand
2008-06-26 23:14           ` trevor_smigiel
2008-06-27  7:05           ` Eric Botcazou
2008-06-28 17:53             ` Ulrich Weigand
2008-06-30  8:27               ` Eric Botcazou

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=200806151546.m5FFksow018979@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gcc-patches@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).