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] Correct thinko (DECL_RTL to DECL_RTL_SET_P) in function.c


I propose the following patch. It is needed to build GNU Pascal,
otherwise GPC is unable to compile its runtime (the patch is
contained in the current release of GPC).

In original code the intent clearily was to test if RTL for 
`decl' is set, but DECL_RTL macro generates RTL if no is present
already. 

ChangeLog:
        * (function.c) use DECL_RTL_SET_P (insted of DECL_RTL) in checks

diff -ru gcc-3.3.2.orig/gcc/function.c gcc-3.3.2/gcc/function.c
--- gcc-3.3.2.orig/gcc/function.c	Sat Oct 11 23:01:36 2003
+++ gcc-3.3.2/gcc/function.c	Tue Nov  4 19:49:07 2003
@@ -5512,7 +5512,7 @@
 	     flow.c that the entire aggregate was initialized.
 	     Unions are troublesome because members may be shorter.  */
 	  && ! AGGREGATE_TYPE_P (TREE_TYPE (decl))
-	  && DECL_RTL (decl) != 0
+	  && DECL_RTL_SET_P (decl)
 	  && GET_CODE (DECL_RTL (decl)) == REG
 	  /* Global optimizations can make it difficult to determine if a
 	     particular variable has been initialized.  However, a VAR_DECL
@@ -5527,7 +5527,7 @@
 			   "`%s' might be used uninitialized in this function");
       if (extra_warnings
 	  && TREE_CODE (decl) == VAR_DECL
-	  && DECL_RTL (decl) != 0
+	  && DECL_RTL_SET_P (decl)
 	  && GET_CODE (DECL_RTL (decl)) == REG
 	  && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
 	warning_with_decl (decl,

-- 
                              Waldek Hebisch
hebisch@math.uni.wroc.pl 




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