public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43269] possible wrong code bug
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
@ 2010-03-05 18:08 ` regehr at cs dot utah dot edu
  2010-03-05 19:08 ` [Bug tree-optimization/43269] [4.5 Regression] removing non dead store pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: regehr at cs dot utah dot edu @ 2010-03-05 18:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from regehr at cs dot utah dot edu  2010-03-05 18:08 -------
Created an attachment (id=20029)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20029&action=view)
failure-inducing input


-- 


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


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

* [Bug c/43269]  New: possible wrong code bug
@ 2010-03-05 18:08 regehr at cs dot utah dot edu
  2010-03-05 18:08 ` [Bug c/43269] " regehr at cs dot utah dot edu
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: regehr at cs dot utah dot edu @ 2010-03-05 18:08 UTC (permalink / raw)
  To: gcc-bugs

I believe the result at -O0 is correct.

regehr@john-home:~/volatile/bugs/tmp276$ current-gcc -O0 small.c -o small
regehr@john-home:~/volatile/bugs/tmp276$ ./small
-1
regehr@john-home:~/volatile/bugs/tmp276$ current-gcc -O1 small.c -o small
regehr@john-home:~/volatile/bugs/tmp276$ ./small
0
regehr@john-home:~/volatile/bugs/tmp276$ cat small.c
int g_21;
int g_211;
int g_261;

static int i, j, k, l, m;

static void func_32 (void)
{
  int * l_359[5][7][1][1][2];
  for (i = 0; i < 5; i++) {
    for (j = 0; j < 7; j++) {
      for (k = 0; k < 1; k++) {
        for (l = 0; l < 1; l++) {
          for (m = 0; m < 2; m++)
            l_359[i][j][k][l][m] = &g_211;
        }
      }
    }
  }

  if (*l_359[0][0][0][0][0]) {
  lbl_370:
    g_21 = 1;
  }

  for (g_261 = -1; g_261 > -2; g_261--) {
    if (g_211 + 1) {
      return;
    } else {
      g_21 = 1;
      goto lbl_370;
    }
  }
}

extern int printf (__const char *__restrict __format, ...);

int main(void)
{
  func_32();
  printf("%d\n", g_261);
  return 0;
}
regehr@john-home:~/volatile/bugs/tmp276$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/compiler-install/gcc-r157243-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r157243-install
--program-prefix=r157243- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20100305 (experimental) (GCC)


-- 
           Summary: possible wrong code bug
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/43269] [4.5 Regression] removing non dead store
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
  2010-03-05 18:08 ` [Bug c/43269] " regehr at cs dot utah dot edu
@ 2010-03-05 19:08 ` pinskia at gcc dot gnu dot org
  2010-03-06 14:05 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-05 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2010-03-05 19:07 -------
Tree level DSE1 removes the global store for some reason.
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |tree-optimization
     Ever Confirmed|0                           |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-05 19:07:56
               date|                            |
            Summary|possible wrong code bug     |[4.5 Regression] removing
                   |                            |non dead store
   Target Milestone|---                         |4.5.0


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


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

* [Bug tree-optimization/43269] [4.5 Regression] removing non dead store
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
  2010-03-05 18:08 ` [Bug c/43269] " regehr at cs dot utah dot edu
  2010-03-05 19:08 ` [Bug tree-optimization/43269] [4.5 Regression] removing non dead store pinskia at gcc dot gnu dot org
@ 2010-03-06 14:05 ` rguenth at gcc dot gnu dot org
  2010-03-08 13:31 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-06 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-03-06 14:05 -------
Yeah.  Mine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-03-05 19:07:56         |2010-03-06 14:05:14
               date|                            |


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


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

* [Bug tree-optimization/43269] [4.5 Regression] removing non dead store
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
                   ` (2 preceding siblings ...)
  2010-03-06 14:05 ` rguenth at gcc dot gnu dot org
@ 2010-03-08 13:31 ` rguenth at gcc dot gnu dot org
  2010-03-08 14:09 ` rguenth at gcc dot gnu dot org
  2010-03-13 17:02 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-08 13:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-03-08 13:30 -------
Subject: Bug 43269

Author: rguenth
Date: Mon Mar  8 13:30:27 2010
New Revision: 157276

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157276
Log:
2010-03-08  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43269
        * tree-ssa-dse.c (dse_possible_dead_store_p): Fix post-dom
        region detection.

        * gcc.c-torture/execute/pr43269.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/pr43269.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-dse.c


-- 


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


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

* [Bug tree-optimization/43269] [4.5 Regression] removing non dead store
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
                   ` (3 preceding siblings ...)
  2010-03-08 13:31 ` rguenth at gcc dot gnu dot org
@ 2010-03-08 14:09 ` rguenth at gcc dot gnu dot org
  2010-03-13 17:02 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-03-08 14:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2010-03-08 14:09 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/43269] [4.5 Regression] removing non dead store
  2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
                   ` (4 preceding siblings ...)
  2010-03-08 14:09 ` rguenth at gcc dot gnu dot org
@ 2010-03-13 17:02 ` hjl at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-03-13 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at gcc dot gnu dot org  2010-03-13 16:59 -------
Subject: Bug 43269

Author: hjl
Date: Sat Mar 13 16:58:19 2010
New Revision: 157426

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157426
Log:
Backport testcases from mainline.

2010-03-13  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-03-11  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/43257
        * g++.dg/torture/pr43257.C: New test.

        2010-03-11  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43255
        * gcc.c-torture/compile/pr43255.c: New testcase.

        2010-03-11  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

        * gcc.dg/pr43280.c: New testcase.

        2010-03-10  Jan Hubicka   <jh@suse.cz>

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

        2010-03-10  Andrey Belevantsev  <abel@ispras.ru>

        PR middle-end/42859
        * g++.dg/eh/pr42859.C: New test.

        2010-03-09  Jakub Jelinek  <jakub@redhat.com>

        PR debug/43299
        * gcc.dg/pr43299.c: New test.

        2010-03-08  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43269
        * gcc.c-torture/execute/pr43269.c: New testcase.

        2010-03-04  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/43164
        PR tree-optimization/43191
        * gcc.c-torture/compile/pr43164.c: New test.
        * gcc.c-torture/compile/pr43191.c: Likewise.

        2010-03-04  Changpeng Fang  <changpeng.fang@amd.com>

        PR middle-end/43209
        * gcc.dg/tree-ssa/ivopts-4.c: New.

        2010-03-03  Jakub Jelinek  <jakub@redhat.com>

        PR debug/43229
        * gfortran.dg/pr43229.f90: New test.

        PR debug/43237
        * gcc.dg/debug/dwarf2/pr43237.c: New test.

        2010-03-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/43180
        * gfortran.dg/internal_pack_10.f90: New test.

        2010-02-26  Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/43188
        * gcc.c-torture/compile/pr43188.c: New testcase.

        2010-02-25  Jakub Jelinek  <jakub@redhat.com>

        PR debug/43166
        * gfortran.dg/debug/pr43166.f: New test.

        PR debug/43165
        * gcc.dg/torture/pr43165.c: New test.

        2010-02-23  Jakub Jelinek  <jakub@redhat.com>

        PR target/43107
        * gcc.target/i386/pr43107.c: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/eh/pr42859.C
      - copied unchanged from r157425, trunk/gcc/testsuite/g++.dg/eh/pr42859.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr43257.C
      - copied unchanged from r157425,
trunk/gcc/testsuite/g++.dg/torture/pr43257.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43164.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/compile/pr43164.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43188.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/compile/pr43188.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43191.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/compile/pr43191.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43255.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/compile/pr43255.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr43288.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/compile/pr43288.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr43269.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.c-torture/execute/pr43269.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.dg/debug/dwarf2/pr43237.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43280.c
      - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/pr43280.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/pr43299.c
      - copied unchanged from r157425, trunk/gcc/testsuite/gcc.dg/pr43299.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr43165.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.dg/torture/pr43165.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.dg/tree-ssa/ivopts-4.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr43107.c
      - copied unchanged from r157425,
trunk/gcc/testsuite/gcc.target/i386/pr43107.c
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/debug/pr43166.f
      - copied unchanged from r157425,
trunk/gcc/testsuite/gfortran.dg/debug/pr43166.f
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/internal_pack_10.f90
      - copied unchanged from r157425,
trunk/gcc/testsuite/gfortran.dg/internal_pack_10.f90
    branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/pr43229.f90
      - copied unchanged from r157425,
trunk/gcc/testsuite/gfortran.dg/pr43229.f90
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2010-03-13 17:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-05 18:08 [Bug c/43269] New: possible wrong code bug regehr at cs dot utah dot edu
2010-03-05 18:08 ` [Bug c/43269] " regehr at cs dot utah dot edu
2010-03-05 19:08 ` [Bug tree-optimization/43269] [4.5 Regression] removing non dead store pinskia at gcc dot gnu dot org
2010-03-06 14:05 ` rguenth at gcc dot gnu dot org
2010-03-08 13:31 ` rguenth at gcc dot gnu dot org
2010-03-08 14:09 ` rguenth at gcc dot gnu dot org
2010-03-13 17:02 ` hjl at gcc dot gnu dot 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).