* [Bug driver/112759] [13 regression] mips -march=native detection broken with gcc 13+
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
@ 2023-11-29 7:10 ` matoro_gcc_bugzilla at matoro dot tk
2023-11-29 22:16 ` [Bug driver/112759] [13/14 " pinskia at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: matoro_gcc_bugzilla at matoro dot tk @ 2023-11-29 7:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
matoro <matoro_gcc_bugzilla at matoro dot tk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matoro_gcc_bugzilla@matoro.
| |tk
--- Comment #1 from matoro <matoro_gcc_bugzilla at matoro dot tk> ---
Created attachment 56714
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56714&action=edit
/proc/cpuinfo
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
2023-11-29 7:10 ` [Bug driver/112759] " matoro_gcc_bugzilla at matoro dot tk
@ 2023-11-29 22:16 ` pinskia at gcc dot gnu.org
2023-11-30 8:42 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-29 22:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[13 regression] mips |[13/14 regression] mips
|-march=native detection |-march=native detection
|broken with gcc 13+ |broken with gcc 13+
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm, looks like it is this part of the change:
+ if (cpu)
+ ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
- return concat ("-m", argv[0], "=", cpu, NULL);
Maybe it should have been:
```
if (cpu)
{
if (!ret)
ret = concat ("-m", argv[0], "=", cpu, NULL);
else
ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
}
```
Can you try that?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
2023-11-29 7:10 ` [Bug driver/112759] " matoro_gcc_bugzilla at matoro dot tk
2023-11-29 22:16 ` [Bug driver/112759] [13/14 " pinskia at gcc dot gnu.org
@ 2023-11-30 8:42 ` rguenth at gcc dot gnu.org
2023-11-30 15:37 ` matoro_gcc_bugzilla at matoro dot tk
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-11-30 8:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.3
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (2 preceding siblings ...)
2023-11-30 8:42 ` rguenth at gcc dot gnu.org
@ 2023-11-30 15:37 ` matoro_gcc_bugzilla at matoro dot tk
2023-12-13 0:47 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: matoro_gcc_bugzilla at matoro dot tk @ 2023-11-30 15:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
--- Comment #3 from matoro <matoro_gcc_bugzilla at matoro dot tk> ---
(In reply to Andrew Pinski from comment #2)
> Hmm, looks like it is this part of the change:
> + if (cpu)
> + ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
>
> - return concat ("-m", argv[0], "=", cpu, NULL);
>
>
> Maybe it should have been:
> ```
> if (cpu)
> {
> if (!ret)
> ret = concat ("-m", argv[0], "=", cpu, NULL);
> else
> ret = reconcat (ret, ret, "-m", argv[0], "=", cpu, NULL);
> }
> ```
>
> Can you try that?
Indeed fixes it, thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (3 preceding siblings ...)
2023-11-30 15:37 ` matoro_gcc_bugzilla at matoro dot tk
@ 2023-12-13 0:47 ` pinskia at gcc dot gnu.org
2023-12-18 2:24 ` [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5 syq at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-13 0:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-12-13
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (4 preceding siblings ...)
2023-12-13 0:47 ` pinskia at gcc dot gnu.org
@ 2023-12-18 2:24 ` syq at gcc dot gnu.org
2023-12-18 3:16 ` syq at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: syq at gcc dot gnu.org @ 2023-12-18 2:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
--- Comment #5 from YunQiang Su <syq at gcc dot gnu.org> ---
It's my fault.
I misunderstanding `reconcat`:
if `optr` is NULL, it cannot work as the `s1` at the sametime.
If so, the return string will be empty.
So, let's define and initial ret like this:
char *ret = concat(" ");
Any idea?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (5 preceding siblings ...)
2023-12-18 2:24 ` [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5 syq at gcc dot gnu.org
@ 2023-12-18 3:16 ` syq at gcc dot gnu.org
2023-12-23 8:47 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: syq at gcc dot gnu.org @ 2023-12-18 3:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
--- Comment #6 from YunQiang Su <syq at gcc dot gnu.org> ---
ohh, it should be concat(" ", NULL);
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (6 preceding siblings ...)
2023-12-18 3:16 ` syq at gcc dot gnu.org
@ 2023-12-23 8:47 ` cvs-commit at gcc dot gnu.org
2023-12-23 8:51 ` cvs-commit at gcc dot gnu.org
2023-12-23 8:55 ` syq at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 8:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by YunQiang Su <syq@gcc.gnu.org>:
https://gcc.gnu.org/g:384dbb0b4e751e6eb7ba3f9993a6cce466743926
commit r14-6811-g384dbb0b4e751e6eb7ba3f9993a6cce466743926
Author: YunQiang Su <syq@gcc.gnu.org>
Date: Tue Dec 19 07:36:52 2023 +0800
MIPS: Put the ret to the end of args of reconcat [PR112759]
The function `reconcat` cannot append string(s) to NULL,
as the concat process will stop at the first NULL.
Let's always put the `ret` to the end, as it may be NULL.
We keep use reconcat here, due to that reconcat can make it
easier if we add more hardware features detecting, for example
by hwcap.
gcc/
PR target/112759
* config/mips/driver-native.cc (host_detect_local_cpu):
Put the ret to the end of args of reconcat.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (7 preceding siblings ...)
2023-12-23 8:47 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 8:51 ` cvs-commit at gcc dot gnu.org
2023-12-23 8:55 ` syq at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-23 8:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by YunQiang Su <syq@gcc.gnu.org>:
https://gcc.gnu.org/g:63df799074351e9b3ab90f5b3031ba2691385af8
commit r13-8175-g63df799074351e9b3ab90f5b3031ba2691385af8
Author: YunQiang Su <syq@gcc.gnu.org>
Date: Tue Dec 19 07:36:52 2023 +0800
MIPS: Put the ret to the end of args of reconcat [PR112759]
The function `reconcat` cannot append string(s) to NULL,
as the concat process will stop at the first NULL.
Let's always put the `ret` to the end, as it may be NULL.
We keep use reconcat here, due to that reconcat can make it
easier if we add more hardware features detecting, for example
by hwcap.
gcc/
PR target/112759
* config/mips/driver-native.cc (host_detect_local_cpu):
Put the ret to the end of args of reconcat.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug driver/112759] [13/14 regression] mips -march=native detection broken with gcc 13+ since r13-3178-g66c48be23e0fa5
2023-11-29 7:10 [Bug driver/112759] New: [13 regression] mips -march=native detection broken with gcc 13+ matoro_gcc_bugzilla at matoro dot tk
` (8 preceding siblings ...)
2023-12-23 8:51 ` cvs-commit at gcc dot gnu.org
@ 2023-12-23 8:55 ` syq at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: syq at gcc dot gnu.org @ 2023-12-23 8:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112759
YunQiang Su <syq at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from YunQiang Su <syq at gcc dot gnu.org> ---
It should be fixed now, and back ported to gcc13.
And we may should add some more detections:
1. hwcap
2. getauxval(AT_PLATFORM)
3. more cpuinfo parsing
^ permalink raw reply [flat|nested] 11+ messages in thread