diff mbox series

gcc/genflags.c: Improve error message

Message ID 1619523128-14792-1-git-send-email-christophe.lyon@linaro.org
State New
Headers show
Series gcc/genflags.c: Improve error message | expand

Commit Message

Christophe Lyon April 27, 2021, 11:32 a.m. UTC
When an iterator cannot be expanded, it is helpful to see the expanded
name which is causing problems.  It would be better to also print the
current iterator value (which couldn't match), but I couldn't find
how.

2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* genflags.c (gen_insn): Print failed expansion string.
---
 gcc/genflags.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Sandiford April 27, 2021, 1:57 p.m. UTC | #1
Christophe Lyon via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> When an iterator cannot be expanded, it is helpful to see the expanded
> name which is causing problems.  It would be better to also print the
> current iterator value (which couldn't match), but I couldn't find
> how.
>
> 2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>
>
> 	gcc/
> 	* genflags.c (gen_insn): Print failed expansion string.

OK, thanks.

Richard

> ---
>  gcc/genflags.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/genflags.c b/gcc/genflags.c
> index f65b16a..a154b85 100644
> --- a/gcc/genflags.c
> +++ b/gcc/genflags.c
> @@ -152,7 +152,7 @@ gen_insn (md_rtx_info *info)
>    lt = strchr (name, '<');
>    if (lt && strchr (lt + 1, '>'))
>      {
> -      error_at (info->loc, "unresolved iterator");
> +      error_at (info->loc, "unresolved iterator in %s", name);
>        return;
>      }
>  
> @@ -160,7 +160,7 @@ gen_insn (md_rtx_info *info)
>    if (lt || gt)
>      {
>        error_at (info->loc, "unmatched angle brackets, likely "
> -		"an error in iterator syntax");
> +		"an error in iterator syntax in %s", name);
>        return;
>      }
Jeff Law April 27, 2021, 2:57 p.m. UTC | #2
On 4/27/2021 5:32 AM, Christophe Lyon via Gcc-patches wrote:
> When an iterator cannot be expanded, it is helpful to see the expanded
> name which is causing problems.  It would be better to also print the
> current iterator value (which couldn't match), but I couldn't find
> how.
>
> 2021-03-01  Christophe Lyon  <christophe.lyon@linaro.org>
>
> 	gcc/
> 	* genflags.c (gen_insn): Print failed expansion string.

OK

jeff
diff mbox series

Patch

diff --git a/gcc/genflags.c b/gcc/genflags.c
index f65b16a..a154b85 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -152,7 +152,7 @@  gen_insn (md_rtx_info *info)
   lt = strchr (name, '<');
   if (lt && strchr (lt + 1, '>'))
     {
-      error_at (info->loc, "unresolved iterator");
+      error_at (info->loc, "unresolved iterator in %s", name);
       return;
     }
 
@@ -160,7 +160,7 @@  gen_insn (md_rtx_info *info)
   if (lt || gt)
     {
       error_at (info->loc, "unmatched angle brackets, likely "
-		"an error in iterator syntax");
+		"an error in iterator syntax in %s", name);
       return;
     }