Bug 37078 - [4.4 Regression] ICE in set_value_range, at tree-vrp.c:401 when compiling gmp 4.2.3
Summary: [4.4 Regression] ICE in set_value_range, at tree-vrp.c:401 when compiling gmp...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P2 normal
Target Milestone: 4.4.0
Assignee: Richard Biener
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-08-11 07:35 UTC by macius bat
Modified: 2008-08-22 21:13 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2008-08-22 19:25:47


Attachments
the preprocessed c++ source file (90.42 KB, text/plain)
2008-08-11 13:37 UTC, macius bat
Details
reduced testcase (877 bytes, text/plain)
2008-08-11 16:09 UTC, Richard Biener
Details

Note You need to log in before you can comment on or make changes to this bug.
Description macius bat 2008-08-11 07:35:02 UTC
gcc -v
gcc version 4.4.0 20080810 (experimental) (GCC) 


g++ -DHAVE_CONFIG_H -I. -I../../../tests/cxx -I../.. -I../../.. -I../../../tests -O2 -c -o t-ops.o ../../../tests/cxx/t-ops.cc
../../../tests/cxx/t-ops.cc: In function 'void check_mpz()':
../../../tests/cxx/t-ops.cc:33: internal compiler error: in set_value_range, at tree-vrp.c:396
Please submit a full bug report,with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 pinskia@gmail.com 2008-08-11 10:26:58 UTC
Subject: Re:   New: ICE when compiling gmp 4.2.3



Sent from my iPhone

On Aug 11, 2008, at 0:35, "linuxl4 at sohu dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> gcc -v
> gcc version 4.4.0 20080810 (experimental) (GCC)
>
>
> g++ -DHAVE_CONFIG_H -I. -I../../../tests/cxx -I../.. -I../../..
> -I../../../tests -O2 -c -o t-ops.o ../../../tests/cxx/t-ops.cc
> ../../../tests/cxx/t-ops.cc: In function 'void check_mpz()':
> ../../../tests/cxx/t-ops.cc:33: internal compiler error: in  
> set_value_range, at
> tree-vrp.c:396
> Please submit a full bug report,with preprocessed source if  
> appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.

Can you attach the preprocessed source as requested by the error  
message?

-- Pinski

>
>
>
> -- 
>           Summary: ICE when compiling gmp 4.2.3
>           Product: gcc
>           Version: 4.4.0
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: middle-end
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: linuxl4 at sohu dot com
> 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=37078
>
Comment 2 macius bat 2008-08-11 13:37:35 UTC
Created attachment 16051 [details]
the preprocessed c++ source file

gcc -v
gcc version 4.4.0 20080810 (experimental) (GCC) 


g++ -O2 -c t-ops.cc -o t-ops.o
../../../tests/cxx/t-ops.cc: In function 'void check_mpz()':
../../../tests/cxx/t-ops.cc:33: internal compiler error: in set_value_range, at tree-vrp.c:396
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 3 Richard Biener 2008-08-11 14:56:35 UTC
Reducing.
Comment 4 Richard Biener 2008-08-11 16:09:24 UTC
Created attachment 16052 [details]
reduced testcase
Comment 5 Richard Biener 2008-08-11 16:10:34 UTC
Confirmed.  (-O2 -m32)

#1  0x0000000000c288e4 in set_value_range (vr=0x7fffffffd5e0, t=VR_RANGE, 
    min=0x7ffff73c52d0, max=0x7ffff73c5300, equiv=0x0)
    at /space/rguenther/src/svn/trunk/gcc/tree-vrp.c:395
395             gcc_assert (!is_overflow_infinity (min)
(gdb) l
390
391           cmp = compare_values (min, max);
392           gcc_assert (cmp == 0 || cmp == -1 || cmp == -2);
393
394           if (needs_overflow_infinity (TREE_TYPE (min)))
395             gcc_assert (!is_overflow_infinity (min)
396                         || !is_overflow_infinity (max));
397         }
398
399       if (t == VR_UNDEFINED || t == VR_VARYING)
(gdb) call debug_tree (min)   
 <integer_cst 0x7ffff73c52d0 type <integer_type 0x7ffff7ebb840 long int> constant public overflow 2147483647>
(gdb) call debug_tree (max)
 <integer_cst 0x7ffff73c5300 type <integer_type 0x7ffff7ebb840 long int> constant public overflow 2147483647>
Comment 6 Jack Howarth 2008-08-11 17:34:44 UTC
Is there a particular revision that this appeared in? I built a svn pull from gcc trunk on 20080808 (using the optabs fix that has since been checked in) against
gmp 4.2.3 on i686-apple-darwin9 and didn't see any build issues.
Comment 7 macius bat 2008-08-12 02:11:20 UTC
>Is there a particular revision that this appeared in? I built a svn pull from
>gcc trunk on 20080808 (using the optabs fix that has since been checked in)
>against
>gmp 4.2.3 on i686-apple-darwin9 and didn't see any build issues.

this happens when "make check".

please try.
Comment 8 Richard Biener 2008-08-22 19:25:47 UTC
I have a patch.
Comment 9 Richard Biener 2008-08-22 21:13:50 UTC
Fixed.
Comment 10 Richard Biener 2008-08-22 21:14:21 UTC
Subject: Bug 37078

Author: rguenth
Date: Fri Aug 22 21:13:00 2008
New Revision: 139501

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

	PR tree-optimization/37078
	* tree-vrp.c (extract_range_from_unary_expr): Avoid generating
	[+INF, +INF] ranges.

	* gcc.c-torture/compile/pr37078.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr37078.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-transform.c