* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
@ 2023-12-17 9:39 ` gjl at gcc dot gnu.org
2023-12-17 10:05 ` mikpelinux at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2023-12-17 9:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
-fno-builtin works, but that seems too much. -fno-builtin-strlen should switch
it off IMO.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
2023-12-17 9:39 ` [Bug tree-optimization/113049] " gjl at gcc dot gnu.org
@ 2023-12-17 10:05 ` mikpelinux at gmail dot com
2023-12-17 14:24 ` gjl at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mikpelinux at gmail dot com @ 2023-12-17 10:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Does -fno-tree-loop-distribute-patterns work? That's been the go-to for
disabling similar loop-to-call transformations people have been objecting to.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
2023-12-17 9:39 ` [Bug tree-optimization/113049] " gjl at gcc dot gnu.org
2023-12-17 10:05 ` mikpelinux at gmail dot com
@ 2023-12-17 14:24 ` gjl at gcc dot gnu.org
2023-12-17 15:10 ` schwab@linux-m68k.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2023-12-17 14:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Mikael Pettersson from comment #2)
> Does -fno-tree-loop-distribute-patterns work? That's been the go-to for
> disabling similar loop-to-call transformations people have been objecting to.
It works. But even if it does, that's not intuitive, and -fno-builtin-strlen
should work no matter what.
And also, when a function's assembly name is "funcxyz", then the compiler
should never issue a concocted call to "funcxyz", because the assumptions of
the compiler of what "funcxyz" is doing is obviously wrong.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (2 preceding siblings ...)
2023-12-17 14:24 ` gjl at gcc dot gnu.org
@ 2023-12-17 15:10 ` schwab@linux-m68k.org
2023-12-17 15:33 ` gjl at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2023-12-17 15:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
-fno-builtin-strlen has a different purpose.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (3 preceding siblings ...)
2023-12-17 15:10 ` schwab@linux-m68k.org
@ 2023-12-17 15:33 ` gjl at gcc dot gnu.org
2023-12-17 16:47 ` schwab@linux-m68k.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2023-12-17 15:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #4)
> -fno-builtin-strlen has a different purpose.
So then -fno-builtin should also not work? GCC documentation of -fno-builtin is
the same like for -fno-builtin-function.
At least there should be an option to disable this, e.g. you need it when
building libgcc / libc anyway, you you get silly non-functional libs.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (4 preceding siblings ...)
2023-12-17 15:33 ` gjl at gcc dot gnu.org
@ 2023-12-17 16:47 ` schwab@linux-m68k.org
2023-12-17 17:10 ` gjl at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2023-12-17 16:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #6 from Andreas Schwab <schwab@linux-m68k.org> ---
That's what -fno-tree-loop-distribute-patterns is for.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (5 preceding siblings ...)
2023-12-17 16:47 ` schwab@linux-m68k.org
@ 2023-12-17 17:10 ` gjl at gcc dot gnu.org
2023-12-17 17:28 ` harald at gigawatt dot nl
2023-12-17 17:58 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2023-12-17 17:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Andreas Schwab from comment #6)
> That's what -fno-tree-loop-distribute-patterns is for.
So you know the GCC sources and can draw that conclusion.
The documentation of -ftree-loop-distribute-patterns does not relate in any way
to that. It's impossible to find this option from a problem description.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (6 preceding siblings ...)
2023-12-17 17:10 ` gjl at gcc dot gnu.org
@ 2023-12-17 17:28 ` harald at gigawatt dot nl
2023-12-17 17:58 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: harald at gigawatt dot nl @ 2023-12-17 17:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
Harald van Dijk <harald at gigawatt dot nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |harald at gigawatt dot nl
--- Comment #8 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Georg-Johann Lay from comment #5)
> So then -fno-builtin should also not work? GCC documentation of -fno-builtin
> is the same like for -fno-builtin-function.
-fno-builtin implies -fno-tree-loop-distribute-patterns
(https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=b15458becf4086c463cba0c42db1d8780351201b),
-fno-builtin-strlen does not, but I think you are right that that does not
match the documentation.
(In reply to Georg-Johann Lay from comment #7)
> The documentation of -ftree-loop-distribute-patterns does not relate in any
> way to that. It's impossible to find this option from a problem description.
-ffreestanding also implies -fno-tree-loop-distribute-patterns, and that option
is documented in a way that would help here. Unless -ffreestanding is used, GCC
assumes the presence of a conforming standard library. It may expand calls to
library functions based on knowledge of what these functions do, and it may
replace code by calls to library functions as well for the same reason.
-fno-builtin and -fno-builtin-(function) are both documented as stopping the
former, but not documented as stopping the latter. The fact that one does, but
not both, is surprising.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/113049] Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen
2023-12-17 9:36 [Bug tree-optimization/113049] New: Compiles to strlen even with -fno-builtin-strlen -fno-optimize-strlen gjl at gcc dot gnu.org
` (7 preceding siblings ...)
2023-12-17 17:28 ` harald at gigawatt dot nl
@ 2023-12-17 17:58 ` pinskia at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-17 17:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113049
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
dup
*** This bug has been marked as a duplicate of bug 102725 ***
^ permalink raw reply [flat|nested] 10+ messages in thread