public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases
@ 2023-12-15  7:49 doko at gcc dot gnu.org
  2023-12-15  8:05 ` [Bug target/113030] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: doko at gcc dot gnu.org @ 2023-12-15  7:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

            Bug ID: 113030
           Summary: ARM32: option parsing for --march= doesn't work for
                    aliases
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen everywhere, the two last values are documented as aliases:

$ awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+simd"
config/arm/arm-cpus.in
armv7-a+simd

$ awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon"
config/arm/arm-cpus.in
error

$ awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon-vfpv3"
config/arm/arm-cpus.in
error

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] ARM32: option parsing for --march= doesn't work for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
@ 2023-12-15  8:05 ` pinskia at gcc dot gnu.org
  2023-12-15  8:18 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-15  8:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
so I looked into config/arm/parsecpu.awk and yes it ignores aliases for chkarch
but I don't think that matters to the end user ...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] ARM32: option parsing for --march= doesn't work for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
  2023-12-15  8:05 ` [Bug target/113030] " pinskia at gcc dot gnu.org
@ 2023-12-15  8:18 ` pinskia at gcc dot gnu.org
  2023-12-15  8:21 ` [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-15  8:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Or rather there is a typo in the script.
This fixes the script's chkarch and chkcpu commands:
```
diff --git a/gcc/config/arm/parsecpu.awk b/gcc/config/arm/parsecpu.awk
index b827d71dded..fdc6e35a7ce 100644
--- a/gcc/config/arm/parsecpu.awk
+++ b/gcc/config/arm/parsecpu.awk
@@ -529,7 +529,7 @@ function check_cpu (name) {

     for (n = 2; n <= exts; n++) {
        if (!((cpu_name, extensions[n]) in cpu_opt_remove)      \
-           && !((cpu_name, extensions[n]) in cpu_optaliases)) {
+           && !((cpu_name, extensions[n]) in cpu_opt_alias)) {
            return "error"
        }
     }
@@ -552,7 +552,7 @@ function check_arch (name) {

     for (n = 2; n <= exts; n++) {
        if (!((extensions[1], extensions[n]) in arch_opt_remove)        \
-           && !((extensions[1], extensions[n]) in arch_optaliases)) {
+           && !((extensions[1], extensions[n]) in arch_opt_alias)) {
            return "error"
        }
     }
```

But it does not change how -march=/-mcpu= is handled inside cc1.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
  2023-12-15  8:05 ` [Bug target/113030] " pinskia at gcc dot gnu.org
  2023-12-15  8:18 ` pinskia at gcc dot gnu.org
@ 2023-12-15  8:21 ` pinskia at gcc dot gnu.org
  2023-12-15 12:03 ` rearnsha at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-15  8:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |internal-improvement
   Last reconfirmed|                            |2023-12-15
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
            Summary|ARM32: option parsing for   |parsecpu.awk's
                   |--march= doesn't work for   |chkarch/chkcpu commands is
                   |aliases                     |broken for aliases

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I tested cc1 and it works, so it is just the script which is broken.

Confirmed.  Unless you can provide an error message for cc1/gcc because that
works for me.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-12-15  8:21 ` [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken " pinskia at gcc dot gnu.org
@ 2023-12-15 12:03 ` rearnsha at gcc dot gnu.org
  2024-01-21  7:30 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2023-12-15 12:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Yes, that looks sensible.  Can you post it please?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-12-15 12:03 ` rearnsha at gcc dot gnu.org
@ 2024-01-21  7:30 ` pinskia at gcc dot gnu.org
  2024-01-22 17:31 ` cvs-commit at gcc dot gnu.org
  2024-01-22 17:31 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-21  7:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643549.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-01-21  7:30 ` pinskia at gcc dot gnu.org
@ 2024-01-22 17:31 ` cvs-commit at gcc dot gnu.org
  2024-01-22 17:31 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-22 17:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:41caf6b0d603408a829b37f7f7fb09d64d814d48

commit r14-8337-g41caf6b0d603408a829b37f7f7fb09d64d814d48
Author: Andrew Pinski <quic_apinski@quicinc.com>
Date:   Sat Jan 20 23:12:31 2024 -0800

    arm: Fix parsecpu.awk for aliases [PR113030]

    So the problem here is the 2 functions check_cpu and check_arch use
    the wrong variable to check if an alias is valid for that cpu/arch.
    check_cpu uses cpu_optaliases instead of cpu_opt_alias. cpu_optaliases
    is an array of index'ed by the cpuname that contains all of the valid
aliases
    for that cpu but cpu_opt_alias is an double index array which is index'ed
    by cpuname and the alias which provides what is the alias for that option.
    Similar thing happens for check_arch and arch_optaliases vs
arch_optaliases.

    Tested by running:
    ```
    awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+simd"
config/arm/arm-cpus.in
    awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon"
config/arm/arm-cpus.in
    awk -f config/arm/parsecpu.awk -v cmd="chkarch armv7-a+neon-vfpv3"
config/arm/arm-cpus.in
    ```
    And they don't return error back.

    gcc/ChangeLog:

            PR target/113030
            * config/arm/parsecpu.awk (check_cpu): Use cpu_opt_alias
            instead of cpu_optaliases.
            (check_arch): Use arch_opt_alias instead of arch_optaliases.

    Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken for aliases
  2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-01-22 17:31 ` cvs-commit at gcc dot gnu.org
@ 2024-01-22 17:31 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-22 17:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113030

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |14.0

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-01-22 17:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-15  7:49 [Bug target/113030] New: ARM32: option parsing for --march= doesn't work for aliases doko at gcc dot gnu.org
2023-12-15  8:05 ` [Bug target/113030] " pinskia at gcc dot gnu.org
2023-12-15  8:18 ` pinskia at gcc dot gnu.org
2023-12-15  8:21 ` [Bug target/113030] parsecpu.awk's chkarch/chkcpu commands is broken " pinskia at gcc dot gnu.org
2023-12-15 12:03 ` rearnsha at gcc dot gnu.org
2024-01-21  7:30 ` pinskia at gcc dot gnu.org
2024-01-22 17:31 ` cvs-commit at gcc dot gnu.org
2024-01-22 17:31 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).