public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52943] New: likely wrong code bug
@ 2012-04-12  3:28 regehr at cs dot utah.edu
  2012-04-12  9:24 ` [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning rguenth 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-12  3:28 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52943
           Summary: likely wrong code bug
    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 r23]$ current-gcc -O2 small.c ; ./a.out 
0
[regehr@dyson r23]$ current-gcc -O3 small.c ; ./a.out 
1
[regehr@dyson r23]$ cat small.c
int printf (const char *, ...);
int a[] = { 0, 0, 0, 6 };

int b;
int
main ()
{
    for (;;)
    {
        b = 3;
        for (; b; b -= 1)
            a[b] = a[3] > 1;
        break;
    }
    printf ("%d\n", a[1]);
    return 0;
}


[regehr@dyson r23]$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r186359-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-r186359-install
--program-prefix=r186359- --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120411 (experimental) (GCC)


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

* [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning
  2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
@ 2012-04-12  9:24 ` rguenth at gcc dot gnu.org
  2012-04-12  9:25 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-12  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-04-12
          Component|c                           |tree-optimization
      Known to work|                            |4.6.3
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.7.1
            Summary|likely wrong code bug       |[4.7/4.8 Regression] likely
                   |                            |wrong code bug caused by
                   |                            |predictive commoning
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.0

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 09:23:11 UTC ---
Confirmed.  Predictive commoning again.


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

* [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning
  2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
  2012-04-12  9:24 ` [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning rguenth at gcc dot gnu.org
@ 2012-04-12  9:25 ` rguenth at gcc dot gnu.org
  2012-04-12 11:41 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-12  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 09:24:48 UTC ---
(compute_affine_dependence
  stmt_a: D.1717_2 = a[3];
  stmt_b: a[b.0_15] = D.1719_4;
(subscript_dependence_tester
(analyze_overlapping_iterations
  (chrec_a = 3)
  (chrec_b = {3, +, -1}_1)
(analyze_siv_subscript
)
  (overlap_iterations_a = no dependence
)
  (overlap_iterations_b = no dependence
)
)
(dependence classified: scev_known)
)
) -> no dependence

Obviously wrong.


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

* [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning
  2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
  2012-04-12  9:24 ` [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning rguenth at gcc dot gnu.org
  2012-04-12  9:25 ` rguenth at gcc dot gnu.org
@ 2012-04-12 11:41 ` rguenth at gcc dot gnu.org
  2012-04-12 12:52 ` rguenth at gcc dot gnu.org
  2012-04-12 12:52 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-12 11:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 11:39:12 UTC ---
Author: rguenth
Date: Thu Apr 12 11:38:47 2012
New Revision: 186374

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

    PR tree-optimization/52943
    * tree-chrec.h (chrec_is_positive): Remove.
    * tree-scalar-evolution.c (chrec_is_positive): Move ...
    * tree-data-ref.c (chrec_is_positive): ... here.  Make static.
    Return false for a constant zero instead of negative.
    (analyze_siv_subscript_cst_affine): Handle zero difference
    in the initial condition explicitely.

    * gcc.dg/torture/pr52943.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr52943.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-chrec.h
    trunk/gcc/tree-data-ref.c
    trunk/gcc/tree-scalar-evolution.c


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

* [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning
  2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
                   ` (3 preceding siblings ...)
  2012-04-12 12:52 ` rguenth at gcc dot gnu.org
@ 2012-04-12 12:52 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-12 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 12:50:54 UTC ---
Fixed.


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

* [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning
  2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2012-04-12 11:41 ` rguenth at gcc dot gnu.org
@ 2012-04-12 12:52 ` rguenth at gcc dot gnu.org
  2012-04-12 12:52 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-12 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-12 12:50:30 UTC ---
Author: rguenth
Date: Thu Apr 12 12:50:22 2012
New Revision: 186377

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

    PR tree-optimization/52943
    * tree-chrec.h (chrec_is_positive): Remove.
    * tree-scalar-evolution.c (chrec_is_positive): Move ...
    * tree-data-ref.c (chrec_is_positive): ... here.  Make static.
    Return false for a constant zero instead of negative.
    (analyze_siv_subscript_cst_affine): Handle zero difference
    in the initial condition explicitely.

    * gcc.dg/torture/pr52943.c: New testcase.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/torture/pr52943.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/gcc/tree-chrec.h
    branches/gcc-4_7-branch/gcc/tree-data-ref.c
    branches/gcc-4_7-branch/gcc/tree-scalar-evolution.c


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

end of thread, other threads:[~2012-04-12 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12  3:28 [Bug c/52943] New: likely wrong code bug regehr at cs dot utah.edu
2012-04-12  9:24 ` [Bug tree-optimization/52943] [4.7/4.8 Regression] likely wrong code bug caused by predictive commoning rguenth at gcc dot gnu.org
2012-04-12  9:25 ` rguenth at gcc dot gnu.org
2012-04-12 11:41 ` rguenth at gcc dot gnu.org
2012-04-12 12:52 ` rguenth at gcc dot gnu.org
2012-04-12 12:52 ` 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).