public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix ICE in simplify_immed_subreg on SPU
@ 2008-06-15 15:53 Ulrich Weigand
  2008-06-15 17:27 ` Eric Botcazou
  0 siblings, 1 reply; 12+ messages in thread
From: Ulrich Weigand @ 2008-06-15 15:53 UTC (permalink / raw)
  To: gcc-patches

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

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

end of thread, other threads:[~2008-06-30  7:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-15 15:53 [PATCH] Fix ICE in simplify_immed_subreg on SPU Ulrich Weigand
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

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