mirror of git://gcc.gnu.org/git/gcc.git
				
				
				
			Option diff dump is added for target and optimization
* ipa-icf.c (sem_function::equals_private): Call new functions cl_target_option_print_diff and cl_optimization_print_diff. * optc-save-gen.awk (cl_target_option_print_diff): New function. (cl_optimization_print_diff): Likewise. * opth-gen.awk: Likewise. M gcc/ChangeLog M gcc/ipa-icf.c M gcc/optc-save-gen.awk M gcc/opth-gen.awk From-SVN: r219542
This commit is contained in:
		
							parent
							
								
									ff8ebda16a
								
							
						
					
					
						commit
						eaabbb005f
					
				|  | @ -1,3 +1,11 @@ | ||||||
|  | 2015-01-13  Martin Liska  <mliska@suse.cz> | ||||||
|  | 
 | ||||||
|  | 	* ipa-icf.c (sem_function::equals_private): Call new functions | ||||||
|  | 	cl_target_option_print_diff and cl_optimization_print_diff. | ||||||
|  | 	* optc-save-gen.awk (cl_target_option_print_diff): New function. | ||||||
|  | 	(cl_optimization_print_diff): Likewise. | ||||||
|  | 	* opth-gen.awk: Likewise. | ||||||
|  | 
 | ||||||
| 2015-01-13  Richard Sandiford  <richard.sandiford@arm.com> | 2015-01-13  Richard Sandiford  <richard.sandiford@arm.com> | ||||||
| 
 | 
 | ||||||
| 	* config/aarch64/aarch64.md (subsi3, *subsi3_uxtw, subdi3) | 	* config/aarch64/aarch64.md (subsi3, *subsi3_uxtw, subdi3) | ||||||
|  |  | ||||||
|  | @ -445,10 +445,8 @@ sem_function::equals_private (sem_item *item, | ||||||
| 	{ | 	{ | ||||||
| 	  if (dump_file && (dump_flags & TDF_DETAILS)) | 	  if (dump_file && (dump_flags & TDF_DETAILS)) | ||||||
| 	    { | 	    { | ||||||
| 	      fprintf (dump_file, "Source target flags\n"); | 	      fprintf (dump_file, "target flags difference"); | ||||||
| 	      cl_target_option_print (dump_file, 2, tar1); | 	      cl_target_option_print_diff (dump_file, 2, tar1, tar2); | ||||||
| 	      fprintf (dump_file, "Target target flags\n"); |  | ||||||
| 	      cl_target_option_print (dump_file, 2, tar2); |  | ||||||
| 	    } | 	    } | ||||||
| 
 | 
 | ||||||
| 	  return return_false_with_msg ("Target flags are different"); | 	  return return_false_with_msg ("Target flags are different"); | ||||||
|  | @ -466,10 +464,8 @@ sem_function::equals_private (sem_item *item, | ||||||
| 	{ | 	{ | ||||||
| 	  if (dump_file && (dump_flags & TDF_DETAILS)) | 	  if (dump_file && (dump_flags & TDF_DETAILS)) | ||||||
| 	    { | 	    { | ||||||
| 	      fprintf (dump_file, "Source optimization flags\n"); | 	      fprintf (dump_file, "optimization flags difference"); | ||||||
| 	      cl_optimization_print (dump_file, 2, opt1); | 	      cl_optimization_print_diff (dump_file, 2, opt1, opt2); | ||||||
| 	      fprintf (dump_file, "Target optimization flags\n"); |  | ||||||
| 	      cl_optimization_print (dump_file, 2, opt2); |  | ||||||
| 	    } | 	    } | ||||||
| 
 | 
 | ||||||
| 	  return return_false_with_msg ("optimization flags are different"); | 	  return return_false_with_msg ("optimization flags are different"); | ||||||
|  |  | ||||||
|  | @ -243,6 +243,69 @@ for (i = 0; i < n_opt_char; i++) { | ||||||
| 
 | 
 | ||||||
| print "}"; | print "}"; | ||||||
| 
 | 
 | ||||||
|  | print ""; | ||||||
|  | print "/* Print different optimization variables from structures provided as arguments.  */"; | ||||||
|  | print "void"; | ||||||
|  | print "cl_optimization_print_diff (FILE *file,"; | ||||||
|  | print "                            int indent_to,"; | ||||||
|  | print "                            struct cl_optimization *ptr1,"; | ||||||
|  | print "                            struct cl_optimization *ptr2)"; | ||||||
|  | print "{"; | ||||||
|  | 
 | ||||||
|  | print "  fputs (\"\\n\", file);"; | ||||||
|  | for (i = 0; i < n_opt_other; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_opt_other[i] " != ptr2->x_" var_opt_other[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#lx/%#lx)\\n\","; | ||||||
|  | 	print "             indent_to, \"\","; | ||||||
|  | 	print "             \"" var_opt_other[i] "\","; | ||||||
|  | 	print "             (unsigned long)ptr1->x_" var_opt_other[i] ","; | ||||||
|  | 	print "             (unsigned long)ptr2->x_" var_opt_other[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_opt_int; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_opt_int[i] " != ptr2->x_" var_opt_int[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent_to, \"\","; | ||||||
|  | 	print "             \"" var_opt_int[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_opt_int[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_opt_int[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_opt_enum; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_opt_enum[i] " != ptr2->x_" var_opt_enum[i] ")"; | ||||||
|  | 	print "  fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "           indent_to, \"\","; | ||||||
|  | 	print "           \"" var_opt_enum[i] "\","; | ||||||
|  | 	print "           (int) ptr1->x_" var_opt_enum[i] ","; | ||||||
|  | 	print "           (int) ptr2->x_" var_opt_enum[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_opt_short; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_opt_short[i] " != ptr2->x_" var_opt_short[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent_to, \"\","; | ||||||
|  | 	print "             \"" var_opt_short[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_opt_short[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_opt_short[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_opt_char; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_opt_char[i] " != ptr2->x_" var_opt_char[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent_to, \"\","; | ||||||
|  | 	print "             \"" var_opt_char[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_opt_char[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_opt_char[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | print "}"; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| print ""; | print ""; | ||||||
| print "/* Save selected option variables into a structure.  */" | print "/* Save selected option variables into a structure.  */" | ||||||
| print "void"; | print "void"; | ||||||
|  | @ -436,6 +499,76 @@ for (i = 0; i < n_target_char; i++) { | ||||||
| print ""; | print ""; | ||||||
| print "  if (targetm.target_option.print)"; | print "  if (targetm.target_option.print)"; | ||||||
| print "    targetm.target_option.print (file, indent, ptr);"; | print "    targetm.target_option.print (file, indent, ptr);"; | ||||||
|  | print "}"; | ||||||
|  | 
 | ||||||
|  | print ""; | ||||||
|  | print "/* Print different target option variables from structures provided as arguments.  */"; | ||||||
|  | print "void"; | ||||||
|  | print "cl_target_option_print_diff (FILE *file,"; | ||||||
|  | print "                             int indent,"; | ||||||
|  | print "                             struct cl_target_option *ptr1,"; | ||||||
|  | print "                             struct cl_target_option *ptr2)"; | ||||||
|  | print "{"; | ||||||
|  | 
 | ||||||
|  | print "  fputs (\"\\n\", file);"; | ||||||
|  | for (i = 0; i < n_target_other; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_target_other[i] " != ptr2->x_" var_target_other[i] ")"; | ||||||
|  | 	if (host_wide_int[var_target_other[i]] == "yes") | ||||||
|  | 		print "    fprintf (file, \"%*s%s (%#\" HOST_WIDE_INT_PRINT \"x/%#\" HOST_WIDE_INT_PRINT \"x)\\n\","; | ||||||
|  | 	else | ||||||
|  | 		print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent, \"\","; | ||||||
|  | 	print "             \"" var_target_other[i] "\","; | ||||||
|  | 	if (host_wide_int[var_target_other[i]] == "yes") { | ||||||
|  | 		print "             ptr1->x_" var_target_other[i] ","; | ||||||
|  | 		print "             ptr2->x_" var_target_other[i] ");"; | ||||||
|  | 	} | ||||||
|  | 	else { | ||||||
|  | 		print "             (unsigned long)ptr1->x_" var_target_other[i] ","; | ||||||
|  | 		print "             (unsigned long)ptr2->x_" var_target_other[i] ");"; | ||||||
|  | 	} | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_target_enum; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_target_enum[i] " != ptr2->x_" var_target_enum[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent, \"\","; | ||||||
|  | 	print "             \"" var_target_enum[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_target_enum[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_target_enum[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_target_int; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_target_int[i] " != ptr2->x_" var_target_int[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent, \"\","; | ||||||
|  | 	print "             \"" var_target_int[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_target_int[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_target_int[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_target_short; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_target_short[i] " != ptr2->x_" var_target_short[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent, \"\","; | ||||||
|  | 	print "             \"" var_target_short[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_target_short[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_target_short[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | for (i = 0; i < n_target_char; i++) { | ||||||
|  | 	print "  if (ptr1->x_" var_target_char[i] " != ptr2->x_" var_target_char[i] ")"; | ||||||
|  | 	print "    fprintf (file, \"%*s%s (%#x/%#x)\\n\","; | ||||||
|  | 	print "             indent, \"\","; | ||||||
|  | 	print "             \"" var_target_char[i] "\","; | ||||||
|  | 	print "             ptr1->x_" var_target_char[i] ","; | ||||||
|  | 	print "             ptr2->x_" var_target_char[i] ");"; | ||||||
|  | 	print ""; | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| print "}"; | print "}"; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -284,6 +284,9 @@ print ""; | ||||||
| print "/* Print optimization variables from a structure.  */"; | print "/* Print optimization variables from a structure.  */"; | ||||||
| print "extern void cl_optimization_print (FILE *, int, struct cl_optimization *);"; | print "extern void cl_optimization_print (FILE *, int, struct cl_optimization *);"; | ||||||
| print ""; | print ""; | ||||||
|  | print "/* Print different optimization variables from structures provided as arguments.  */"; | ||||||
|  | print "extern void cl_optimization_print_diff (FILE *, int, cl_optimization *ptr1, cl_optimization *ptr2);"; | ||||||
|  | print ""; | ||||||
| print "/* Save selected option variables into a structure.  */" | print "/* Save selected option variables into a structure.  */" | ||||||
| print "extern void cl_target_option_save (struct cl_target_option *, struct gcc_options *);"; | print "extern void cl_target_option_save (struct cl_target_option *, struct gcc_options *);"; | ||||||
| print ""; | print ""; | ||||||
|  | @ -293,6 +296,9 @@ print ""; | ||||||
| print "/* Print target option variables from a structure.  */"; | print "/* Print target option variables from a structure.  */"; | ||||||
| print "extern void cl_target_option_print (FILE *, int, struct cl_target_option *);"; | print "extern void cl_target_option_print (FILE *, int, struct cl_target_option *);"; | ||||||
| print ""; | print ""; | ||||||
|  | print "/* Print different target option variables from structures provided as arguments.  */"; | ||||||
|  | print "extern void cl_target_option_print_diff (FILE *, int, cl_target_option *ptr1, cl_target_option *ptr2);"; | ||||||
|  | print ""; | ||||||
| print "/* Compare two target option variables from a structure.  */"; | print "/* Compare two target option variables from a structure.  */"; | ||||||
| print "extern bool cl_target_option_eq (const struct cl_target_option *, const struct cl_target_option *);"; | print "extern bool cl_target_option_eq (const struct cl_target_option *, const struct cl_target_option *);"; | ||||||
| print ""; | print ""; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Martin Liska
						Martin Liska