[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-05-04 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-04 
15:05 ---
*** Bug 21381 has been marked as a duplicate of this bug. ***

-- 
   What|Removed |Added

 CC||mick at nag dot co dot uk


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-05-02 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-05-02 15:29 
---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

On Fri, Apr 29, 2005 at 07:57:43PM -, ro at techfak dot uni-bielefeld dot 
de wrote:

> Unfortunately, even with the patch applied, the Ada bootstrap failure on
> i386-pc-solaris2.10 remains unchanged, a regression from 4.0:
> 
Would you mind filing a separate PR?  This is a different
problem.  The Ada FE is emitting a seemingly always-false
predicate that is causing VRP to create an invalid range
(http://gcc.gnu.org/ml/gcc/2005-05/msg00049.html).


Thanks.  Diego.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-04-29 21:39 
---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

On Fri, Apr 29, 2005 at 09:11:12PM -, dnovillo at redhat dot com wrote:

> Huh.  Odd.  I just finished a bootstrap with
> 
> $ configure --enable-languages=c,ada
> $ make bootstrap
> 
> on i686-pc-linux-gnu.
> 
Just reproduced it with --target=i386-pc-linux-gnu.  Thanks
Andrew P. for pointing it out.  Will take a look.


Diego.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-04-29 21:11 
---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

On Fri, Apr 29, 2005 at 07:57:43PM -, ro at techfak dot uni-bielefeld dot 
de wrote:
> 
> --- Additional Comments From ro at techfak dot uni-bielefeld dot de  
> 2005-04-29 19:57 ---
> Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with 
> -O2
> 
> Unfortunately, even with the patch applied, the Ada bootstrap failure on
> i386-pc-solaris2.10 remains unchanged, a regression from 4.0:
> 
> stage1/xgcc -Bstage1/ -B/vol/gcc/share/i386-pc-solaris2.10/bin/ -c -g -O2 
>  -gnatpg -gnata -I- -I. -Iada -I/vol/gnu/src/gcc/gcc-dist/gcc/ada 
> /vol/gnu/src/gcc/gcc-dist/gcc/ada/sem_intr.adb -o ada/sem_intr.o
> +===GNAT BUG DETECTED==+
> | 4.1.0 20050429 (experimental) (i386-pc-solaris2.10) GCC error:   |
> | in set_value_range, at tree-vrp.c:124|
> | Error detected at sem_intr.adb:437:1 |
> 
>   Rainer
> 
Huh.  Odd.  I just finished a bootstrap with

$ configure --enable-languages=c,ada
$ make bootstrap

on i686-pc-linux-gnu.


Diego.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread ro at techfak dot uni-bielefeld dot de

--- Additional Comments From ro at techfak dot uni-bielefeld dot de  
2005-04-29 19:57 ---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

Unfortunately, even with the patch applied, the Ada bootstrap failure on
i386-pc-solaris2.10 remains unchanged, a regression from 4.0:

stage1/xgcc -Bstage1/ -B/vol/gcc/share/i386-pc-solaris2.10/bin/ -c -g -O2  
-gnatpg -gnata -I- -I. -Iada -I/vol/gnu/src/gcc/gcc-dist/gcc/ada 
/vol/gnu/src/gcc/gcc-dist/gcc/ada/sem_intr.adb -o ada/sem_intr.o
+===GNAT BUG DETECTED==+
| 4.1.0 20050429 (experimental) (i386-pc-solaris2.10) GCC error:   |
| in set_value_range, at tree-vrp.c:124|
| Error detected at sem_intr.adb:437:1 |

Rainer


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread cvs-commit at gcc dot gnu dot org

--- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-29 
16:29 ---
Subject: Bug 21030

CVSROOT:/cvs/gcc
Module name:gcc
Changes by: [EMAIL PROTECTED]   2005-04-29 16:23:20

Modified files:
gcc: ChangeLog tree-vrp.c 
gcc/testsuite  : ChangeLog 
Added files:
gcc/testsuite/gcc.c-torture/compile: pr21030.c 

Log message:
gcc/
PR tree-optimization/21030
* tree-vrp.c (adjust_range_with_scev): Do not create invalid
ranges where VR->MAX is smaller than VR->MIN.

testsuite/
PR tree-optimization/21030
* gcc.dg/tree-ssa/pr21030.c: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8530&r2=2.8531
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vrp.c.diff?cvsroot=gcc&r1=2.13&r2=2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5417&r2=1.5418
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr21030.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-29 16:27 
---
Just checked in a patch.


-- 
   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-29 16:25 
---
Just checked in a patch.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-04-29 14:59 
---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

On Fri, Apr 29, 2005 at 02:55:58PM -, kazu at cs dot umass dot edu wrote:

> I have not sent my current patch to gcc-patches@ yet because I have
> not finished testing it.  This time I will unless you beat me to it.
> 
Oh, OK.  No, that's fine.  I'm now analyzing the test case.  I'll
check out your patch in a little while, if it matches what I
found, then it's OK to go in.


Diego.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-29 14:55 
---
Subject: Re:  [4.1 Regression] ICE in
 set_value_range building 176.gcc with -O2

Hi Diego,

> Kazu, did you mail your patch before attaching it to bugzilla?  I
> haven't received it.  The same thing happened to your previous
> patch for this PR and I missed it the first time.

No, I did not send my previous to gcc-patches@ because I was not fully
satified with it.  Although I tested the patch, it broke pr18178.C,
and I did not analyze the failure at that time.

I have not sent my current patch to gcc-patches@ yet because I have
not finished testing it.  This time I will unless you beat me to it.

Kazu Hirata


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-29 14:35 
---
Diego, no, I don't mind.

But I have a patch whose bootstrap is almost over and
regression testing is about to start.

This patch does not break g++dg/tree-ssa/pr18178.C unlike my previous patch.

Let me attach my patch (and some analysis) just FWIW.



-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread dnovillo at gcc dot gnu dot org

--- Additional Comments From dnovillo at gcc dot gnu dot org  2005-04-29 
14:16 ---

Working on it today.  Kazu, I hope you don't mind if I take it?

-- 
   What|Removed |Added

 AssignedTo|kazu at cs dot umass dot edu|dnovillo at gcc dot gnu dot
   ||org


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-29 Thread fxcoudert at gcc dot gnu dot org

--- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-29 
14:11 ---
This breaks BLAS (optimzation >= -O2), the major Fortran library. The whole
fortran front-end is useless in this state.

-- 
   What|Removed |Added

 CC||fxcoudert at gcc dot gnu dot
   ||org
   Last reconfirmed|2005-04-14 20:44:19 |2005-04-29 14:11:54
   date||


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-28 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-28 19:33 
---
Diego,

I think it's OK to have contradictory information from an ASSERT_EXPR and
SCEV.

Let's say we have a loop counting from i = 0 upward.

It's possible that we "if (i < 0)" in the loop and see something like

  i_10 = ASSERT_EXPR ;

on the "then" arm of the conditional.  In this case, we know we are
counting upward, so SCEV tells us that the minimum value of i_10
should be 0, but the ASSERT_EXPR tells us that the range should be
[-INF, -1].  They are completely disjoint!

This weird situation comes from the fact that the "then" branch of the
conditional is dead.  In this case, probably the safest and simplest
thing to do is to ignoring what SCEV says.

Kazu Hirata


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-24 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-24 14:02 
---
I just went through the regression testing.  I get

FAIL: g++.dg/tree-ssa/pr18178.C scan-tree-dump-times if  1

It may be a good idea to check in this patch with the above testcase
XFAILed.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread dnovillo at redhat dot com

--- Additional Comments From dnovillo at redhat dot com  2005-04-23 15:46 
---
Subject: Re:  [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

On Sat, Apr 23, 2005 at 03:11:52PM -, kargl at gcc dot gnu dot org wrote:
> 
> --- Additional Comments From kargl at gcc dot gnu dot org  2005-04-23 
> 15:11 ---
> (In reply to comment #13)
> > 
> > I would like to, but currently my patch causes a regression in one of
> > the VRP testcases.
> > 
Kazu, which test case is this?  Send me details?  I'll look at
this next week.  In the meantime, I would rather have sub-optimal
code than a broken FE.


> I haven't checked 4.0.0 against my Fortran
> testsuite; hopefully, this problem isn't present in 
> gfortran's first exposure to the world.
> 
No.  VRP is a 4.1 feature.


Diego.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-23 
15:15 ---
(In reply to comment #14)
> I haven't checked 4.0.0 against my Fortran
> testsuite; hopefully, this problem isn't present in 
> gfortran's first exposure to the world.
It cannot be in 4.0.0 as the VRP code was just added in the last couple weeks.

-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread kargl at gcc dot gnu dot org

--- Additional Comments From kargl at gcc dot gnu dot org  2005-04-23 15:11 
---
(In reply to comment #13)
> 
> I would like to, but currently my patch causes a regression in one of
> the VRP testcases.
> 

Not to sound like an idiot, but how likely is this one VRP
testcase to show up in real world code.  Because without
this patch, gfortran is pretty much useless on most real
world code.  I haven't checked 4.0.0 against my Fortran
testsuite; hopefully, this problem isn't present in 
gfortran's first exposure to the world.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-23 14:13 
---
Subject: Re:  [4.1 Regression] ICE in
 set_value_range building 176.gcc with -O2

Hi Toon,

> > Kazu, I just tried the patch, pr21030-vrp-ice.patch.
> > It seems to fix the problems with gfortran and -O2.
> 
> Kazu, could you propose your patch on gcc-patches or ping it ?  Without this
> patch I won't be able to do any testing for my GCC Summit paper (deadline 1st 
> of
> May).

I would like to, but currently my patch causes a regression in one of
the VRP testcases.  I have not checked if the failure is a real one or
not.  That is, it's plausible that we are looking for an optimization
that should not happen.

Kazu Hirata


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread dnovillo at gcc dot gnu dot org

--- Additional Comments From dnovillo at gcc dot gnu dot org  2005-04-23 
13:18 ---
(In reply to comment #5)
> A comment in the patch says "Tested on i686-pc-linux-gnu", but
> it just means that it will have been tested by the time I post this patch. :-)
> 
Patch looks fine.  OK to install if it passes the usual testing.

It's odd that I don't seem to have received this patch.  Did you ever post it?


Diego.

-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread toon at moene dot indiv dot nluug dot nl

--- Additional Comments From toon at moene dot indiv dot nluug dot nl  
2005-04-23 10:58 ---
(In reply to comment #10)

> Kazu, I just tried the patch, pr21030-vrp-ice.patch.
> It seems to fix the problems with gfortran and -O2.

Kazu, could you propose your patch on gcc-patches or ping it ?  Without this
patch I won't be able to do any testing for my GCC Summit paper (deadline 1st of
May).

Thanks in advance.

-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread kargl at gcc dot gnu dot org

--- Additional Comments From kargl at gcc dot gnu dot org  2005-04-22 23:03 
---
Kazu, I just tried the patch, pr21030-vrp-ice.patch.
It seems to fix the problems with gfortran and -O2.

-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-23 Thread kargl at gcc dot gnu dot org

--- Additional Comments From kargl at gcc dot gnu dot org  2005-04-22 22:34 
---
This is a shorter version of the Fortran code.  The bug is now
critical to gfortran because almost all Fortran codes contain
nested do loops.

  SUBROUTINE CHER2K(N, C, LDC)

  INTEGER I, J, N, LDC
  COMPLEX C(LDC,*)

  DO 20, J = 1, N
 DO 10, I = 1, J
C(I,J) = (0.0E+0, 0.0E+0)
   10CONTINUE
   20 CONTINUE
  END

-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-22 Thread tobi at gcc dot gnu dot org

--- Additional Comments From tobi at gcc dot gnu dot org  2005-04-22 19:36 
---
Another testcase for something which looks like the same bug, this time in
Fortran (reduced from LAPACK by Steve Kargl):
  SUBROUTINE CHER2K(N, BETA, C, LDC)

  INTEGER I, J, N, LDC
  REAL BETA
  COMPLEX C(LDC,*), ZERO

  PARAMETER (ZERO = (0.0E+0, 0.0E+0))

  IF (BETA .EQ. REAL(ZERO)) THEN
 DO 20, J = 1, N
DO 10, I = 1, J
   C(I,J) = ZERO
   10   CONTINUE
   20CONTINUE
  ELSE
 DO 40, J = 1, N
DO 30, I = 1, J - 1
   C(I,J) = BETA * C(I,J)
   30   CONTINUE
   40CONTINUE
  END IF
  END


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-20 Thread ro at gcc dot gnu dot org

--- Additional Comments From ro at gcc dot gnu dot org  2005-04-20 16:42 
---
I observe the same ICE when bootstrapping with Ada on i386-pc-solaris2.10:

stage1/xgcc -Bstage1/ -B/vol/gcc/share/i386-pc-solaris2.10/bin/ -c -g -O2 
-gnatpg -gnata -I- -I. -Iada -I/vol/gnu/src/gcc/gcc-dist/gcc/ada
/vol/gnu/src/gcc/gcc-dist/gcc/ada/sem_intr.adb -o ada/sem_intr.o
+===GNAT BUG DETECTED==+
| 4.1.0 20050419 (experimental) (i386-pc-solaris2.10) GCC error:   |
| in set_value_range, at tree-vrp.c:124|
| Error detected at sem_intr.adb:437:1 |

Unfortunately, the proposed patch doesn't fix this.

-- 
   What|Removed |Added

 CC||ro at gcc dot gnu dot org


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-19 Thread wanderer at rsu dot ru

--- Additional Comments From wanderer at rsu dot ru  2005-04-19 20:08 
---
Proposed patch (in #4) work fine at FreeBSD 5.1

And fix my tescase variant:

__inline void f(int a)
{
  int i;

  if (a < 0) {
for (i = 0, a = ~a; a; i++) {
  if ((a & 1) != 0) {
f(i);
  }
}
  }
}

void g(void) { f(0); }

Without proposed patch i can't bootstrap LLVM using gcc CVS mainline.
bootstrap die at build of gcc version 3.4-llvm 20030924 (part of LLVM 
distribution):

gcc/haifa-sched.c:737: internal compiler error: in set_value_range, at tree-
vrp.c:124

Note: haifa-sched.c isn't modified.


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-14 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-14 23:02 
---
A comment in the patch says "Tested on i686-pc-linux-gnu", but
it just means that it will have been tested by the time I post this patch. :-)


-- 


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-14 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-14 23:01 
---
Created an attachment (id=8638)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8638&action=view)
patch


-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |kazu at cs dot umass dot edu
   |dot org |
 Status|NEW |ASSIGNED


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-14 Thread kazu at cs dot umass dot edu

--- Additional Comments From kazu at cs dot umass dot edu  2005-04-14 22:14 
---
Reduced down to:

void
foo (int unit)
{
  int i;

  for (i = 0; unit; i++, unit--)
{
  if (i >= 0)
{
  int j = i;
  while (j)
j--;
}
}
}


-- 
   What|Removed |Added

 CC||kazu at cs dot umass dot edu


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


[Bug tree-optimization/21030] [4.1 Regression] ICE in set_value_range building 176.gcc with -O2

2005-04-14 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-14 
20:44 ---
Confirmed, also happens on i686-pc-linux-gnu.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Keywords||ice-on-valid-code
   Last reconfirmed|-00-00 00:00:00 |2005-04-14 20:44:19
   date||
Summary|ICE in set_value_range  |[4.1 Regression] ICE in
   |building 176.gcc with -O2   |set_value_range building
   ||176.gcc with -O2
   Target Milestone|--- |4.1.0


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