public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/40051]  New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
@ 2009-05-06 21:54 jack2 at cantab dot net
  2009-05-06 21:57 ` [Bug other/40051] " jack2 at cantab dot net
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jack2 at cantab dot net @ 2009-05-06 21:54 UTC (permalink / raw)
  To: gcc-bugs

SVN commit 138953 introduced a bug where code compiled at -O2 and above reads a
value into a register before it is written in a function called by the
optimized code.

This is demonstrated in the code for the Enigmail plugin to Mozilla Thunderbird
as discussed at https://bugs.gentoo.org/show_bug.cgi?id=246421 I haven't been
able to produce a more minimal test case - it seems to need a significant
portion of the surrounding infrastructure to trigger this.

I've reversed commit 138953 on a recent trunk snapshot and it fixes this bug
but I don't know if this introduces a regression on other bugs.


-- 
           Summary: [4.3, 4.4, 4.5] regression member variable of a C++
                    class is read to a register for future use before it is
                    written
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jack2 at cantab dot net
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


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

* [Bug other/40051] [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
  2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
@ 2009-05-06 21:57 ` jack2 at cantab dot net
  2009-05-06 21:59 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jack2 at cantab dot net @ 2009-05-06 21:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jack2 at cantab dot net  2009-05-06 21:56 -------
Created an attachment (id=17814)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17814&action=view)
*.i file with which the bug is demonstrated


-- 


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


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

* [Bug other/40051] [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
  2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
  2009-05-06 21:57 ` [Bug other/40051] " jack2 at cantab dot net
@ 2009-05-06 21:59 ` pinskia at gcc dot gnu dot org
  2009-05-06 22:00 ` jack2 at cantab dot net
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-05-06 21:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2009-05-06 21:59 -------
>SVN commit 138953 introduced a bug where code compiled at -O2 and above reads a
value into a register before it is written in a function called by the
optimized code.

No, from the sound of it there is an alias violation in the code.


-- 


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


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

* [Bug other/40051] [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
  2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
  2009-05-06 21:57 ` [Bug other/40051] " jack2 at cantab dot net
  2009-05-06 21:59 ` pinskia at gcc dot gnu dot org
@ 2009-05-06 22:00 ` jack2 at cantab dot net
  2009-05-06 22:29 ` [Bug target/40051] " hjl dot tools at gmail dot com
  2009-05-06 22:31 ` jack2 at cantab dot net
  4 siblings, 0 replies; 6+ messages in thread
From: jack2 at cantab dot net @ 2009-05-06 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jack2 at cantab dot net  2009-05-06 22:00 -------
Created an attachment (id=17815)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17815&action=view)
Patch against trunk 147188 to revert commit 138953


-- 


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


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

* [Bug target/40051] [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
  2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
                   ` (2 preceding siblings ...)
  2009-05-06 22:00 ` jack2 at cantab dot net
@ 2009-05-06 22:29 ` hjl dot tools at gmail dot com
  2009-05-06 22:31 ` jack2 at cantab dot net
  4 siblings, 0 replies; 6+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-05-06 22:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2009-05-06 22:29 -------
Revision 138953:

http://gcc.gnu.org/ml/gcc-cvs/2008-08/msg00512.html
http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00524.html

fixed a real bug.


-- 


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


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

* [Bug target/40051] [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written
  2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
                   ` (3 preceding siblings ...)
  2009-05-06 22:29 ` [Bug target/40051] " hjl dot tools at gmail dot com
@ 2009-05-06 22:31 ` jack2 at cantab dot net
  4 siblings, 0 replies; 6+ messages in thread
From: jack2 at cantab dot net @ 2009-05-06 22:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jack2 at cantab dot net  2009-05-06 22:31 -------
> No, from the sound of it there is an alias violation in the code.

You're right, I had thought of that but had read that Mozilla code was compiled
with -fno-strict-aliasing because of this. Looking more closely the code in
this extension isn't and so fails.

Now that I've added -fno-strict-aliasing it works.

Sorry for the noise.


-- 

jack2 at cantab dot net changed:

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


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


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

end of thread, other threads:[~2009-05-06 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06 21:54 [Bug other/40051] New: [4.3, 4.4, 4.5] regression member variable of a C++ class is read to a register for future use before it is written jack2 at cantab dot net
2009-05-06 21:57 ` [Bug other/40051] " jack2 at cantab dot net
2009-05-06 21:59 ` pinskia at gcc dot gnu dot org
2009-05-06 22:00 ` jack2 at cantab dot net
2009-05-06 22:29 ` [Bug target/40051] " hjl dot tools at gmail dot com
2009-05-06 22:31 ` jack2 at cantab dot net

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).