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]

Fix for PR fortran 10986.


Bud Davis pointed this one out to me. The attached patch has been bootstrapped (C and Fortran only) and make -k check'd.

Thanks, Bud !

--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc-g95.sourceforge.net/ (under construction)
2003-06-01  Bud Davis  <bdavis9659@comcast.net>

	* ste.c (ffeste_R838): Handle ERROR_MARK.
	(ffeste_R839): Ditto.

Index: gcc/gcc/f/ste.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/f/ste.c,v
retrieving revision 1.36
diff -c -3 -p -r1.36 ste.c
*** gcc/gcc/f/ste.c	3 May 2003 16:39:50 -0000	1.36
--- gcc/gcc/f/ste.c	27 May 2003 01:28:15 -0000
*************** ffeste_R838 (ffelab label, ffebld target
*** 2950,2965 ****
        TREE_CONSTANT (label_tree) = 1;
  
        target_tree = ffecom_expr_assign_w (target);
!       if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (target_tree)))
! 	  < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (label_tree))))
! 	error ("ASSIGN to variable that is too small");
  
!       label_tree = convert (TREE_TYPE (target_tree), label_tree);
  
!       expr_tree = ffecom_modify (void_type_node,
  				 target_tree,
  				 label_tree);
!       expand_expr_stmt (expr_tree);
      }
  }
  
--- 2950,2968 ----
        TREE_CONSTANT (label_tree) = 1;
  
        target_tree = ffecom_expr_assign_w (target);
!       if (TREE_CODE (target_tree) != ERROR_MARK)
!       {
!         if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (target_tree)))
!             < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (label_tree))))
! 	  error ("ASSIGN to variable that is too small");
  
!         label_tree = convert (TREE_TYPE (target_tree), label_tree);
  
!         expr_tree = ffecom_modify (void_type_node,
  				 target_tree,
  				 label_tree);
!         expand_expr_stmt (expr_tree);
!       }
      }
  }
  
*************** ffeste_R839 (ffebld target)
*** 2978,2988 ****
       seen here should never require use of temporaries.  */
  
    t = ffecom_expr_assign (target);
-   if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))
-       < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (null_pointer_node))))
-     error ("ASSIGNed GOTO target variable is too small");
  
!   expand_computed_goto (convert (TREE_TYPE (null_pointer_node), t));
  }
  
  /* Arithmetic IF statement.  */
--- 2981,2995 ----
       seen here should never require use of temporaries.  */
  
    t = ffecom_expr_assign (target);
  
!   if (TREE_CODE (t) != ERROR_MARK)
!   {
!        if (GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (t)))
!          < GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (null_pointer_node))))
!        error ("ASSIGNed GOTO target variable is too small");
! 
!        expand_computed_goto (convert (TREE_TYPE (null_pointer_node), t));
!   }
  }
  
  /* Arithmetic IF statement.  */

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