+2011-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47650
+ * tree-pretty-print.c (dump_function_declaration): Properly
+ dump unprototyped and varargs function types.
+
2011-03-15 Richard Guenther <rguenther@suse.de>
PR tree-optimization/13954
+2011-03-15 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47650
+ * gfortran.dg/c_f_pointer_tests_3.f90: Adjust.
+ * gfortran.dg/ishft_4.f90: Likewise.
+ * gfortran.dg/leadz_trailz_3.f90: Likewise.
+
2011-03-15 Richard Guenther <rguenther@suse.de>
PR tree-optimization/13954
! -- once in the function definition itself
! -- plus as many times as the function is called
!
-! { dg-final { scan-tree-dump-times "foo *\\\(\\\)" 5 "original" } }
-! { dg-final { scan-tree-dump-times "bar *\\\(\\\)" 5 "original" } }
+! { dg-final { scan-tree-dump-times "foo *\\\(\\\)" 6 "original" } }
+! { dg-final { scan-tree-dump-times "bar *\\\(\\\)" 6 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
pp_space (buffer);
pp_character (buffer, '(');
- /* Print the argument types. The last element in the list is a VOID_TYPE.
- The following avoids printing the last element. */
+ /* Print the argument types. */
arg = TYPE_ARG_TYPES (node);
- while (arg && TREE_CHAIN (arg) && arg != error_mark_node)
+ while (arg && arg != void_list_node && arg != error_mark_node)
{
- wrote_arg = true;
- dump_generic_node (buffer, TREE_VALUE (arg), spc, flags, false);
- arg = TREE_CHAIN (arg);
- if (TREE_CHAIN (arg) && TREE_CODE (TREE_CHAIN (arg)) == TREE_LIST)
+ if (wrote_arg)
{
pp_character (buffer, ',');
pp_space (buffer);
}
+ wrote_arg = true;
+ dump_generic_node (buffer, TREE_VALUE (arg), spc, flags, false);
+ arg = TREE_CHAIN (arg);
}
- if (!wrote_arg)
+ /* Drop the trailing void_type_node if we had any previous argument. */
+ if (arg == void_list_node && !wrote_arg)
pp_string (buffer, "void");
+ /* Properly dump vararg function types. */
+ else if (!arg && wrote_arg)
+ pp_string (buffer, ", ...");
+ /* Avoid printing any arg for unprototyped functions. */
pp_character (buffer, ')');
}