public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/48981] New: bootstrap-lto -O3 produces miscompiled, broken gcc
@ 2011-05-12 16:29 d.g.gorbachev at gmail dot com
  2011-05-12 18:52 ` [Bug other/48981] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2011-05-12 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: bootstrap-lto -O3 produces miscompiled, broken gcc
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: d.g.gorbachev@gmail.com
                CC: rguenth@gcc.gnu.org
              Host: i686-pc-linux-gnu
            Target: i686-pc-linux-gnu
             Build: i686-pc-linux-gnu


GCC crashes because of violation of strict aliasing rules. The same memory
location is accessed in vec_gc_o_reserve_1 through (struct vec_prefix *)
pointer, then in VEC_tree_base_quick_push through (struct VEC_tree_base *).
Optimization moves the code around in a wrong way.

This patch fixes it:

--- gcc/vec.c
+++ gcc/vec.c
@@ -37,11 +37,11 @@
 struct vec_prefix
 {
   unsigned num;
   unsigned alloc;
   void *vec[1];
-};
+} __attribute__ ((may_alias));


 #ifdef GATHER_STATISTICS

 /* Store information about each particular vector.  */


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

end of thread, other threads:[~2011-05-27 20:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12 16:29 [Bug other/48981] New: bootstrap-lto -O3 produces miscompiled, broken gcc d.g.gorbachev at gmail dot com
2011-05-12 18:52 ` [Bug other/48981] " pinskia at gcc dot gnu.org
2011-05-13  9:11 ` rguenth at gcc dot gnu.org
2011-05-13 21:27 ` pinskia at gcc dot gnu.org
2011-05-13 21:57 ` pinskia at gcc dot gnu.org
2011-05-14  2:01 ` d.g.gorbachev at gmail dot com
2011-05-25  1:24 ` pinskia at gcc dot gnu.org
2011-05-27 15:08 ` d.g.gorbachev at gmail dot com
2011-05-27 20:20 ` pinskia at gcc dot gnu.org
2011-05-27 20:22 ` 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).