[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-12-17 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

--- Comment #12 from Georg-Johann Lay  ---
(In reply to Andrew Pinski from comment #1)
> You need -fno-tree-loop-distribution -fno-tree-loop-distribute-patterns to
> turn it off.  There is another older bug about this for memcpy.

This is also a documentation issue.

Neither from the naming of that option nor from its documentation one can
concluse that it inhibits open-coded-foo -> foo transformations.

And IMO options that disable all builtin generations should be available on
single function basis, like -fno-auto-strlen or whatever.

Moreover, introducing a call to strlen in a function named "strlen" (or with
assembly name "strlen") is not very wise.

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-12-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

Andrew Pinski  changed:

   What|Removed |Added

 CC||gjl at gcc dot gnu.org

--- Comment #11 from Andrew Pinski  ---
*** Bug 113049 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-06-02 Thread terra at gnome dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

M Welinder  changed:

   What|Removed |Added

 CC||terra at gnome dot org

--- Comment #10 from M Welinder  ---
mystrlen and strlen are not equivalent, so gcc is wrong in turning the former
into a call of the latter.

Specifically: mystrlen preserves errno, strlen need not do that.  (C99 section
7.5 item 3.)

(Repeating the comment from over in bug 56888.)

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-06-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

Andrew Pinski  changed:

   What|Removed |Added

 Depends on||56888

--- Comment #9 from Andrew Pinski  ---
(In reply to Vincent Riviere from comment #8)
> This still happens with m68k-elf-gcc 13.1.0.

Yes because it is basically a dup of bug 56888.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
[Bug 56888] memcpy implementation optimized as a call to memcpy

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-06-02 Thread vincent.riviere at freesbee dot fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

--- Comment #8 from Vincent Riviere  ---
This still happens with m68k-elf-gcc 13.1.0.

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2023-02-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

Andrew Pinski  changed:

   What|Removed |Added

 CC||daniel at eyoman dot com

--- Comment #7 from Andrew Pinski  ---
*** Bug 108715 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2022-07-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

Andrew Pinski  changed:

   What|Removed |Added

 CC||vincent.riviere at freesbee 
dot fr

--- Comment #6 from Andrew Pinski  ---
*** Bug 106349 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2021-12-29 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

Martin Liška  changed:

   What|Removed |Added

 CC||dani at danielbertalan dot dev

--- Comment #5 from Martin Liška  ---
*** Bug 103858 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2021-10-13 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

--- Comment #4 from Richard Biener  ---
I think that 'strlen' is only used when it is explicitely declared.  Hmm, maybe
I'm mistaken and it's 'implicit' already because it is standard.

So loop distribution could check for builtin_decl_declared_p (BUILT_IN_STRLEN)
(but that likely only "works" for the C family frontends)

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2021-10-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

--- Comment #3 from Andrew Pinski  ---
(In reply to Martin Liška from comment #2)
> (In reply to Andrew Pinski from comment #1)
> > You need -fno-tree-loop-distribution -fno-tree-loop-distribute-patterns to
> > turn it off.  There is another older bug about this for memcpy.
> 
> Well, I would expect this optimization would do the optimization only if
> __builtin_strlen is allowed (not disallowed by the option).

__builtin_strlen is always allowed even if -fno-builtin.  -fno-builtin just
disables strlen -> __builtin_strlen conversion.  See the other bugs that I
referenced for an example.  There are more dealing with memcpy too.

[Bug tree-optimization/102725] -fno-builtin leads to call of strlen since r12-4283-g6f966f06146be768

2021-10-13 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102725

--- Comment #2 from Martin Liška  ---
(In reply to Andrew Pinski from comment #1)
> You need -fno-tree-loop-distribution -fno-tree-loop-distribute-patterns to
> turn it off.  There is another older bug about this for memcpy.

Well, I would expect this optimization would do the optimization only if
__builtin_strlen is allowed (not disallowed by the option).