diff mbox series

[aarch64] Change two function declaration types

Message ID VI1PR0801MB201475EE6A8D16522F1205C5E0020@VI1PR0801MB2014.eurprd08.prod.outlook.com
State New
Headers show
Series [aarch64] Change two function declaration types | expand

Commit Message

Matthew Malcomson May 24, 2019, 10:28 a.m. UTC
Commit r271514 missed changing the type of two functions in
aarch64-protos.h.  The function definitions had been updated to use
uint64_t while the function declarations had been missed.
They were missed since I only tested the patch on aarch64 where
`unsigned long` is the same as `uint64_t`.

This patch updates these declarations in aarch64-protos.h.

Tested by building an aarch64 cross-compiler on arm-none-linux-gnu (so
that `unsigned long` and `uint64_t` are different and would give error
messages), and bootstrapping on aarch64-none-linux-gnu.
Also manually tested command line options to see that
-march=armv8-a+typo prints out the expected flags while using the new
feature flags does not complain about missing flags.

gcc/ChangeLog:

2019-05-24  Matthew Malcomson  <matthew.malcomson@arm.com>

	PR target/90588
	* common/config/aarch64/aarch64-common.c
	(aarch64_rewrite_selected_cpu): Change local temporary variable
	type from unsigned long to uint64_t.
	* config/aarch64/aarch64-protos.h (aarch64_parse_extension,
	aarch64_get_extension_string_for_isa_flags): Change declaration to
	match new definition by replacing unsigned long with uint64_t.



###############     Attachment also inlined for ease of reply    ###############
diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
index f9051056589861ce0ffe1bae4fa04cf44d34b9a2..07c032539513eec8c9e7f800c35454d81d627301 100644
--- a/gcc/common/config/aarch64/aarch64-common.c
+++ b/gcc/common/config/aarch64/aarch64-common.c
@@ -541,7 +541,7 @@ aarch64_rewrite_selected_cpu (const char *name)
       || a_to_an->arch == aarch64_no_arch)
     fatal_error (input_location, "unknown value %qs for %<-mcpu%>", name);
 
-  unsigned long extensions = p_to_a->flags;
+  uint64_t extensions = p_to_a->flags;
   aarch64_parse_extension (extension_str.c_str (), &extensions, NULL);
 
   std::string outstr = a_to_an->arch_name
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index b6c0d0a8eb6c1bbc6d0524fbf98686fa9ef9613d..a0723266f22454ce3d4d57830573acdebc96489c 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -624,11 +624,10 @@ bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,
 			     const struct cl_decoded_option *, location_t);
 const char *aarch64_rewrite_selected_cpu (const char *name);
 enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
-						       unsigned long *,
+						       uint64_t *,
 						       std::string *);
 void aarch64_get_all_extension_candidates (auto_vec<const char *> *candidates);
-std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
-							unsigned long);
+std::string aarch64_get_extension_string_for_isa_flags (uint64_t, uint64_t);
 
 /* Defined in aarch64-d.c  */
 extern void aarch64_d_target_versions (void);

Comments

Richard Earnshaw (lists) May 24, 2019, 10:37 a.m. UTC | #1
On 24/05/2019 11:28, Matthew Malcomson wrote:
> Commit r271514 missed changing the type of two functions in
> aarch64-protos.h.  The function definitions had been updated to use
> uint64_t while the function declarations had been missed.
> They were missed since I only tested the patch on aarch64 where
> `unsigned long` is the same as `uint64_t`.
> 
> This patch updates these declarations in aarch64-protos.h.
> 
> Tested by building an aarch64 cross-compiler on arm-none-linux-gnu (so
> that `unsigned long` and `uint64_t` are different and would give error
> messages), and bootstrapping on aarch64-none-linux-gnu.
> Also manually tested command line options to see that
> -march=armv8-a+typo prints out the expected flags while using the new
> feature flags does not complain about missing flags.
> 
> gcc/ChangeLog:
> 
> 2019-05-24  Matthew Malcomson  <matthew.malcomson@arm.com>
> 
> 	PR target/90588
> 	* common/config/aarch64/aarch64-common.c
> 	(aarch64_rewrite_selected_cpu): Change local temporary variable
> 	type from unsigned long to uint64_t.
> 	* config/aarch64/aarch64-protos.h (aarch64_parse_extension,
> 	aarch64_get_extension_string_for_isa_flags): Change declaration to
> 	match new definition by replacing unsigned long with uint64_t.
> 
> 

OK.

R.

> 
> ###############     Attachment also inlined for ease of reply    ###############
> 
> 
> diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
> index f9051056589861ce0ffe1bae4fa04cf44d34b9a2..07c032539513eec8c9e7f800c35454d81d627301 100644
> --- a/gcc/common/config/aarch64/aarch64-common.c
> +++ b/gcc/common/config/aarch64/aarch64-common.c
> @@ -541,7 +541,7 @@ aarch64_rewrite_selected_cpu (const char *name)
>        || a_to_an->arch == aarch64_no_arch)
>      fatal_error (input_location, "unknown value %qs for %<-mcpu%>", name);
>  
> -  unsigned long extensions = p_to_a->flags;
> +  uint64_t extensions = p_to_a->flags;
>    aarch64_parse_extension (extension_str.c_str (), &extensions, NULL);
>  
>    std::string outstr = a_to_an->arch_name
> diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
> index b6c0d0a8eb6c1bbc6d0524fbf98686fa9ef9613d..a0723266f22454ce3d4d57830573acdebc96489c 100644
> --- a/gcc/config/aarch64/aarch64-protos.h
> +++ b/gcc/config/aarch64/aarch64-protos.h
> @@ -624,11 +624,10 @@ bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,
>  			     const struct cl_decoded_option *, location_t);
>  const char *aarch64_rewrite_selected_cpu (const char *name);
>  enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
> -						       unsigned long *,
> +						       uint64_t *,
>  						       std::string *);
>  void aarch64_get_all_extension_candidates (auto_vec<const char *> *candidates);
> -std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
> -							unsigned long);
> +std::string aarch64_get_extension_string_for_isa_flags (uint64_t, uint64_t);
>  
>  /* Defined in aarch64-d.c  */
>  extern void aarch64_d_target_versions (void);
> 
> 
> prototype-fix.patch
> 
> diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
> index f9051056589861ce0ffe1bae4fa04cf44d34b9a2..07c032539513eec8c9e7f800c35454d81d627301 100644
> --- a/gcc/common/config/aarch64/aarch64-common.c
> +++ b/gcc/common/config/aarch64/aarch64-common.c
> @@ -541,7 +541,7 @@ aarch64_rewrite_selected_cpu (const char *name)
>        || a_to_an->arch == aarch64_no_arch)
>      fatal_error (input_location, "unknown value %qs for %<-mcpu%>", name);
>  
> -  unsigned long extensions = p_to_a->flags;
> +  uint64_t extensions = p_to_a->flags;
>    aarch64_parse_extension (extension_str.c_str (), &extensions, NULL);
>  
>    std::string outstr = a_to_an->arch_name
> diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
> index b6c0d0a8eb6c1bbc6d0524fbf98686fa9ef9613d..a0723266f22454ce3d4d57830573acdebc96489c 100644
> --- a/gcc/config/aarch64/aarch64-protos.h
> +++ b/gcc/config/aarch64/aarch64-protos.h
> @@ -624,11 +624,10 @@ bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,
>  			     const struct cl_decoded_option *, location_t);
>  const char *aarch64_rewrite_selected_cpu (const char *name);
>  enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
> -						       unsigned long *,
> +						       uint64_t *,
>  						       std::string *);
>  void aarch64_get_all_extension_candidates (auto_vec<const char *> *candidates);
> -std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
> -							unsigned long);
> +std::string aarch64_get_extension_string_for_isa_flags (uint64_t, uint64_t);
>  
>  /* Defined in aarch64-d.c  */
>  extern void aarch64_d_target_versions (void);
>
Richard Sandiford May 24, 2019, 1:32 p.m. UTC | #2
Matthew Malcomson <Matthew.Malcomson@arm.com> writes:
> Commit r271514 missed changing the type of two functions in
> aarch64-protos.h.  The function definitions had been updated to use
> uint64_t while the function declarations had been missed.
> They were missed since I only tested the patch on aarch64 where
> `unsigned long` is the same as `uint64_t`.
>
> This patch updates these declarations in aarch64-protos.h.
>
> Tested by building an aarch64 cross-compiler on arm-none-linux-gnu (so
> that `unsigned long` and `uint64_t` are different and would give error
> messages), and bootstrapping on aarch64-none-linux-gnu.
> Also manually tested command line options to see that
> -march=armv8-a+typo prints out the expected flags while using the new
> feature flags does not complain about missing flags.
>
> gcc/ChangeLog:
>
> 2019-05-24  Matthew Malcomson  <matthew.malcomson@arm.com>
>
> 	PR target/90588
> 	* common/config/aarch64/aarch64-common.c
> 	(aarch64_rewrite_selected_cpu): Change local temporary variable
> 	type from unsigned long to uint64_t.
> 	* config/aarch64/aarch64-protos.h (aarch64_parse_extension,
> 	aarch64_get_extension_string_for_isa_flags): Change declaration to
> 	match new definition by replacing unsigned long with uint64_t.

OK, thanks.

Richard

FWIW, this would also have been OK under the "obviously correct" rule.
diff mbox series

Patch

diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
index f9051056589861ce0ffe1bae4fa04cf44d34b9a2..07c032539513eec8c9e7f800c35454d81d627301 100644
--- a/gcc/common/config/aarch64/aarch64-common.c
+++ b/gcc/common/config/aarch64/aarch64-common.c
@@ -541,7 +541,7 @@  aarch64_rewrite_selected_cpu (const char *name)
       || a_to_an->arch == aarch64_no_arch)
     fatal_error (input_location, "unknown value %qs for %<-mcpu%>", name);
 
-  unsigned long extensions = p_to_a->flags;
+  uint64_t extensions = p_to_a->flags;
   aarch64_parse_extension (extension_str.c_str (), &extensions, NULL);
 
   std::string outstr = a_to_an->arch_name
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index b6c0d0a8eb6c1bbc6d0524fbf98686fa9ef9613d..a0723266f22454ce3d4d57830573acdebc96489c 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -624,11 +624,10 @@  bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,
 			     const struct cl_decoded_option *, location_t);
 const char *aarch64_rewrite_selected_cpu (const char *name);
 enum aarch64_parse_opt_result aarch64_parse_extension (const char *,
-						       unsigned long *,
+						       uint64_t *,
 						       std::string *);
 void aarch64_get_all_extension_candidates (auto_vec<const char *> *candidates);
-std::string aarch64_get_extension_string_for_isa_flags (unsigned long,
-							unsigned long);
+std::string aarch64_get_extension_string_for_isa_flags (uint64_t, uint64_t);
 
 /* Defined in aarch64-d.c  */
 extern void aarch64_d_target_versions (void);