public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/87210] [RFE] introduce build time options to zero initialize automatic stack variables
       [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-29 18:51 ` pinskia at gcc dot gnu.org
  2020-05-15 20:44 ` qinzhao at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2020-04-29 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |qinzhao at gcc dot gnu.org

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 94855 has been marked as a duplicate of this bug. ***

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

* [Bug c/87210] [RFE] introduce build time options to zero initialize automatic stack variables
       [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
  2020-04-29 18:51 ` [Bug c/87210] [RFE] introduce build time options to zero initialize automatic stack variables pinskia at gcc dot gnu.org
@ 2020-05-15 20:44 ` qinzhao at gcc dot gnu.org
  2021-08-07 20:01 ` [Bug middle-end/87210] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: qinzhao at gcc dot gnu.org @ 2020-05-15 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from qinzhao at gcc dot gnu.org ---
So, based on the previous discussion on the LLVM option 
-ftrivial-auto-var-init=[uninitialized|pattern|zero]

we can see:
-ftrivial-auto-var-init=pattern 

might not be a good idea due to the following:

1. performance data is not good;
2. doesn't really help improve the general situation. People see it as a
debugging tool, not a "improve code quality and improve the life of kernel
developers" tool. (Per Linus)

On the other hand,
-ftrivial-auto-var-init=zero

might be helpful to improve code quality and improve the life fo kernel
developers. 

At the same time, a new variable attribute might be needed at the same time
along with -ftrivial-auto-var-init=zero:

__attribute((uninitialized) 

to mark variables that are uninitialized intentionally for performance purpose.

In a summary, in GCC, we should provide:
1. add a new GCC option: -ftrivial-auto-var-init to initialize trivial auto
variable to zero.
2. provide a new attribute for variable: __attribute((uninitialized) to mark
variables that are uninitialized intentionally for performance purpose.

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

* [Bug middle-end/87210] [RFE] introduce build time options to zero initialize automatic stack variables
       [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
  2020-04-29 18:51 ` [Bug c/87210] [RFE] introduce build time options to zero initialize automatic stack variables pinskia at gcc dot gnu.org
  2020-05-15 20:44 ` qinzhao at gcc dot gnu.org
@ 2021-08-07 20:01 ` pinskia at gcc dot gnu.org
  2021-08-07 20:04 ` pinskia at gcc dot gnu.org
  2021-11-29  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 20:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
           Severity|normal                      |enhancement
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-07
             Status|UNCONFIRMED                 |NEW

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

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

* [Bug middle-end/87210] [RFE] introduce build time options to zero initialize automatic stack variables
       [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-08-07 20:01 ` [Bug middle-end/87210] " pinskia at gcc dot gnu.org
@ 2021-08-07 20:04 ` pinskia at gcc dot gnu.org
  2021-11-29  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 20:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu.org

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 70069 has been marked as a duplicate of this bug. ***

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

* [Bug middle-end/87210] [RFE] introduce build time options to zero initialize automatic stack variables
       [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-08-07 20:04 ` pinskia at gcc dot gnu.org
@ 2021-11-29  6:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-29  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |12.0
         Resolution|---                         |FIXED

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  -ftrivial-auto-var-init=[uninitialized|pattern|zero] Add initializations to
automatic variables.

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

end of thread, other threads:[~2021-11-29  6:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-87210-4@http.gcc.gnu.org/bugzilla/>
2020-04-29 18:51 ` [Bug c/87210] [RFE] introduce build time options to zero initialize automatic stack variables pinskia at gcc dot gnu.org
2020-05-15 20:44 ` qinzhao at gcc dot gnu.org
2021-08-07 20:01 ` [Bug middle-end/87210] " pinskia at gcc dot gnu.org
2021-08-07 20:04 ` pinskia at gcc dot gnu.org
2021-11-29  6:28 ` 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).