public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
@ 2023-01-09 11:46 ` rguenth at gcc dot gnu.org
2023-01-09 11:50 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 11:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note we do expand volatile qualified variables to memory but this case is about
non-volatile qualified variables stored to through volatile qualified pointers.
So it's
int foo (int i)
{
volatile int j = i;
return j;
}
vs.
int bar (int i)
{
int j;
*(volatile int *)&j = i;
return j;
}
I have a patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
2023-01-09 11:46 ` [Bug middle-end/69482] Writing through pointers to volatile not always preserved rguenth at gcc dot gnu.org
@ 2023-01-09 11:50 ` rguenth at gcc dot gnu.org
2023-01-09 12:31 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 11:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.lundin.mail at gmail dot co
| |m
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
*** Bug 108298 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
2023-01-09 11:46 ` [Bug middle-end/69482] Writing through pointers to volatile not always preserved rguenth at gcc dot gnu.org
2023-01-09 11:50 ` rguenth at gcc dot gnu.org
@ 2023-01-09 12:31 ` cvs-commit at gcc dot gnu.org
2023-01-09 12:32 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-09 12:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:a5a8242153d078f1ebe60f00409415da260a29ee
commit r13-5066-ga5a8242153d078f1ebe60f00409415da260a29ee
Author: Richard Biener <rguenther@suse.de>
Date: Mon Jan 9 12:46:28 2023 +0100
middle-end/69482 - not preserving volatile accesses
The following addresses a long standing issue with not preserving
accesses to non-volatile objects through volatile qualified
pointers in the case that object gets expanded to a register. The
fix is to treat accesses to an object with a volatile qualified
access as forcing that object to memory. This issue got more
exposed recently so it regressed more since GCC 11.
PR middle-end/69482
* cfgexpand.cc (discover_nonconstant_array_refs_r): Volatile
qualified accesses also force objects to memory.
* gcc.target/i386/pr69482-1.c: New testcase.
* gcc.target/i386/pr69482-2.c: Likewise.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2023-01-09 12:31 ` cvs-commit at gcc dot gnu.org
@ 2023-01-09 12:32 ` rguenth at gcc dot gnu.org
2023-01-09 20:24 ` dboles.src at gmail dot com
2023-01-10 9:08 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-09 12:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |13.0
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
fixed on trunk, queued for eventual backporting.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2023-01-09 12:32 ` rguenth at gcc dot gnu.org
@ 2023-01-09 20:24 ` dboles.src at gmail dot com
2023-01-10 9:08 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: dboles.src at gmail dot com @ 2023-01-09 20:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
Daniel Boles <dboles.src at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dboles.src at gmail dot com
--- Comment #12 from Daniel Boles <dboles.src at gmail dot com> ---
Is this the same cause as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71793 ?
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug middle-end/69482] Writing through pointers to volatile not always preserved
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2023-01-09 20:24 ` dboles.src at gmail dot com
@ 2023-01-10 9:08 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-01-10 9:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69482
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=71793
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Daniel Boles from comment #12)
> Is this the same cause as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71793
> ?
I think so but I found the testcase in that PR hard to validate with the fix,
so if you can confirm the issue is fixed there with the change that would be
great!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-10 9:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-69482-4@http.gcc.gnu.org/bugzilla/>
2023-01-09 11:46 ` [Bug middle-end/69482] Writing through pointers to volatile not always preserved rguenth at gcc dot gnu.org
2023-01-09 11:50 ` rguenth at gcc dot gnu.org
2023-01-09 12:31 ` cvs-commit at gcc dot gnu.org
2023-01-09 12:32 ` rguenth at gcc dot gnu.org
2023-01-09 20:24 ` dboles.src at gmail dot com
2023-01-10 9:08 ` 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).