public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kungfujesus06 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/108498] ppc64 big endian generates uninitialized reads with -fstore-merging
Date: Mon, 23 Jan 2023 15:48:45 +0000	[thread overview]
Message-ID: <bug-108498-4-mvqIwiEFiC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108498-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Adam Stylinski <kungfujesus06 at gmail dot com> ---
(In reply to Richard Biener from comment #5)
> maybe a stack sharing issue?  Can you try -fstack-reuse=none?

So that does fix it, at least when the struct is backed by the stack.  And also
valgrind is no longer finding uninitialized memory being used:

adam@g5box ~ $ gcc -O2 -fstack-reuse=none bug_rep2.c -o test.out
adam@g5box ~ $ ./test.out 
sat? = 0

adam@g5box ~ $ valgrind ./test.out
==26982== Memcheck, a memory error detector
==26982== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==26982== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==26982== Command: ./test.out
==26982== 
sat? = 0
==26982== 
==26982== HEAP SUMMARY:
==26982==     in use at exit: 0 bytes in 0 blocks
==26982==   total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==26982== 
==26982== All heap blocks were freed -- no leaks are possible
==26982== 
==26982== For lists of detected and suppressed errors, rerun with: -s
==26982== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Not sure what it might do if backed by the heap, but the code is written in a
way that it initializes the struct on the stack, anyway.

  parent reply	other threads:[~2023-01-23 15:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 14:18 [Bug c/108498] New: " kungfujesus06 at gmail dot com
2023-01-23 15:18 ` [Bug c/108498] " kungfujesus06 at gmail dot com
2023-01-23 15:20 ` [Bug middle-end/108498] " pinskia at gcc dot gnu.org
2023-01-23 15:22 ` kungfujesus06 at gmail dot com
2023-01-23 15:34 ` kungfujesus06 at gmail dot com
2023-01-23 15:38 ` rguenth at gcc dot gnu.org
2023-01-23 15:48 ` kungfujesus06 at gmail dot com [this message]
2023-01-23 15:51 ` kungfujesus06 at gmail dot com
2023-01-23 15:54 ` kungfujesus06 at gmail dot com
2023-01-23 17:39 ` pinskia at gcc dot gnu.org
2023-01-23 17:40 ` pinskia at gcc dot gnu.org
2023-01-23 17:42 ` kungfujesus06 at gmail dot com
2023-01-23 17:45 ` pinskia at gcc dot gnu.org
2023-01-23 17:51 ` [Bug tree-optimization/108498] " pinskia at gcc dot gnu.org
2023-01-23 17:51 ` kungfujesus06 at gmail dot com
2023-01-23 18:18 ` kungfujesus06 at gmail dot com
2023-01-23 19:04 ` jakub at gcc dot gnu.org
2023-01-24 12:20 ` [Bug tree-optimization/108498] [11/12/13 Regression] " jakub at gcc dot gnu.org
2023-01-24 12:55 ` jakub at gcc dot gnu.org
2023-01-24 15:35 ` jakub at gcc dot gnu.org
2023-01-24 16:09 ` jakub at gcc dot gnu.org
2023-01-24 16:48 ` ebotcazou at gcc dot gnu.org
2023-01-24 17:10 ` jakub at gcc dot gnu.org
2023-01-24 17:33 ` ebotcazou at gcc dot gnu.org
2023-01-24 17:46 ` jakub at gcc dot gnu.org
2023-01-25  9:51 ` cvs-commit at gcc dot gnu.org
2023-01-25 10:35 ` [Bug tree-optimization/108498] [11/12 " jakub at gcc dot gnu.org
2023-02-10 17:46 ` cvs-commit at gcc dot gnu.org
2023-02-10 18:00 ` [Bug tree-optimization/108498] [11 " jakub at gcc dot gnu.org
2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org
2023-05-03 10:35 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108498-4-mvqIwiEFiC@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).