public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53163] New: crash due to null ptr deref
@ 2012-04-30  5:09 regehr at cs dot utah.edu
  2012-04-30  7:03 ` [Bug tree-optimization/53163] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: regehr at cs dot utah.edu @ 2012-04-30  5:09 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53163
           Summary: crash due to null ptr deref
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu
                CC: chenyang@cs.utah.edu


[regehr@dyson r43]$ current-gcc -c -O3 small.c
small.c: In function 'fn2':
small.c:22:1: internal compiler error: Segmentation fault
 fn2 ()
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[regehr@dyson r43]$ cat small.c
struct
{
    int f0;
} b, f;
int a, c;
void
fn1 ()
{
    int d, e;
    d = 4;
    for (; d < 19; ++d)
    {
        e = 2;
        for (; e >= 0; e--)
        {
            a = 0;
            a = 1;
        }
    }
}
void
fn2 ()
{
    int g, h, i;
    i = 1;
    for (; i >= 0; i--)
    {
        b = f;
        g = 0;
        for (; g <= 1; g++)
        {
            if (c)
                break;
            h = 0;
            for (; h <= 1; h++)
                fn1 ();
            fn1 ();
        }
    }
}
[regehr@dyson r43]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r186946-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r186946-install
--program-prefix=r186946- --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120429 (experimental) (GCC)


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

* [Bug tree-optimization/53163] [4.7/4.8 Regression] crash due to null ptr deref
  2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
@ 2012-04-30  7:03 ` jakub at gcc dot gnu.org
  2012-04-30  7:25 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-04-30  7:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-04-30
          Component|c                           |tree-optimization
                 CC|                            |jakub at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1
            Summary|crash due to null ptr deref |[4.7/4.8 Regression] crash
                   |                            |due to null ptr deref
   Target Milestone|---                         |4.7.1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-04-30 07:01:55 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183624
I think the bug is that cond_if_else_store_replacement is ignoring return value
from compute_all_dependences.


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

* [Bug tree-optimization/53163] [4.7/4.8 Regression] crash due to null ptr deref
  2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
  2012-04-30  7:03 ` [Bug tree-optimization/53163] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
@ 2012-04-30  7:25 ` jakub at gcc dot gnu.org
  2012-05-02  9:55 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-04-30  7:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-04-30 07:24:44 UTC ---
Created attachment 27264
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27264
gcc48-pr53163.patch

Untested fix.


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

* [Bug tree-optimization/53163] [4.7/4.8 Regression] crash due to null ptr deref
  2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
  2012-04-30  7:03 ` [Bug tree-optimization/53163] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
  2012-04-30  7:25 ` jakub at gcc dot gnu.org
@ 2012-05-02  9:55 ` jakub at gcc dot gnu.org
  2012-05-02  9:57 ` jakub at gcc dot gnu.org
  2012-05-02 10:24 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-02  9:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-02 09:55:36 UTC ---
Author: jakub
Date: Wed May  2 09:55:32 2012
New Revision: 187038

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187038
Log:
    PR tree-optimization/53163
    * tree-ssa-phiopt.c (cond_if_else_store_replacement): Don't ignore
    return value from compute_all_dependences.

    * gcc.c-torture/compile/pr53163.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr53163.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-phiopt.c


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

* [Bug tree-optimization/53163] [4.7/4.8 Regression] crash due to null ptr deref
  2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2012-05-02  9:55 ` jakub at gcc dot gnu.org
@ 2012-05-02  9:57 ` jakub at gcc dot gnu.org
  2012-05-02 10:24 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-02  9:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-02 09:56:43 UTC ---
Author: jakub
Date: Wed May  2 09:56:39 2012
New Revision: 187039

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187039
Log:
    PR tree-optimization/53163
    * tree-ssa-phiopt.c (cond_if_else_store_replacement): Don't ignore
    return value from compute_all_dependences.

    * gcc.c-torture/compile/pr53163.c: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.c-torture/compile/pr53163.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/gcc/tree-ssa-phiopt.c


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

* [Bug tree-optimization/53163] [4.7/4.8 Regression] crash due to null ptr deref
  2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
                   ` (3 preceding siblings ...)
  2012-05-02  9:57 ` jakub at gcc dot gnu.org
@ 2012-05-02 10:24 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-05-02 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-05-02 10:23:54 UTC ---
Fixed.


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

end of thread, other threads:[~2012-05-02 10:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30  5:09 [Bug c/53163] New: crash due to null ptr deref regehr at cs dot utah.edu
2012-04-30  7:03 ` [Bug tree-optimization/53163] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
2012-04-30  7:25 ` jakub at gcc dot gnu.org
2012-05-02  9:55 ` jakub at gcc dot gnu.org
2012-05-02  9:57 ` jakub at gcc dot gnu.org
2012-05-02 10:24 ` jakub 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).