This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/42665] Internal compiler exception in with gfortran when using -fwhole-program -flto -fopenmp
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jan 2010 22:45:24 -0000
- Subject: [Bug lto/42665] Internal compiler exception in with gfortran when using -fwhole-program -flto -fopenmp
- References: <bug-42665-12362@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenther at suse dot de 2010-01-08 22:45 -------
Subject: Re: Internal compiler exception in with gfortran
when using -fwhole-program -flto -fopenmp
On Fri, 8 Jan 2010, jjcogliati-r1 at yahoo dot com wrote:
> ------- Comment #5 from jjcogliati-r1 at yahoo dot com 2010-01-08 22:28 -------
> (In reply to comment #4)
> > Subject: Re: Internal compiler exception in with gfortran
> > when using -fwhole-program -flto -fopenmp
> >
> > On Fri, 8 Jan 2010, jjcogliati-r1 at yahoo dot com wrote:
> >
> > > ------- Comment #3 from jjcogliati-r1 at yahoo dot com 2010-01-08 21:38 -------
> > > (In reply to comment #1)
> > > > Can you run it in a debugger and print what 'code' actually is? Can you
> > > > check if removing -g fixes the ICE?
> > > >
> > >
> > > Code is:
> > > ERROR_MARK
> >
> > Hm, ok. I guess we need a testcase anyway. A tarball with all
> > preprocessed sources is probably enough. You can also try reducing
> > the set of files required by performing incremental linking with
> > -r and omit files one-by-one.
> >
> > Richard.
> >
>
> (gdb) p *t
> $16 = {base = {code = ERROR_MARK, side_effects_flag = 0, constant_flag = 0,
> addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
> unsigned_flag = 0, asm_written_flag = 0, nowarning_flag = 0,
> used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0,
> private_flag = 0, protected_flag = 0, deprecated_flag = 0,
> saturating_flag = 0, default_def_flag = 0, lang_flag_0 = 0,
> lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0,
> lang_flag_5 = 0, lang_flag_6 = 0, visited = 0, packed_flag = 0,
> user_align = 0, spare = 0, address_space = 0}, common = {base = {
> code = ERROR_MARK, side_effects_flag = 0, constant_flag = 0,
> addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
> unsigned_flag = 0, asm_written_flag = 0, nowarning_flag = 0,
> used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0,
> private_flag = 0, protected_flag = 0, deprecated_flag = 0,
> saturating_flag = 0, default_def_flag = 0, lang_flag_0 = 0,
> lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0,
> lang_flag_5 = 0, lang_flag_6 = 0, visited = 0, packed_flag = 0,
> user_align = 0, spare = 0, address_space = 0}, chain = 0x0,
>
> if we go up 1 to:
> (gdb) up
> #1 0x00000000005ee1cc in iterative_hash_gimple_type (type=0x7ffff1df3888,
> val=<value optimized out>, sccstack=0x7fffffffda38, sccstate=0x1269440,
> sccstate_obstack=0x7fffffffd9e0)
> at ../../gcc-4.5-20100107/gcc/gimple.c:3711
> 3711 v = iterative_hash_expr (TYPE_MAX_VALUE (type), v);
> (gdb) p type
> $17 = (union tree_node *) 0x7ffff1df3888
> (gdb) p *type
> $18 = {base = {code = INTEGER_TYPE, side_effects_flag = 0, constant_flag = 0,
> addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
> unsigned_flag = 0, asm_written_flag = 0, nowarning_flag = 0,
> used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0,
> private_flag = 0, protected_flag = 0, deprecated_flag = 0,
> saturating_flag = 0, default_def_flag = 0, lang_flag_0 = 0,
> lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0, lang_flag_4 = 0,
> lang_flag_5 = 0, lang_flag_6 = 0, visited = 0, packed_flag = 0,
> user_align = 0, spare = 0, address_space = 0}, common = {base = {
> code = INTEGER_TYPE, side_effects_flag = 0, constant_flag = 0,
> addressable_flag = 0, volatile_flag = 0, readonly_flag = 0,
> unsigned_flag = 0, asm_written_flag = 0, nowarning_flag = 0,
> used_flag = 0, nothrow_flag = 0, static_flag = 0, public_flag = 0,
> private_flag = 0, protected_flag = 0, deprecated_flag = 0,
> saturating_flag = 0, default_def_flag = 0, lang_flag_0 = 0,
>
> Maybe that helps. If I have inspiration over the weekend I will try to make a
> test case on Monday.
Try
Index: gcc/gimple.c
===================================================================
--- gcc/gimple.c (revision 155739)
+++ gcc/gimple.c (working copy)
@@ -3707,8 +3707,10 @@ iterative_hash_gimple_type (tree type, h
/* For integer types hash the types min/max values and the string flag.
*/
if (TREE_CODE (type) == INTEGER_TYPE)
{
- v = iterative_hash_expr (TYPE_MIN_VALUE (type), v);
- v = iterative_hash_expr (TYPE_MAX_VALUE (type), v);
+ if (TYPE_MIN_VALUE (type))
+ v = iterative_hash_expr (TYPE_MIN_VALUE (type), v);
+ if (TYPE_MAX_VALUE (type))
+ v = iterative_hash_expr (TYPE_MAX_VALUE (type), v);
v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42665