public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48695] New: Runtime with an array of std::vectors
@ 2011-04-19 21:25 personal@e-maxx.ru
  2011-04-19 21:34 ` [Bug tree-optimization/48695] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: personal@e-maxx.ru @ 2011-04-19 21:25 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Runtime with an array of std::vectors
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: personal@e-maxx.ru


Created attachment 24048
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24048
The entire program

The following program crashes if compiled with -O2:

   for (int i=0; i<=1; i++)
      for (int j=0; j<=1; j++) {
         std::vector<int> a[2];
         a[i].push_back (0);
      }

If we remove any 'for' loop, or if we change a[i] to a[0] or to a[1] - there
will be no crash.


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

* [Bug tree-optimization/48695] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
@ 2011-04-19 21:34 ` pinskia at gcc dot gnu.org
  2011-04-19 21:40 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-19 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |x86_64-linux-gnu
          Component|c++                         |tree-optimization
           Severity|critical                    |normal

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-19 21:33:53 UTC ---
I can reproduce this on the trunk.


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

* [Bug tree-optimization/48695] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
  2011-04-19 21:34 ` [Bug tree-optimization/48695] " pinskia at gcc dot gnu.org
@ 2011-04-19 21:40 ` pinskia at gcc dot gnu.org
  2011-04-19 22:16 ` zsojka at seznam dot cz
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-19 21:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-19 21:39:32 UTC ---
-fno-strict-aliasing makes it work.


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

* [Bug tree-optimization/48695] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
  2011-04-19 21:34 ` [Bug tree-optimization/48695] " pinskia at gcc dot gnu.org
  2011-04-19 21:40 ` pinskia at gcc dot gnu.org
@ 2011-04-19 22:16 ` zsojka at seznam dot cz
  2011-04-19 22:58 ` [Bug rtl-optimization/48695] " pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: zsojka at seznam dot cz @ 2011-04-19 22:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Zdenek Sojka <zsojka at seznam dot cz> 2011-04-19 22:15:23 UTC ---
Created attachment 24049
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24049
partially reduced testcase

$ g++ testcase.C -O2
$ valgrind -q ./a.out 
==20686== Invalid write of size 4
==20686==    at 0x400625: main (testcase.C:54)
==20686==  Address 0x4 is not stack'd, malloc'd or (recently) free'd


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

* [Bug rtl-optimization/48695] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (2 preceding siblings ...)
  2011-04-19 22:16 ` zsojka at seznam dot cz
@ 2011-04-19 22:58 ` pinskia at gcc dot gnu.org
  2011-04-19 23:02 ` [Bug rtl-optimization/48695] [4.6 Regression] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-19 22:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |rtl-optimization

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-19 22:58:01 UTC ---
The aliasing problem does not show up until sched2.


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

* [Bug rtl-optimization/48695] [4.6 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (3 preceding siblings ...)
  2011-04-19 22:58 ` [Bug rtl-optimization/48695] " pinskia at gcc dot gnu.org
@ 2011-04-19 23:02 ` pinskia at gcc dot gnu.org
  2011-04-19 23:07 ` zsojka at seznam dot cz
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-19 23:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.04.19 23:01:24
                 CC|                            |rguenth at gcc dot gnu.org
   Target Milestone|---                         |4.6.1
            Summary|Runtime with an array of    |[4.6 Regression] Runtime
                   |std::vectors                |with an array of
                   |                            |std::vectors
     Ever Confirmed|0                           |1

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-19 23:01:24 UTC ---
D.2398_16->D.2250._M_impl._M_finish
MEM[(struct _Vector_impl *)&a + 24B]._M_finish
Should conflict but don't


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

* [Bug rtl-optimization/48695] [4.6 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (4 preceding siblings ...)
  2011-04-19 23:02 ` [Bug rtl-optimization/48695] [4.6 Regression] " pinskia at gcc dot gnu.org
@ 2011-04-19 23:07 ` zsojka at seznam dot cz
  2011-04-20  9:26 ` [Bug rtl-optimization/48695] [4.6/4.7 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: zsojka at seznam dot cz @ 2011-04-19 23:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Zdenek Sojka <zsojka at seznam dot cz> 2011-04-19 23:06:31 UTC ---
Created attachment 24050
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24050
reduced testcase

I am not sure if it is reduced correctly. However, -fno-strict-aliasing
prevents the crash.


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

* [Bug rtl-optimization/48695] [4.6/4.7 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (5 preceding siblings ...)
  2011-04-19 23:07 ` zsojka at seznam dot cz
@ 2011-04-20  9:26 ` rguenth at gcc dot gnu.org
  2011-04-20 13:11 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-20  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-20 09:26:30 UTC ---
Mine.


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

* [Bug rtl-optimization/48695] [4.6/4.7 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (6 preceding siblings ...)
  2011-04-20  9:26 ` [Bug rtl-optimization/48695] [4.6/4.7 " rguenth at gcc dot gnu.org
@ 2011-04-20 13:11 ` rguenth at gcc dot gnu.org
  2011-04-20 13:48 ` [Bug rtl-optimization/48695] [4.6 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-20 13:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-20 13:11:12 UTC ---
Author: rguenth
Date: Wed Apr 20 13:11:06 2011
New Revision: 172768

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172768
Log:
2011-04-20  Richard Guenther  <rguenther@suse.de>

    PR middle-end/48695
    * tree-ssa-alias.c (aliasing_component_refs_p): Compute base
    objects and types here.  Adjust for their offset before
    comparing.

    * g++.dg/torture/pr48695.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr48695.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-alias.c


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

* [Bug rtl-optimization/48695] [4.6 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (7 preceding siblings ...)
  2011-04-20 13:11 ` rguenth at gcc dot gnu.org
@ 2011-04-20 13:48 ` rguenth at gcc dot gnu.org
  2011-04-21 14:42 ` rguenth at gcc dot gnu.org
  2011-04-21 14:42 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-20 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.0
            Summary|[4.6/4.7 Regression]        |[4.6 Regression] Runtime
                   |Runtime with an array of    |with an array of
                   |std::vectors                |std::vectors

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-20 13:46:54 UTC ---
Fixed on trunk sofar.


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

* [Bug rtl-optimization/48695] [4.6 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (9 preceding siblings ...)
  2011-04-21 14:42 ` rguenth at gcc dot gnu.org
@ 2011-04-21 14:42 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-21 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-21 14:40:57 UTC ---
Author: rguenth
Date: Thu Apr 21 14:40:53 2011
New Revision: 172831

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172831
Log:
2011-04-21  Richard Guenther  <rguenther@suse.de>

    PR middle-end/48695
    * tree-ssa-alias.c (aliasing_component_refs_p): Compute base
    objects and types here.  Adjust for their offset before
    comparing.

    * g++.dg/torture/pr48695.C: New testcase.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/torture/pr48695.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_6-branch/gcc/tree-ssa-alias.c


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

* [Bug rtl-optimization/48695] [4.6 Regression] Runtime with an array of std::vectors
  2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
                   ` (8 preceding siblings ...)
  2011-04-20 13:48 ` [Bug rtl-optimization/48695] [4.6 " rguenth at gcc dot gnu.org
@ 2011-04-21 14:42 ` rguenth at gcc dot gnu.org
  2011-04-21 14:42 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-21 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
      Known to fail|                            |4.6.0

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-21 14:40:36 UTC ---
Fixed.


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

end of thread, other threads:[~2011-04-21 14:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-19 21:25 [Bug c++/48695] New: Runtime with an array of std::vectors personal@e-maxx.ru
2011-04-19 21:34 ` [Bug tree-optimization/48695] " pinskia at gcc dot gnu.org
2011-04-19 21:40 ` pinskia at gcc dot gnu.org
2011-04-19 22:16 ` zsojka at seznam dot cz
2011-04-19 22:58 ` [Bug rtl-optimization/48695] " pinskia at gcc dot gnu.org
2011-04-19 23:02 ` [Bug rtl-optimization/48695] [4.6 Regression] " pinskia at gcc dot gnu.org
2011-04-19 23:07 ` zsojka at seznam dot cz
2011-04-20  9:26 ` [Bug rtl-optimization/48695] [4.6/4.7 " rguenth at gcc dot gnu.org
2011-04-20 13:11 ` rguenth at gcc dot gnu.org
2011-04-20 13:48 ` [Bug rtl-optimization/48695] [4.6 " rguenth at gcc dot gnu.org
2011-04-21 14:42 ` rguenth at gcc dot gnu.org
2011-04-21 14:42 ` 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).