This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR47975


Bah, whoever invented

#define TYPE_MODE(NODE) \
  (TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \
   ? vector_type_mode (NODE) : (NODE)->type.mode)

needs to be clue-batted (yes, I know your name!!! ;))

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

Richard.

2011-03-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/47975
	* optabs.c (optab_for_tree_code): Do not use VECTOR_MODE_P.

	* gcc.dg/torture/pr47975.c: New testcase.

Index: gcc/optabs.c
===================================================================
*** gcc/optabs.c	(revision 170649)
--- gcc/optabs.c	(working copy)
*************** optab_for_tree_code (enum tree_code code
*** 303,309 ****
        return TYPE_UNSIGNED (type) ? udiv_optab : sdiv_optab;
  
      case LSHIFT_EXPR:
!       if (VECTOR_MODE_P (TYPE_MODE (type)))
  	{
  	  if (subtype == optab_vector)
  	    return TYPE_SATURATING (type) ? NULL : vashl_optab;
--- 303,309 ----
        return TYPE_UNSIGNED (type) ? udiv_optab : sdiv_optab;
  
      case LSHIFT_EXPR:
!       if (TREE_CODE (type) == VECTOR_TYPE)
  	{
  	  if (subtype == optab_vector)
  	    return TYPE_SATURATING (type) ? NULL : vashl_optab;
*************** optab_for_tree_code (enum tree_code code
*** 315,321 ****
        return ashl_optab;
  
      case RSHIFT_EXPR:
!       if (VECTOR_MODE_P (TYPE_MODE (type)))
  	{
  	  if (subtype == optab_vector)
  	    return TYPE_UNSIGNED (type) ? vlshr_optab : vashr_optab;
--- 315,321 ----
        return ashl_optab;
  
      case RSHIFT_EXPR:
!       if (TREE_CODE (type) == VECTOR_TYPE)
  	{
  	  if (subtype == optab_vector)
  	    return TYPE_UNSIGNED (type) ? vlshr_optab : vashr_optab;
*************** optab_for_tree_code (enum tree_code code
*** 325,331 ****
        return TYPE_UNSIGNED (type) ? lshr_optab : ashr_optab;
  
      case LROTATE_EXPR:
!       if (VECTOR_MODE_P (TYPE_MODE (type)))
  	{
  	  if (subtype == optab_vector)
  	    return vrotl_optab;
--- 325,331 ----
        return TYPE_UNSIGNED (type) ? lshr_optab : ashr_optab;
  
      case LROTATE_EXPR:
!       if (TREE_CODE (type) == VECTOR_TYPE)
  	{
  	  if (subtype == optab_vector)
  	    return vrotl_optab;
*************** optab_for_tree_code (enum tree_code code
*** 335,341 ****
        return rotl_optab;
  
      case RROTATE_EXPR:
!       if (VECTOR_MODE_P (TYPE_MODE (type)))
  	{
  	  if (subtype == optab_vector)
  	    return vrotr_optab;
--- 335,341 ----
        return rotl_optab;
  
      case RROTATE_EXPR:
!       if (TREE_CODE (type) == VECTOR_TYPE)
  	{
  	  if (subtype == optab_vector)
  	    return vrotr_optab;
Index: gcc/testsuite/gcc.dg/torture/pr47975.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr47975.c	(revision 0)
--- gcc/testsuite/gcc.dg/torture/pr47975.c	(revision 0)
***************
*** 0 ****
--- 1,9 ----
+ /* { dg-do compile } */
+ 
+ int __attribute__ ((vector_size (32))) x;
+ 
+ void
+ foo (void)
+ {
+   x <<= x;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]