public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
@ 2005-10-03  0:43 ` pinskia at gcc dot gnu dot org
  2005-10-03  2:39 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-03  0:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-10-03 00:43 -------
I just tried to bootstrap the patch on x86_64-linux-gnu and I think I ran into
another VRP bug.


-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
  2005-10-03  0:43 ` [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1] pinskia at gcc dot gnu dot org
@ 2005-10-03  2:39 ` pinskia at gcc dot gnu dot org
  2005-10-04 19:44 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-03  2:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2005-10-03 02:39 -------
(In reply to comment #5)
> I just tried to bootstrap the patch on x86_64-linux-gnu and I think I ran into
> another VRP bug.
I could not find it in cc1files and there was only one extra "Folding
predicate" in the whole cc1files :(.
I know it is in the gnat1 front-end but I really don't want to do the dumps for
that :(.


-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
  2005-10-03  0:43 ` [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1] pinskia at gcc dot gnu dot org
  2005-10-03  2:39 ` pinskia at gcc dot gnu dot org
@ 2005-10-04 19:44 ` pinskia at gcc dot gnu dot org
  2005-10-23  0:06 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-04 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2005-10-04 19:44 -------
(In reply to comment #6)
> I know it is in the gnat1 front-end but I really don't want to do the dumps for
> that :(.

I figured out how to fix the problem but to me it seems like a front-end bug in
that it does not set TREE_PRECISSION on its boolean type correctly.


-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-04 19:44 ` pinskia at gcc dot gnu dot org
@ 2005-10-23  0:06 ` pinskia at gcc dot gnu dot org
  2006-08-21  6:11 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-23  0:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2005-10-23 00:06 -------
The patch above is almost correct and I just lost the correct one as my laptop
is dead so I am no longer working on this.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-10-23  0:06 ` pinskia at gcc dot gnu dot org
@ 2006-08-21  6:11 ` pinskia at gcc dot gnu dot org
  2007-01-07 17:44 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-21  6:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-08-21 06:11 -------
I am going to try to get this done for 4.3.0.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-08-21  6:11 ` pinskia at gcc dot gnu dot org
@ 2007-01-07 17:44 ` rguenth at gcc dot gnu dot org
  2007-01-08 11:20 ` rguenth at gcc dot gnu dot org
  2007-01-08 11:21 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-07 17:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2007-01-07 17:44 -------
In extract_range_from_binary we have another case where we drop to varying:

  /* For integer ranges, apply the operation to each end of the
     range and see what we end up with.  */
  if (code == TRUTH_ANDIF_EXPR
      || code == TRUTH_ORIF_EXPR
      || code == TRUTH_AND_EXPR
      || code == TRUTH_OR_EXPR)
    {
...
      else
        {
          set_value_range_to_varying (vr);
          return;
        }
    }

But the latent problems seem to be fixed, the following (simple) patch
bootstrapped and regtested ok for me:

*************** extract_range_from_comparison (value_ran
*** 1920,1926 ****
        set_value_range (vr, VR_RANGE, val, val, vr->equiv);
      }
    else
!     set_value_range_to_varying (vr);
  }


--- 1925,1933 ----
        set_value_range (vr, VR_RANGE, val, val, vr->equiv);
      }
    else
!     /* The result of a comparison is always true or false.  */
!     set_value_range (vr, VR_RANGE, build_int_cst (TREE_TYPE (expr), 0),
!                    build_int_cst (TREE_TYPE (expr), 1), vr->equiv);
  }


-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2007-01-07 17:44 ` rguenth at gcc dot gnu dot org
@ 2007-01-08 11:20 ` rguenth at gcc dot gnu dot org
  2007-01-08 11:21 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-08 11:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from rguenth at gcc dot gnu dot org  2007-01-08 11:20 -------
Subject: Bug 23603

Author: rguenth
Date: Mon Jan  8 11:20:00 2007
New Revision: 120578

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

        PR tree-optimization/23603
        * tree-vrp.c (set_value_range_to_truthvalue): New function.
        (extract_range_from_binary): Fall back to truthvalue instead of
        varying for TRUTH_*_EXPR.
        (extract_range_from_comparison): Fall back to truthvalue instead of
        varying.
        (vrp_visit_phi_node): Don't adjust new range bounds to +INF/-INF
        if all visited PHI values were constant.

        * gcc.dg/tree-ssa/vrp31.c: New testcase.
        * gcc.dg/tree-ssa/vrp32.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp31.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/vrp32.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vrp.c


-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
       [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2007-01-08 11:20 ` rguenth at gcc dot gnu dot org
@ 2007-01-08 11:21 ` rguenth at gcc dot gnu dot org
  7 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-08 11:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2007-01-08 11:21 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
  2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-08-29  2:14 ` pinskia at gcc dot gnu dot org
@ 2005-10-01 14:19 ` dnovillo at gcc dot gnu dot org
  4 siblings, 0 replies; 13+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-10-01 14:19 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 23603 depends on bug 23604, which changed state.

Bug 23604 Summary: [4.1 Regression] wrong code due to VRP
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23604

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
  2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-08-28 19:43 ` pinskia at gcc dot gnu dot org
@ 2005-08-29  2:14 ` pinskia at gcc dot gnu dot org
  2005-10-01 14:19 ` dnovillo at gcc dot gnu dot org
  4 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-29  2:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-29 00:49 -------
This really does depend on PR 23604 as it exposes that latent bug while bootstrapping.

-- 


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
  2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
  2005-08-28 17:25 ` [Bug tree-optimization/23603] " pinskia at gcc dot gnu dot org
  2005-08-28 18:03 ` pinskia at gcc dot gnu dot org
@ 2005-08-28 19:43 ` pinskia at gcc dot gnu dot org
  2005-08-29  2:14 ` pinskia at gcc dot gnu dot org
  2005-10-01 14:19 ` dnovillo at gcc dot gnu dot org
  4 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 19:43 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |23604


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
  2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
  2005-08-28 17:25 ` [Bug tree-optimization/23603] " pinskia at gcc dot gnu dot org
@ 2005-08-28 18:03 ` pinskia at gcc dot gnu dot org
  2005-08-28 19:43 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 18:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 17:25 -------
I have a fix.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-28 17:25:25
               date|                            |


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


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

* [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
  2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
@ 2005-08-28 17:25 ` pinskia at gcc dot gnu dot org
  2005-08-28 18:03 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-28 17:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-28 17:22 -------
The fix would be instead of setting the range to varrying in extract_range_from_comparison, set it to 
[0,1].

-- 


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


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

end of thread, other threads:[~2007-01-08 11:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-23603-6528@http.gcc.gnu.org/bugzilla/>
2005-10-03  0:43 ` [Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1] pinskia at gcc dot gnu dot org
2005-10-03  2:39 ` pinskia at gcc dot gnu dot org
2005-10-04 19:44 ` pinskia at gcc dot gnu dot org
2005-10-23  0:06 ` pinskia at gcc dot gnu dot org
2006-08-21  6:11 ` pinskia at gcc dot gnu dot org
2007-01-07 17:44 ` rguenth at gcc dot gnu dot org
2007-01-08 11:20 ` rguenth at gcc dot gnu dot org
2007-01-08 11:21 ` rguenth at gcc dot gnu dot org
2005-08-28 17:22 [Bug tree-optimization/23603] New: " pinskia at gcc dot gnu dot org
2005-08-28 17:25 ` [Bug tree-optimization/23603] " pinskia at gcc dot gnu dot org
2005-08-28 18:03 ` pinskia at gcc dot gnu dot org
2005-08-28 19:43 ` pinskia at gcc dot gnu dot org
2005-08-29  2:14 ` pinskia at gcc dot gnu dot org
2005-10-01 14:19 ` dnovillo 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).