Bug 48844 - [4.6/4.7 regression] ICE on assignment of aggregate with discriminated record type
[4.6/4.7 regression] ICE on assignment of aggregate with discriminated record...
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: ada
4.7.0
: P4 normal
: 4.6.1
Assigned To: Eric Botcazou
http://gcc.gnu.org/ml/gcc-patches/201...
: ice-on-valid-code
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-02 16:16 UTC by Georg Bauhaus
Modified: 2011-05-05 16:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.4.6, 4.5.4
Known to fail: 4.6.0, 4.7.0
Last reconfirmed: 2011-05-02 21:05:30


Attachments
Source files mentioned in the bug report (1.29 KB, application/octet-stream)
2011-05-02 16:16 UTC, Georg Bauhaus
Details
Same as original attachment (source files mentioned in the bug report), with proper MIME type (1.29 KB, text/plain)
2011-05-02 16:20 UTC, Georg Bauhaus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Bauhaus 2011-05-02 16:16:41 UTC
Created attachment 24166 [details]
Source files mentioned in the bug report

The following line, from function Convert below,
seems to cause the bug box.
(The program is fully produced from a note
an how erroneous execution can undermine
type safety; the original is here:
http://www.enyo.de/fw/notes/ada-type-safety.html )

 M := (Sel => Source_Field, S => (S => S)); --!


$ gnatchop  -r -w conv.ada && gnatmake convert_test
splitting conv.ada into:
   conversion.ads
   convert_test.adb
   conversion.adb
gcc -c convert_test.adb
+===========================GNAT BUG DETECTED==============================+
| 4.7.0 20110411 (experimental) (i686-pc-linux-gnu) GCC error:             |
| in create_tmp_var, at gimplify.c:465                                     |
| Error detected around /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.0/adainclude/s-addima.ads:17:13|
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

convert_test.adb
conversion.ads
conversion.adb


raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:423
gnatmake: "convert_test.adb" compilation error
Comment 1 Georg Bauhaus 2011-05-02 16:20:46 UTC
Created attachment 24167 [details]
Same as original attachment (source files mentioned in the bug report), with proper MIME type
Comment 2 Eric Botcazou 2011-05-02 21:05:30 UTC
Recent regression.
Comment 3 Eric Botcazou 2011-05-02 21:06:47 UTC
Investigating.
Comment 4 Eric Botcazou 2011-05-05 16:22:21 UTC
Author: ebotcazou
Date: Thu May  5 16:22:16 2011
New Revision: 173442

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173442
Log:
	PR ada/48844
	* gcc-interface/gigi.h (get_variant_part): Declare.
	* gcc-interface/decl.c (get_variant_part): Make global.
	* gcc-interface/utils2.c (find_common_type): Do not return T1 if the
	types have the same constant size, are record types and T1 has a
	variant part while T2 doesn't.

Added:
    trunk/gcc/testsuite/gnat.dg/discr29.adb
    trunk/gcc/testsuite/gnat.dg/discr29.ads
    trunk/gcc/testsuite/gnat.dg/discr30.adb
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/gcc-interface/decl.c
    trunk/gcc/ada/gcc-interface/gigi.h
    trunk/gcc/ada/gcc-interface/utils2.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Eric Botcazou 2011-05-05 16:27:09 UTC
Author: ebotcazou
Date: Thu May  5 16:27:03 2011
New Revision: 173443

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173443
Log:
	PR ada/48844
	* gcc-interface/gigi.h (get_variant_part): Declare.
	* gcc-interface/decl.c (get_variant_part): Make global.
	* gcc-interface/utils2.c (find_common_type): Do not return T1 if the
	types have the same constant size, are record types and T1 has a
	variant part while T2 doesn't.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gnat.dg/discr29.adb
      - copied unchanged from r173442, trunk/gcc/testsuite/gnat.dg/discr29.adb
    branches/gcc-4_6-branch/gcc/testsuite/gnat.dg/discr29.ads
      - copied unchanged from r173442, trunk/gcc/testsuite/gnat.dg/discr29.ads
    branches/gcc-4_6-branch/gcc/testsuite/gnat.dg/discr30.adb
      - copied unchanged from r173442, trunk/gcc/testsuite/gnat.dg/discr30.adb
Modified:
    branches/gcc-4_6-branch/gcc/ada/ChangeLog
    branches/gcc-4_6-branch/gcc/ada/gcc-interface/decl.c
    branches/gcc-4_6-branch/gcc/ada/gcc-interface/gigi.h
    branches/gcc-4_6-branch/gcc/ada/gcc-interface/utils2.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 6 Eric Botcazou 2011-05-05 16:29:33 UTC
On all affected branches.