public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c
@ 2005-09-30  9:58 rguenth at gcc dot gnu dot org
  2005-09-30 10:20 ` [Bug tree-optimization/24142] " rguenth at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-30  9:58 UTC (permalink / raw)
  To: gcc-bugs

For the following testcase reduced from inflate.c

int bar(void);
int foobar(void);
static unsigned dbits = 6;
int foo(void)
{
  int retval;
  unsigned bd;
  unsigned nl;

  bd = dbits;
  retval = bar();
  if (retval == 1)
    retval = 0;
  if (bd == 0 && nl > 257)
    retval = 1;
  if (retval)
    return retval;

  return foobar();
}

VRP removes the call to foobar() because it thinks it can fold the
last comparison:
Folding predicate retval_2 != 0 to 1

-- 
           Summary: VRP miscompiles unzip inflate.c
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 23968
             nThis:


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


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

* [Bug tree-optimization/24142] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
@ 2005-09-30 10:20 ` rguenth at gcc dot gnu dot org
  2005-09-30 11:54 ` [Bug tree-optimization/24142] [4.1 regression] " belyshev at depni dot sinp dot msu dot ru
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-30 10:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-30 10:19 -------
Slightly reduced:

int bar(void);
int foobar(void);
extern unsigned bd;
int foo(void)
{
  int retval = bar();
  if (retval == 1)
    retval = 0;
  if (bd == 0)
    retval = 1;
  if (retval)
    return retval;

  return foobar();
}


-- 


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


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

* [Bug tree-optimization/24142] [4.1 regression] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
  2005-09-30 10:20 ` [Bug tree-optimization/24142] " rguenth at gcc dot gnu dot org
@ 2005-09-30 11:54 ` belyshev at depni dot sinp dot msu dot ru
  2005-09-30 13:46 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-09-30 11:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-09-30 11:54 -------
This is really a dup of bug 24141.

*** This bug has been marked as a duplicate of 24141 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE
            Summary|VRP miscompiles unzip       |[4.1 regression] VRP
                   |inflate.c                   |miscompiles unzip inflate.c
   Target Milestone|---                         |4.1.0


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


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

* [Bug tree-optimization/24142] [4.1 regression] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
  2005-09-30 10:20 ` [Bug tree-optimization/24142] " rguenth at gcc dot gnu dot org
  2005-09-30 11:54 ` [Bug tree-optimization/24142] [4.1 regression] " belyshev at depni dot sinp dot msu dot ru
@ 2005-09-30 13:46 ` steven at gcc dot gnu dot org
  2005-10-01 15:24 ` belyshev at depni dot sinp dot msu dot ru
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-09-30 13:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-09-30 13:46 -------
I'm not so sure that this is a dup.  Bug 24141 is a wrong-code problem, 
and this is an ICE.  Just the fact that the same test case triggers both 
bugs doesn't mean they are the same problem. 
 
 

-- 


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


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

* [Bug tree-optimization/24142] [4.1 regression] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-09-30 13:46 ` steven at gcc dot gnu dot org
@ 2005-10-01 15:24 ` belyshev at depni dot sinp dot msu dot ru
  2005-10-01 15:26 ` belyshev at depni dot sinp dot msu dot ru
  2005-10-01 15:27 ` dnovillo at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-10-01 15:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-10-01 15:24 -------
(In reply to comment #3)
> I'm not so sure that this is a dup.  Bug 24141 is a wrong-code problem, 
> and this is an ICE.  Just the fact that the same test case triggers both 
> bugs doesn't mean they are the same problem. 
>  
>  

You are right, this is not a dup. original testcase still fails even after bug
24141 fixed:

void abort (void);

int f (int a, int b)
{
  if (a == 1)
    a = 0;
  if (b == 0)
    a = 1;
  if (a != 0)
    return 0;
  return 1;
}

int main (void)
{
  if (f (1, 1) != 1)
    abort ();
  return 0;
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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

* [Bug tree-optimization/24142] [4.1 regression] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-10-01 15:24 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-10-01 15:26 ` belyshev at depni dot sinp dot msu dot ru
  2005-10-01 15:27 ` dnovillo at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-10-01 15:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-10-01 15:26 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-01 15:26:51
               date|                            |


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


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

* [Bug tree-optimization/24142] [4.1 regression] VRP miscompiles unzip inflate.c
  2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-10-01 15:26 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-10-01 15:27 ` dnovillo at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2005-10-01 15:27 UTC (permalink / raw)
  To: gcc-bugs



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


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


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

end of thread, other threads:[~2005-10-01 15:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30  9:58 [Bug tree-optimization/24142] New: VRP miscompiles unzip inflate.c rguenth at gcc dot gnu dot org
2005-09-30 10:20 ` [Bug tree-optimization/24142] " rguenth at gcc dot gnu dot org
2005-09-30 11:54 ` [Bug tree-optimization/24142] [4.1 regression] " belyshev at depni dot sinp dot msu dot ru
2005-09-30 13:46 ` steven at gcc dot gnu dot org
2005-10-01 15:24 ` belyshev at depni dot sinp dot msu dot ru
2005-10-01 15:26 ` belyshev at depni dot sinp dot msu dot ru
2005-10-01 15:27 ` 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).