public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/110568] New: ftrivial-auto-var-init= has no effect on return values in C
@ 2023-07-06  2:08 pinskia at gcc dot gnu.org
  2023-07-06  8:21 ` [Bug c/110568] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-06  2:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110568
           Summary: ftrivial-auto-var-init= has no effect on return values
                    in C
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

When I am trying to reduce a bug, I had thought -ftrivial-auto-var-init=pattern
would help me not get an uninitialized variable but nope. 

So a simple testcase like:
```
int f(void)
{
}

```

For C (since in C++ it is undefined right away), I would have thought
-ftrivial-auto-var-init=pattern would help here but does not.

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

* [Bug c/110568] ftrivial-auto-var-init= has no effect on return values in C
  2023-07-06  2:08 [Bug middle-end/110568] New: ftrivial-auto-var-init= has no effect on return values in C pinskia at gcc dot gnu.org
@ 2023-07-06  8:21 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-06  8:21 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |c

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, the return is missing here ... if the frontend would emit

int f (void)
{
  return D.1234; // uninitialized
}

then it would work.  The C++ FE emits __builtin_unreachable traps () instead.
I think this should be addressed in the frontend.

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

end of thread, other threads:[~2023-07-06  8:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06  2:08 [Bug middle-end/110568] New: ftrivial-auto-var-init= has no effect on return values in C pinskia at gcc dot gnu.org
2023-07-06  8:21 ` [Bug c/110568] " rguenth 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).