public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/60313] New: volatile prevents optimizing logic on memory
@ 2014-02-22  1:38 hjl.tools at gmail dot com
  2014-02-22  2:19 ` [Bug middle-end/60313] " glisse at gcc dot gnu.org
  2014-02-22  4:14 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2014-02-22  1:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60313

            Bug ID: 60313
           Summary: volatile prevents optimizing logic on memory
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com

[hjl@gnu-6 rib86-1]$ cat q6.i
volatile unsigned char result;

void foo (void)
{
    result |= 0x1;
}
[hjl@gnu-6 rib86-1]$ gcc -S -O2 q6.i
[hjl@gnu-6 rib86-1]$ cat q6.s
    .file    "q6.i"
    .text
    .p2align 4,,15
    .globl    foo
    .type    foo, @function
foo:
.LFB0:
    .cfi_startproc
    movzbl    result(%rip), %eax
    orl    $1, %eax
    movb    %al, result(%rip)
    ret
    .cfi_endproc
.LFE0:
    .size    foo, .-foo

Remove volatile leads to:

foo:
.LFB0:
    .cfi_startproc
    orb    $1, result(%rip)
    ret


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

* [Bug middle-end/60313] volatile prevents optimizing logic on memory
  2014-02-22  1:38 [Bug middle-end/60313] New: volatile prevents optimizing logic on memory hjl.tools at gmail dot com
@ 2014-02-22  2:19 ` glisse at gcc dot gnu.org
  2014-02-22  4:14 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-22  2:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60313

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Dup of PR 50677 ?


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

* [Bug middle-end/60313] volatile prevents optimizing logic on memory
  2014-02-22  1:38 [Bug middle-end/60313] New: volatile prevents optimizing logic on memory hjl.tools at gmail dot com
  2014-02-22  2:19 ` [Bug middle-end/60313] " glisse at gcc dot gnu.org
@ 2014-02-22  4:14 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-02-22  4:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60313

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Yes a dup.

*** This bug has been marked as a duplicate of bug 50677 ***


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

end of thread, other threads:[~2014-02-22  4:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-22  1:38 [Bug middle-end/60313] New: volatile prevents optimizing logic on memory hjl.tools at gmail dot com
2014-02-22  2:19 ` [Bug middle-end/60313] " glisse at gcc dot gnu.org
2014-02-22  4:14 ` 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).