Bug 22140 - [4.1 Regression] ACATS ICE c37213j c37213l do_structure_copy, at tree-ssa-structalias.c:2372
Summary: [4.1 Regression] ACATS ICE c37213j c37213l do_structure_copy, at tree-ssa-str...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 22319
  Show dependency treegraph
 
Reported: 2005-06-21 19:39 UTC by Laurent GUERBY
Modified: 2005-07-06 17:31 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-21 19:47:16


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2005-06-21 19:39:38 UTC
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050621 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| tree check: expected integer_cst, have cond_expr in                      |
|    do_structure_copy, at tree-ssa-structalias.c:2372                     |
| Error detected at c37213j.adb:320:5                                      |

+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050621 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| tree check: expected integer_cst, have cond_expr in                      |
|    do_structure_copy, at tree-ssa-structalias.c:2372                     |
| Error detected at c37213l.adb:329:5                                      |
Comment 1 Andrew Pinski 2005-06-21 19:47:16 UTC
Reduced testcase from 22019 since it was just a related bug:
WITH REPORT; USE REPORT;
PROCEDURE C37213J IS
BEGIN
     DECLARE
          SUBTYPE SM IS INTEGER RANGE 1..10;
          TYPE REC (D1, D2 : SM) IS
               RECORD NULL; END RECORD;
          TYPE MY_ARR IS ARRAY (SM RANGE <>) OF INTEGER;
          GENERIC TYPE CONS IS PRIVATE;
          PROCEDURE SUBTYP_CHK (OBJ_XCP : BOOLEAN;
                                TAG     : STRING);
          PROCEDURE SUBTYP_CHK (OBJ_XCP : BOOLEAN;
                                TAG     : STRING)    IS
            SUBTYPE SCONS IS CONS;
             X : SCONS;
             FUNCTION VALUE RETURN SCONS IS
             BEGIN
                 RETURN X;
             END VALUE;
          BEGIN
             IF X /= VALUE THEN
                  FAILED ("");
             END IF;
          END SUBTYP_CHK;
         TYPE VAR_REC_DEF1 (D3 : INTEGER := 1) IS
              RECORD
                   CASE D3 IS
                        WHEN 1 =>
                             C1 : REC (D3, IDENT_INT(11));
                        WHEN OTHERS =>
                             C2 : INTEGER := IDENT_INT(5);
                   END CASE;
              END RECORD;
         PROCEDURE PROC3 IS NEW SUBTYP_CHK (VAR_REC_DEF1);
     BEGIN
       PROC3 (OBJ_XCP => TRUE, TAG => "PROC3");
     END;
END C37213J;
Comment 2 GCC Commits 2005-07-06 16:50:24 UTC
Subject: Bug 22140

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dberlin@gcc.gnu.org	2005-07-06 16:50:00

Modified files:
	gcc            : ChangeLog tree-ssa-structalias.c 

Log message:
	2005-07-06  Daniel Berlin  <dberlin@dberlin.org>
	
	Fix PR tree-optimization/22319
	Fix PR tree-optimization/22140
	Fix PR tree-optimization/22310
	
	* tree-ssa-structalias.c (do_structure_copy): Give up earlier on
	variable sized types.
	Use correct type for intermediate structure on *a = *b structure
	copies.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9356&r2=2.9357
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-structalias.c.diff?cvsroot=gcc&r1=2.12&r2=2.13

Comment 3 Andrew Pinski 2005-07-06 17:31:52 UTC
Fixed.