public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/62033] New: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2
@ 2014-08-06 9:03 amodra at gmail dot com
2014-08-06 9:09 ` [Bug tree-optimization/62033] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: amodra at gmail dot com @ 2014-08-06 9:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62033
Bug ID: 62033
Summary: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: amodra at gmail dot com
Created attachment 33257
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33257&action=edit
delta+hand reduced testcase
Found on powerpc64le with 4.9, and then with x86_64 4.10.0 20140727
Due to __warn_memset_zero_len reference in object, we get
.../bytearraymodel_p.o: In function `memset':
.../bits/string3.h:81: warning: memset used with constant zero length
parameter; this could be due to transposed parameters
collect2: error: ld returned 1 exit status
Compile testcase with
-O3 -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/62033] okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2
2014-08-06 9:03 [Bug tree-optimization/62033] New: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2 amodra at gmail dot com
@ 2014-08-06 9:09 ` pinskia at gcc dot gnu.org
2014-08-06 9:52 ` amodra at gmail dot com
2014-08-06 15:30 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-06 9:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62033
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see a bug here as there is one case where addSize can return 0 and with
jump threading and basic block copying, we get a zero size passed to memset.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/62033] okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2
2014-08-06 9:03 [Bug tree-optimization/62033] New: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2 amodra at gmail dot com
2014-08-06 9:09 ` [Bug tree-optimization/62033] " pinskia at gcc dot gnu.org
@ 2014-08-06 9:52 ` amodra at gmail dot com
2014-08-06 15:30 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: amodra at gmail dot com @ 2014-08-06 9:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62033
--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
I can see where you're coming from Andrew, but what is disconcerting about this
is that the _FORTIFY_SOURCE warning is plainly incorrect here. How is one
supposed to write a string.h memset macro using __builtin_constant_p() to
provide a useful _FORTIFY_SOURCE warning, in the face of this sort of
optimisation?
Users are going to see this as "__builtin_constant_p() is broken".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/62033] okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2
2014-08-06 9:03 [Bug tree-optimization/62033] New: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2 amodra at gmail dot com
2014-08-06 9:09 ` [Bug tree-optimization/62033] " pinskia at gcc dot gnu.org
2014-08-06 9:52 ` amodra at gmail dot com
@ 2014-08-06 15:30 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-06 15:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62033
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #2)
> I can see where you're coming from Andrew, but what is disconcerting about
> this is that the _FORTIFY_SOURCE warning is plainly incorrect here. How is
> one supposed to write a string.h memset macro using __builtin_constant_p()
> to provide a useful _FORTIFY_SOURCE warning, in the face of this sort of
> optimisation?
This is why Jakub moved it to the front-end away from glibc (See PR 61294).
>
> Users are going to see this as "__builtin_constant_p() is broken".
It is not. It is working correctly as on that path, it is constant.
This is an exact duplicate of bug 61294 really.
*** This bug has been marked as a duplicate of bug 61294 ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-06 15:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06 9:03 [Bug tree-optimization/62033] New: okteta 4.13.97 error at -O3 -D_FORTIFY_SOURCE=2 amodra at gmail dot com
2014-08-06 9:09 ` [Bug tree-optimization/62033] " pinskia at gcc dot gnu.org
2014-08-06 9:52 ` amodra at gmail dot com
2014-08-06 15:30 ` 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).