public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/47228] New: likely improper segfault in generated code
@ 2011-01-25 23:05 LpSolit at netscape dot net
  2011-01-26  0:17 ` [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: LpSolit at netscape dot net @ 2011-01-25 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: likely improper segfault in generated code
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu
              Host: i686-pc-linux-gnu
            Target: i686-pc-linux-gnu
             Build: i686-pc-linux-gnu


regehr@home:~/volatile/bugs/tmp343$ current-gcc -O1 small.c -o small
regehr@home:~/volatile/bugs/tmp343$ ./small 
Segmentation fault
regehr@home:~/volatile/bugs/tmp343$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/mnt/z/z/compiler-install/gcc-r168608-install/libexec/gcc/i686-pc-linux-gnu/4.6.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/mnt/z/z/compiler-install/gcc-r168608-install
--program-prefix=r168608- --enable-languages=c,c++
Thread model: posix
gcc version 4.6.0 20110109 (experimental) (GCC) 
regehr@home:~/volatile/bugs/tmp343$ cat small.c


struct S4 
{
  unsigned f0:24;
} __attribute__((__packed__));

struct S4 g_10 = {
  6210831
};

struct S4 func_2 (int x)
{
  struct S4 l_8[2] = {
    {0}, {0}
  };
  g_10 = l_8[1];
  for (; x<2; x++) {
    struct S4 tmp = {
      11936567
    };
    l_8[x] = tmp;
  }
  return g_10;
}

int main (void)
{
  func_2 (0);
  return 0;
}


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
@ 2011-01-26  0:17 ` pinskia at gcc dot gnu.org
  2011-01-26  9:50 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-01-26  0:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i686-pc-linux-gnu           |i?86-pc-linux-gnu
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2011.01.26 00:09:23
          Component|c                           |tree-optimization
               Host|i686-pc-linux-gnu           |
     Ever Confirmed|0                           |1
            Summary|likely improper segfault in |[4.6 Regression] wrong code
                   |generated code              |with loop
   Target Milestone|---                         |4.6.0
              Build|i686-pc-linux-gnu           |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-01-26 00:09:23 UTC ---
Confirmed, fails also with -O2 -fno-inline (or marking func_2 as
noinline/noclone).

This is rather weird, the correct code (at the tree level even) is produced
with -m64.


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
  2011-01-26  0:17 ` [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop pinskia at gcc dot gnu.org
  2011-01-26  9:50 ` jakub at gcc dot gnu.org
@ 2011-01-26  9:50 ` jakub at gcc dot gnu.org
  2011-01-26  9:53 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-26  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-26 07:19:27 UTC ---
foo:
  subl    $16, %esp
  ... ! no other esp modifications
  movl    $11936567, 10(%esp,%ecx)        #, MEM[(struct S[2] *)D.1998_9]

overwrites part of the return value.


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
  2011-01-26  0:17 ` [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop pinskia at gcc dot gnu.org
@ 2011-01-26  9:50 ` jakub at gcc dot gnu.org
  2011-01-26  9:50 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-26  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-26 07:58:28 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164136


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (2 preceding siblings ...)
  2011-01-26  9:50 ` jakub at gcc dot gnu.org
@ 2011-01-26  9:53 ` jakub at gcc dot gnu.org
  2011-01-26 19:58 ` jamborm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-01-26  9:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |jamborm at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-26 08:28:31 UTC ---
Yeah, clearly SRA fault, as it replaces
b[x_1] = c;
where both lhs and rhs is correctly type S, i.e. 3 byte packed BLKmode
structure,
with MEM_REF store which is SImode 4 byte.


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (3 preceding siblings ...)
  2011-01-26  9:53 ` jakub at gcc dot gnu.org
@ 2011-01-26 19:58 ` jamborm at gcc dot gnu.org
  2011-01-26 21:14 ` jamborm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2011-01-26 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-01-26 18:28:17 UTC ---
OK, let me have a look at it then...


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (4 preceding siblings ...)
  2011-01-26 19:58 ` jamborm at gcc dot gnu.org
@ 2011-01-26 21:14 ` jamborm at gcc dot gnu.org
  2011-01-27 14:10 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2011-01-26 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-01-26 20:28:37 UTC ---
Created attachment 23137
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23137
untested patch


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (5 preceding siblings ...)
  2011-01-26 21:14 ` jamborm at gcc dot gnu.org
@ 2011-01-27 14:10 ` jamborm at gcc dot gnu.org
  2011-01-27 14:26 ` jamborm at gcc dot gnu.org
  2011-02-02 18:16 ` dnovillo at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2011-01-27 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-01-27 13:41:54 UTC ---
Author: jamborm
Date: Thu Jan 27 13:41:51 2011
New Revision: 169331

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169331
Log:
2011-01-27  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/47228
    * tree-sra.c (sra_modify_assign): Use build_ref_for_model instead of
    build_ref_for_offset.

    * testsuite/gcc.dg/torture/pr47228.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr47228.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (6 preceding siblings ...)
  2011-01-27 14:10 ` jamborm at gcc dot gnu.org
@ 2011-01-27 14:26 ` jamborm at gcc dot gnu.org
  2011-02-02 18:16 ` dnovillo at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jamborm at gcc dot gnu.org @ 2011-01-27 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-01-27 13:42:22 UTC ---
Fixed.


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

* [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop
  2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
                   ` (7 preceding siblings ...)
  2011-01-27 14:26 ` jamborm at gcc dot gnu.org
@ 2011-02-02 18:16 ` dnovillo at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: dnovillo at gcc dot gnu.org @ 2011-02-02 18:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Diego Novillo <dnovillo at gcc dot gnu.org> 2011-02-02 17:57:08 UTC ---
Author: dnovillo
Date: Wed Feb  2 17:57:01 2011
New Revision: 169648

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169648
Log:
2011-01-27  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/47228
    * tree-sra.c (sra_modify_assign): Use build_ref_for_model instead of
    build_ref_for_offset.

    * testsuite/gcc.dg/torture/pr47228.c: New test.

Added:
    branches/google/integration/gcc/testsuite/gcc.dg/torture/pr47228.c
Modified:
    branches/google/integration/gcc/ChangeLog
    branches/google/integration/gcc/testsuite/ChangeLog
    branches/google/integration/gcc/tree-sra.c


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

end of thread, other threads:[~2011-02-02 18:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 23:05 [Bug c/47228] New: likely improper segfault in generated code LpSolit at netscape dot net
2011-01-26  0:17 ` [Bug tree-optimization/47228] [4.6 Regression] wrong code with loop pinskia at gcc dot gnu.org
2011-01-26  9:50 ` jakub at gcc dot gnu.org
2011-01-26  9:50 ` jakub at gcc dot gnu.org
2011-01-26  9:53 ` jakub at gcc dot gnu.org
2011-01-26 19:58 ` jamborm at gcc dot gnu.org
2011-01-26 21:14 ` jamborm at gcc dot gnu.org
2011-01-27 14:10 ` jamborm at gcc dot gnu.org
2011-01-27 14:26 ` jamborm at gcc dot gnu.org
2011-02-02 18:16 ` dnovillo 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).