Bug 19918 - [4.0 Regression] ICE: Segmentation fault compiling ada/ada.ads
Summary: [4.0 Regression] ICE: Segmentation fault compiling ada/ada.ads
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-02-12 03:27 UTC by John David Anglin
Modified: 2005-02-12 20:05 UTC (History)
4 users (show)

See Also:
Host: *-*-*
Target: *-*-*
Build: *-*-*
Known to work:
Known to fail:
Last reconfirmed: 2005-02-12 07:55:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2005-02-12 03:27:56 UTC
stage1/xgcc -Bstage1/ -B/opt/gnu/gcc/gcc-4.0.0/hppa2.0w-hp-hpux11.11/bin/ -c -g
-O2 -mdisable-indexing     -gnatpg -gnata -I- -I. -Iada -I../../gcc/gcc/ada ../.
./gcc/gcc/ada/ada.ads -o ada/ada.o
<built-in>:0: internal compiler error: Segmentation fault

I believe that this was introduced this afternoon.
Comment 1 John David Anglin 2005-02-12 03:34:22 UTC
GNU gdb 6.3.50.20050210-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "hppa2.0w-hp-hpux11.11"...
Breakpoint 1 at 0x517c80: file ../../gcc/gcc/diagnostic.c, line 556.
Breakpoint 2 at 0x517afc: file ../../gcc/gcc/diagnostic.c, line 500.
Breakpoint 3 at 0xa70430: file ../../gcc/libiberty/obstack.c, line 450.
Breakpoint 4 at 0xa5755c: file ../../gcc/libcpp/lex.c, line 178.
(gdb) r `cat xx.sh`
Starting program: /mnt/gnu/gcc-3.3/objdir/gcc/stage1/gnat1 `cat xx.sh`
Breakpoint 3 at 0x7af87744
Breakpoint 4 at 0x7afeb230

Program received signal SIGSEGV, Segmentation fault.
0x00688be4 in type_hash_list (list=0x7ade29c0, hashcode=1325671104)
    at ../../gcc/gcc/tree.c:3427
3427          hashcode = iterative_hash_object (TYPE_HASH (TREE_VALUE (tail)),
(gdb) disass 0x00688bc4 0x00688bf4
Dump of assembler code from 0x688bc4 to 0x688bf4:
0x00688bc4 <type_hash_list+196>:        b,l 0x698a20 <tree_check_failed>,rp
0x00688bc8 <type_hash_list+200>:        nop
0x00688bcc <type_hash_list+204>:        ldw 10(,r3),r19
0x00688bd0 <type_hash_list+208>:        ldw 14(,r19),r19
0x00688bd4 <type_hash_list+212>:        stw r19,c(,r3)
0x00688bd8 <type_hash_list+216>:        ldil a73800,r19
0x00688bdc <type_hash_list+220>:        ldo 560(r19),r20
0x00688be0 <type_hash_list+224>:        ldw c(,r3),r19
0x00688be4 <type_hash_list+228>:        ldw c(,r19),r19
0x00688be8 <type_hash_list+232>:        extrw,u r19,7,8,r19
0x00688bec <type_hash_list+236>:        ldw,s r19(,r20),r19
0x00688bf0 <type_hash_list+240>:        cmpib,=,n 2,r19,0x688c1c <type_hash_list+
284>
End of assembler dump.
(gdb) p/x $r19
$1 = 0x0
Comment 2 John David Anglin 2005-02-12 03:59:58 UTC
hppa-unknown-linux-gnu is also broken.
Comment 3 Eric Botcazou 2005-02-12 07:55:31 UTC
As well as x86 and SPARC.
Comment 4 Eric Botcazou 2005-02-12 08:09:34 UTC
Broken by:

2005-02-11  Richard Henderson  <rth@redhat.com>

	* tree-complex.c (expand_complex_libcall): New.
	(expand_complex_multiplication): Use it for c99 compliance.
	(expand_complex_division): Likewise.
	* fold-const.c (fold_complex_add, fold_complex_mult): New.
	(fold): Call them.
	* builtins.c (built_in_names): Remove const.
	* tree.c (build_common_builtin_nodes): Build complex arithmetic
	builtins.
	* tree.h (BUILT_IN_COMPLEX_MUL_MIN, BUILT_IN_COMPLEX_MUL_MAX): New.
	(BUILT_IN_COMPLEX_DIV_MIN, BUILT_IN_COMPLEX_DIV_MAX): New.
	(built_in_names): Remove const.
	* c-common.c (c_common_type_for_mode): Handle complex modes.
	* flags.h, toplev.c (flag_complex_method): Rename from
	flag_complex_divide_method.
	* libgcc2.c (__divsc3, __divdc3, __divxc3, __divtc3,
	__mulsc3, __muldc3, __mulxc3, __multc3): New.
	* libgcc2.h: Declare them.
 	* libgcc-std.ver: Export them.
	* mklibgcc.in (lib2funcs): Build them.


It appears that Ada front-end's type_for_mode is not prepared to handle complex
floating-point modes.
Comment 5 Andrew Pinski 2005-02-12 15:06:04 UTC
Removing target milestone based on Mark's 4.0 status email.
Comment 6 Eric Botcazou 2005-02-12 15:19:13 UTC
> Removing target milestone based on Mark's 4.0 status email.

I think this one doesn't qualify: it's a bootstrap failure on all platforms.
Comment 7 Andrew Pinski 2005-02-12 15:22:36 UTC
(In reply to comment #6)
> > Removing target milestone based on Mark's 4.0 status email.
> 
> I think this one doesn't qualify: it's a bootstrap failure on all platforms.
Does not matter as it only effects only Ada so it qualifies and Mark wrote: "which affect only languages 
other than C and C++?"
See <http://gcc.gnu.org/ml/gcc/2005-01/msg01255.html>.
Comment 8 Eric Botcazou 2005-02-12 16:43:14 UTC
> Does not matter as it only effects only Ada so it qualifies and Mark wrote:
> "which affect only languages other than C and C++?"

That's wrong, it ruins bootstrap on all platforms, including C and C++.
Comment 9 Andrew Pinski 2005-02-12 16:46:21 UTC
(In reply to comment #8)
> > Does not matter as it only effects only Ada so it qualifies and Mark wrote:
> > "which affect only languages other than C and C++?"
> 
> That's wrong, it ruins bootstrap on all platforms, including C and C++.

Huh, it compiles just fine on powerpc-darwin with the default enable-languages.  in fact Ada is not 
enabled by default in 4.0?
Comment 10 Eric Botcazou 2005-02-12 17:10:26 UTC
> Huh, it compiles just fine on powerpc-darwin with the default enable-languages.  
> in fact Ada is not enabled by default in 4.0?

I don't know, I personally always build all languages...
Comment 11 dave 2005-02-12 18:55:07 UTC
Subject: Re:  [4.0 Regression] ICE: Segmentation fault compilin

> > > Does not matter as it only effects only Ada so it qualifies and Mark
> wrote:
> > > "which affect only languages other than C and C++?"
> > 
> > That's wrong, it ruins bootstrap on all platforms, including C and C++.
> 
> Huh, it compiles just fine on powerpc-darwin with the default
> enable-languages.  in fact Ada is not 
> enabled by default in 4.0?
> 
> -- 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>    Target Milestone|4.0.0                       |---

Although the lack of a milestone only indicates that fixing this bug
isn't a target for any release of GCC, I personally find this
change disappointing.  The Ada folks have worked hard to try to get
ready for 4.0.0, and I don't believe the status of Ada on the PA is
any worse than in previous releases.

Dave
Comment 12 dave 2005-02-12 19:05:55 UTC
Subject: Re:  [4.0 Regression] ICE: Segmentation fault compilin

> Although the lack of a milestone only indicates that fixing this bug
> isn't a target for any release of GCC, I personally find this
> change disappointing.

Also note that it was a new feature introduced for C99 compliance
that caused the problem.

Dave
Comment 13 Andrew Pinski 2005-02-12 19:16:26 UTC
(In reply to comment #12)
> Also note that it was a new feature introduced for C99 compliance
> that caused the problem.
Not being complainant to a standard is still considered a bug.
Comment 14 dave 2005-02-12 19:28:36 UTC
Subject: Re:  [4.0 Regression] ICE: Segmentation fault compilin

> (In reply to comment #12)
> > Also note that it was a new feature introduced for C99 compliance
> > that caused the problem.
> Not being complainant to a standard is still considered a bug.

Well, the fix required new functionality.  This was installed in
stage3 when new functionality isn't supposed to be added.  This
functionality is not enabled yet.

Dave
Comment 15 Andrew Pinski 2005-02-12 20:05:13 UTC
Fixed by:
        * utils.c (gnat_type_for_mode): Return NULL for COMPLEX modes;
        validate SCALAR_INT_MODE_P before calling gnat_type_for_size.