public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
@ 2005-09-25 10:17 laurent at guerby dot net
  2005-09-25 10:54 ` [Bug bootstrap/24053] " schwab at suse dot de
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: laurent at guerby dot net @ 2005-09-25 10:17 UTC (permalink / raw)
  To: gcc-bugs

On x86 and x86_64, started between

LAST_UPDATED: Fri Sep 23 22:29:25 UTC 2005
LAST_UPDATED: Sun Sep 25 08:26:26 UTC 2005

stage1/xgcc -Bstage1/
-B/home/guerby/work/gcc/install/install-20050925T102808/x86_64-unknown-linux-gnu/bin/
-c -g -O2      -gnatpg -gnata -I- -I. -Iada
-I/home/guerby/work/gcc/version-head/gcc/ada
/home/guerby/work/gcc/version-head/gcc/ada/osint.adb -o ada/osint.o
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050925 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in build_int_cst_wide, at tree.c:795                                     |
| Error detected at osint.adb:2822:12                                      |

-- 
           Summary: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: laurent at guerby dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug bootstrap/24053] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
@ 2005-09-25 10:54 ` schwab at suse dot de
  2005-09-25 15:17 ` [Bug ada/24053] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: schwab at suse dot de @ 2005-09-25 10:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schwab at suse dot de  2005-09-25 10:54 -------
Also on ia64. 
 
Broken by this change:   
   
2005-09-24  Richard Henderson  <rth@redhat.com>  
  
	* c-common.c (handle_mode_attribute): When not modifying in place,  
	create subtypes for enumerations.  
	(sync_resolve_return): Use TYPE_MAIN_VARIANT.  
	* gimplify.c (create_tmp_from_val): Likewise.  
  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org,
                   |                            |schwab at suse dot de
            Summary|Ada bootstrap ICE in        |Ada bootstrap ICE in
                   |build_int_cst_wide, at      |build_int_cst_wide, at
                   |tree.c:795                  |tree.c:795


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


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

* [Bug ada/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
  2005-09-25 10:54 ` [Bug bootstrap/24053] " schwab at suse dot de
@ 2005-09-25 15:17 ` pinskia at gcc dot gnu dot org
  2005-09-25 17:20 ` laurent at guerby dot net
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-25 15:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-25 15:17 -------
This looks like a latent bug in the Ada front-end as the only change to the middle-end would be the 
change to use TYPE_MAIN_VARIANT.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|bootstrap                   |ada
           Keywords|                            |build
            Summary|Ada bootstrap ICE in        |[4.1 Regression] Ada
                   |build_int_cst_wide, at      |bootstrap ICE in
                   |tree.c:795                  |build_int_cst_wide, at
                   |                            |tree.c:795


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


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

* [Bug ada/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
  2005-09-25 10:54 ` [Bug bootstrap/24053] " schwab at suse dot de
  2005-09-25 15:17 ` [Bug ada/24053] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-09-25 17:20 ` laurent at guerby dot net
  2005-09-25 17:55 ` danglin at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: laurent at guerby dot net @ 2005-09-25 17:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From laurent at guerby dot net  2005-09-25 17:20 -------
Indeed, just reverting just the gimplify.c change gets Ada in stage3 (still
running on my machine).

-- 


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


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

* [Bug ada/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (2 preceding siblings ...)
  2005-09-25 17:20 ` laurent at guerby dot net
@ 2005-09-25 17:55 ` danglin at gcc dot gnu dot org
  2005-09-25 18:15 ` ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-09-25 17:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu dot
                   |                            |org


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


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

* [Bug ada/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (3 preceding siblings ...)
  2005-09-25 17:55 ` danglin at gcc dot gnu dot org
@ 2005-09-25 18:15 ` ebotcazou at gcc dot gnu dot org
  2005-09-26 16:56 ` ebotcazou at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-09-25 18:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-25 18:15 -------
By Andreas.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-25 18:15:28
               date|                            |


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


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

* [Bug ada/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (4 preceding siblings ...)
  2005-09-25 18:15 ` ebotcazou at gcc dot gnu dot org
@ 2005-09-26 16:56 ` ebotcazou at gcc dot gnu dot org
  2005-09-27  9:55 ` [Bug middle-end/24053] " ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-09-26 16:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-26 16:56 -------
This works at -O on x86.



-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (5 preceding siblings ...)
  2005-09-26 16:56 ` ebotcazou at gcc dot gnu dot org
@ 2005-09-27  9:55 ` ebotcazou at gcc dot gnu dot org
  2005-09-27 10:51 ` nathan at codesourcery dot com
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-09-27  9:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-27 09:55 -------
> This looks like a latent bug in the Ada front-end as the only change to the
> middle-end would be the change to use TYPE_MAIN_VARIANT.

No, it isn't, please investigate a minimum before writing such a statement. 
It's a latent consistency bug in the integer-share-limit stuff.

In build_int_cst_wide, we're asserting that the type of shared constants
attached to a type is precisely that type:

      t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix);
      if (t)
	{
	  /* Make sure no one is clobbering the shared constant.  */
	  gcc_assert (TREE_TYPE (t) == type);

But in set_sizetype we're boldly copying TYPE_CACHED_VALUES between types:

  /* We do want to use bitsizetype's cache, as we will be replacing that
     type.  */
  TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (bitsizetype);
  TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (bitsizetype);


Nathan, who is right here?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at codesourcery dot
                   |                            |com
          Component|ada                         |middle-end


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (6 preceding siblings ...)
  2005-09-27  9:55 ` [Bug middle-end/24053] " ebotcazou at gcc dot gnu dot org
@ 2005-09-27 10:51 ` nathan at codesourcery dot com
  2005-09-29 11:54 ` christian dot joensson at gmail dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: nathan at codesourcery dot com @ 2005-09-27 10:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From nathan at codesourcery dot com  2005-09-27 10:51 -------
Subject: Re:  [4.1 Regression] Ada bootstrap ICE in
 build_int_cst_wide, at tree.c:795

ebotcazou at gcc dot gnu dot org wrote:

> In build_int_cst_wide, we're asserting that the type of shared constants
> attached to a type is precisely that type:
> 
>       t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix);
>       if (t)
> 	{
> 	  /* Make sure no one is clobbering the shared constant.  */
> 	  gcc_assert (TREE_TYPE (t) == type);
> 
> But in set_sizetype we're boldly copying TYPE_CACHED_VALUES between types:
> 
>   /* We do want to use bitsizetype's cache, as we will be replacing that
>      type.  */
>   TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (bitsizetype);
>   TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (bitsizetype);
> 
> 
> Nathan, who is right here?

Both are correct.  However it looks like some integer constant created before 
set_sizetype is called has not got its type updated correctly.

The problem here is that we have to create some types before setting size_type, 
and in creating those types we need to set their size to some integral constant, 
and that integral constant has to have a type.  That uses the stub sizetype 
type, which we overwrite further down set_sizetype.

   /* Replace our original stub sizetype.  */
   memcpy (sizetype, t, tree_size (sizetype));
   TYPE_MAIN_VARIANT (sizetype) = sizetype;

My guess is that we've already created some type variants of the stub type at 
that point, which is not what I expected.  There should really be an
	gcc_assert (!TYPE_NEXT_VARIANT (sizetype) && !TYPE_NEXT_VARIANT (t));
just before the memcpy

nathan



-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (7 preceding siblings ...)
  2005-09-27 10:51 ` nathan at codesourcery dot com
@ 2005-09-29 11:54 ` christian dot joensson at gmail dot com
  2005-09-29 17:24 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: christian dot joensson at gmail dot com @ 2005-09-29 11:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From christian dot joensson at gmail dot com  2005-09-29 11:54 -------
I'm testing Kenner's suggestion from
http://gcc.gnu.org/ml/gcc/2005-09/msg00867.html ...

-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (8 preceding siblings ...)
  2005-09-29 11:54 ` christian dot joensson at gmail dot com
@ 2005-09-29 17:24 ` ebotcazou at gcc dot gnu dot org
  2005-09-29 21:33 ` chrisp_42 at bigpond dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-09-29 17:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-29 17:24 -------
> The problem here is that we have to create some types before setting
> size_type, and in creating those types we need to set their size to some
> integral constant, and that integral constant has to have a type.  That uses
> the stub sizetype type, which we overwrite further down set_sizetype.
> 
>    /* Replace our original stub sizetype.  */
>    memcpy (sizetype, t, tree_size (sizetype));
>    TYPE_MAIN_VARIANT (sizetype) = sizetype;

OK, I totally missed that the types 't' are not supposed to escape from
set_sizetype, right?

> My guess is that we've already created some type variants of the stub type at 
> that point, which is not what I expected.  There should really be an
> 	gcc_assert (!TYPE_NEXT_VARIANT (sizetype) && !TYPE_NEXT_VARIANT (t));
> just before the memcpy

The bug appears to be that the second type 't' does escape from set_sizetype
because it is the main variant of bitsizetype, as Richard Kenner has found.

Thanks for your feedback.


-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (9 preceding siblings ...)
  2005-09-29 17:24 ` ebotcazou at gcc dot gnu dot org
@ 2005-09-29 21:33 ` chrisp_42 at bigpond dot com
  2005-09-29 22:11 ` cvs-commit at gcc dot gnu dot org
  2005-09-29 22:14 ` [Bug middle-end/24053] [4.1 Regression] " ebotcazou at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: chrisp_42 at bigpond dot com @ 2005-09-29 21:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From chrisp_42 at bigpond dot com  2005-09-29 21:33 -------
(In reply to comment #8)
> I'm testing Kenner's suggestion from
> http://gcc.gnu.org/ml/gcc/2005-09/msg00867.html ...

Works for me on i686-linux
Bootstrap finished and no additional ACATS failures.

-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (10 preceding siblings ...)
  2005-09-29 21:33 ` chrisp_42 at bigpond dot com
@ 2005-09-29 22:11 ` cvs-commit at gcc dot gnu dot org
  2005-09-29 22:14 ` [Bug middle-end/24053] [4.1 Regression] " ebotcazou at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-09-29 22:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-09-29 22:11 -------
Subject: Bug 24053

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ebotcazou@gcc.gnu.org	2005-09-29 22:11:14

Modified files:
	gcc            : ChangeLog stor-layout.c 

Log message:
	PR middle-end/24053
	* stor-layout.c (set_sizetype): Set TYPE_MAIN_VARIANT of bitsizetype.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10052&r2=2.10053
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stor-layout.c.diff?cvsroot=gcc&r1=1.242&r2=1.243



-- 


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


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

* [Bug middle-end/24053] [4.1 Regression] ICE in build_int_cst_wide, at tree.c:795
  2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
                   ` (11 preceding siblings ...)
  2005-09-29 22:11 ` cvs-commit at gcc dot gnu dot org
@ 2005-09-29 22:14 ` ebotcazou at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-09-29 22:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-09-29 22:14 -------
Fix installed on behalf of Richard.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
            Summary|[4.1 Regression] Ada        |[4.1 Regression] ICE in
                   |bootstrap ICE in            |build_int_cst_wide, at
                   |build_int_cst_wide, at      |tree.c:795
                   |tree.c:795                  |
   Target Milestone|---                         |4.1.0


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


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

end of thread, other threads:[~2005-09-29 22:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-25 10:17 [Bug bootstrap/24053] New: Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 laurent at guerby dot net
2005-09-25 10:54 ` [Bug bootstrap/24053] " schwab at suse dot de
2005-09-25 15:17 ` [Bug ada/24053] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-09-25 17:20 ` laurent at guerby dot net
2005-09-25 17:55 ` danglin at gcc dot gnu dot org
2005-09-25 18:15 ` ebotcazou at gcc dot gnu dot org
2005-09-26 16:56 ` ebotcazou at gcc dot gnu dot org
2005-09-27  9:55 ` [Bug middle-end/24053] " ebotcazou at gcc dot gnu dot org
2005-09-27 10:51 ` nathan at codesourcery dot com
2005-09-29 11:54 ` christian dot joensson at gmail dot com
2005-09-29 17:24 ` ebotcazou at gcc dot gnu dot org
2005-09-29 21:33 ` chrisp_42 at bigpond dot com
2005-09-29 22:11 ` cvs-commit at gcc dot gnu dot org
2005-09-29 22:14 ` [Bug middle-end/24053] [4.1 Regression] " ebotcazou 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).