public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/40932]  New: ICE in illegal program, Assert_Failure atree.adb:3815, RM 4.3.1(17.1/2)
@ 2009-08-01 14:29 ludovic at ludovic-brenta dot org
  2009-08-01 14:59 ` [Bug ada/40932] ICE in legal program, Assert_Failure atree.adb:3815, RM 4.3.1(4/2, 19.1/2) ludovic at ludovic-brenta dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-08-01 14:29 UTC (permalink / raw)
  To: gcc-bugs

A discriminant_association can only contain an expression (RM 3.7.1(3)); in
contrast, a record_component_association can contain either an expression or a
box <> (RM 4.3.1(4/2)); however th box is illegal if the component is a
discriminant without a defaut value; this is consistent with a
discriminant_association.  The following program is therefore illegal:

package pak1 is
   type T1(b: boolean) is null record;

   type T2 is record
      a1: T1(false);
   end record;

   x1: constant T2 := (a1 => <>); -- line 8

end pak1;

In line 8, the <> is illegal because it is part of a
record_component_association for a discriminant that has no default value.

GCC crashes on this illegal program:

+===========================GNAT BUG DETECTED==============================+
| 4.3.0 (i686-unknown-linux-gnu) Assert_Failure atree.adb:3816             |

gcc-4.3 -c pak1.ads
+===========================GNAT BUG DETECTED==============================+
| 4.3.3 (x86_64-pc-linux-gnu) Assert_Failure atree.adb:3816                |
| Error detected at pak1.ads:8:23                                          |

gcc-4.4 -c pak1.ads
+===========================GNAT BUG DETECTED==============================+
| 4.4.1 (x86_64-pc-linux-gnu) Assert_Failure atree.adb:3815                |
| Error detected at pak1.ads:8:23                                          |


-- 
           Summary: ICE in illegal program, Assert_Failure atree.adb:3815,
                    RM 4.3.1(17.1/2)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic at ludovic-brenta dot org


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


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

* [Bug ada/40932] ICE in legal program, Assert_Failure atree.adb:3815, RM 4.3.1(4/2, 19.1/2)
  2009-08-01 14:29 [Bug ada/40932] New: ICE in illegal program, Assert_Failure atree.adb:3815, RM 4.3.1(17.1/2) ludovic at ludovic-brenta dot org
@ 2009-08-01 14:59 ` ludovic at ludovic-brenta dot org
  0 siblings, 0 replies; 2+ messages in thread
From: ludovic at ludovic-brenta dot org @ 2009-08-01 14:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ludovic at ludovic-brenta dot org  2009-08-01 14:59 -------
I now think my analysis was wrong; a1 is not a discriminant, so the program is
actually legal and the value of x1 should be:

x1 = (a1 => (b => False))

(this does not change anything to the GCC bug, actually.)


-- 

ludovic at ludovic-brenta dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in illegal program,     |ICE in legal program,
                   |Assert_Failure              |Assert_Failure
                   |atree.adb:3815, RM          |atree.adb:3815, RM
                   |4.3.1(17.1/2)               |4.3.1(4/2, 19.1/2)


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


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

end of thread, other threads:[~2009-08-01 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-01 14:29 [Bug ada/40932] New: ICE in illegal program, Assert_Failure atree.adb:3815, RM 4.3.1(17.1/2) ludovic at ludovic-brenta dot org
2009-08-01 14:59 ` [Bug ada/40932] ICE in legal program, Assert_Failure atree.adb:3815, RM 4.3.1(4/2, 19.1/2) ludovic at ludovic-brenta 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).