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]

Re: C PATCH to fix c/79758 (ICE-on-invalid with function redefinition and old style decls)


On 03/02/2017 06:35 PM, Marek Polacek wrote:
While at it, I fixed wrong formatting in the nearby code.  Also use NULL_TREE
instead of 0 where appropriate.  I really dislike those zeros-as-trees; one
day I'll just go and turn them into NULL_TREEs.

I sympathize, but it makes it harder to see which parts of the patch are actual changes. Generally it's best to separate functional and formatting changes.

@@ -8996,7 +8999,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
 	     declared for the arg.  ISO C says we take the unqualified
 	     type for parameters declared with qualified type.  */
 	  if (TREE_TYPE (parm) != error_mark_node
-	      && TREE_TYPE (type) != error_mark_node
+	      && TREE_TYPE (TREE_VALUE (type)) != error_mark_node
 	      && ((TYPE_ATOMIC (DECL_ARG_TYPE (parm))
 		   != TYPE_ATOMIC (TREE_VALUE (type)))
 		  || !comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),

Isn't this most likely intended to be TREE_VALUE (type) != error_mark_node?

@@ -9017,7 +9020,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
 		  if (targetm.calls.promote_prototypes (TREE_TYPE (current_function_decl))
 		      && INTEGRAL_TYPE_P (TREE_TYPE (parm))
 		      && TYPE_PRECISION (TREE_TYPE (parm))
-		      < TYPE_PRECISION (integer_type_node))
+			 < TYPE_PRECISION (integer_type_node))

Should add the necessary parens while fixing formatting.


Bernd


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