Bug 32164 - [4.9/5/6 Regression] ICE when renaming predefined "=" and "/="
Summary: [4.9/5/6 Regression] ICE when renaming predefined "=" and "/="
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.1
: P5 normal
Target Milestone: 4.9.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2007-05-31 14:55 UTC by Ludovic Brenta
Modified: 2015-10-10 13:56 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.6, 4.0.4
Known to fail: 4.3.6, 4.4.6, 4.5.3, 4.6.0
Last reconfirmed: 2008-02-24 08:36:26


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2007-05-31 14:55:10 UTC
(forwarded from the Debian bug tracking system)

package Pak1 is
   type T1 is tagged null record;
   function  Eq(X, Y : T1) return Boolean renames "=";
   function Neq(X, Y : T1) return Boolean renames "/="; -- line 4
end Pak1;

gnatmake pak1 yields:
gnatmake pak1
gcc-4.1 -c pak1.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.2 20061115 (prerelease) (Debian 4.1.1-22) (x86_64-pc-linux-gnu)      |
| Assert_Failure einfo.adb:846                                             |
| Error detected at pak1.ads:4:43                                          |

The token that triggers the bug box is the "renames" in line 4.

Here is a second test case that triggers the same bug box:

package Pak1 is
   type T1 is tagged null record;
   function Eq (X, Y : T1) return Boolean renames "=";

   type T2 is new T1 with null record;
   function Eq (X, Y : T2) return Boolean renames "="; -- line 6
end Pak1;

gnatmake pak1
gcc-4.1 -c pak1.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.2 20061115 (prerelease) (Debian 4.1.1-22) (x86_64-pc-linux-gnu)      |
| Assert_Failure einfo.adb:846                                             |
| Error detected at pak1.ads:6:43                                          |

The token that triggers this bug box is, again, the "renames" in line 6.
Comment 1 Ludovic Brenta 2007-05-31 14:58:11 UTC
Same symptoms on i686-unknown-linux-gnu.
Comment 2 Laurent GUERBY 2007-05-31 20:37:54 UTC
+===========================GNAT BUG DETECTED==============================+
| 4.2.0 (i686-pc-linux-gnu) Assert_Failure einfo.adb:853                   |
| Error detected at pak1.ads:4:43                                          |

+===========================GNAT BUG DETECTED==============================+
| 4.1.2 (i686-pc-linux-gnu) Assert_Failure einfo.adb:846                   |
| Error detected at pak1.ads:4:43                                          |

Compiles successfully with 3.4.6 and 4.0.4 so this is a regression.
Comment 3 Laurent GUERBY 2007-05-31 20:39:36 UTC
And still present on trunk from a few weeks ago:

+===========================GNAT BUG DETECTED==============================+
| 4.3.0 20070511 (experimental) (x86_64-unknown-linux-gnu) Assert_Failure einfo.adb:852|
| Error detected at pak1.ads:4:43                                          |
Comment 4 Samuel Tardieu 2008-02-24 08:36:26 UTC
Confirmed with trunk, with the error signaled at another place:

+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20080223 (experimental) (i686-pc-linux-gnu) GCC error:             |
| in gnat_to_gnu_entity, at ada/decl.c:301                                 |
| Error detected at pak1.ads:2:9                                           |
Comment 5 Joseph S. Myers 2008-07-04 22:12:42 UTC
Closing 4.1 branch.
Comment 6 Joseph S. Myers 2009-03-31 20:09:56 UTC
Closing 4.2 branch.
Comment 7 Richard Biener 2009-08-04 12:28:11 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 8 Richard Biener 2010-05-22 18:11:31 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 9 Eric Botcazou 2011-01-07 09:59:37 UTC
This works with 4.4.x and 4.5.x:

pak1.ads:2:09: prefix of "Unrestricted_Access" attribute cannot be intrinsic

but fails again with 4.6.0:

+===========================GNAT BUG DETECTED==============================+
| 4.6.0 20110106 (experimental) [trunk revision 168535] (i586-suse-linux-gnu) |
| Assert_Failure einfo.adb:904                                             |
| Error detected at pak1.ads:1:1
Comment 10 Ludovic Brenta 2011-05-10 08:48:53 UTC
(In reply to comment #9)
> This works with 4.4.x and 4.5.x:
> 
> pak1.ads:2:09: prefix of "Unrestricted_Access" attribute cannot be intrinsic

I wouldn't qualify this as "working".  The test program does not use Unrestricted_Access and I think it is legal, so GCC should not reject it.  I think this is in fact another bug which hides PR32164.
Comment 11 Richard Biener 2011-06-27 12:13:05 UTC
4.3 branch is being closed, moving to 4.4.7 target.
Comment 12 Nicolas Boulenguez 2011-08-31 14:50:51 UTC
We now have two distinct assertion failures.

First version with T1 Eq Neq gives:
4.6.1 (x86_64-pc-linux-gnu) Assert_Failure einfo.adb:904
Error detected at pak1.ads:1:1

Second version with T1 Eq and T2 Eq gives:
4.6.1 (x86_64-pc-linux-gnu) Assert_Failure einfo.adb:910
Error detected at pak2.ads:6:43
Comment 13 Jakub Jelinek 2012-03-13 12:45:55 UTC
4.4 branch is being closed, moving to 4.5.4 target.
Comment 14 Jakub Jelinek 2013-04-12 15:16:09 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 15 Richard Biener 2014-06-12 13:43:00 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 16 Georg 2014-08-13 12:35:18 UTC
works for me with some more recent compilers. Example:

$ gnatchop -w pak1.ada && gnatmake -gnatvl pak1_1.ads pak1_2.ads
splitting pak1.ada into:
   pak1_1.ads
   pak1_2.ads
gcc -c -gnatvl pak1_1.ads

GNAT 4.8.0 20130208 (experimental) [trunk revision 195897]
Copyright 1992-2013, Free Software Foundation, Inc.


Compiling: pak1_1.ads (source file time stamp: 2014-08-13 12:33:11)

     1. package Pak1_1 is
     2.    type T1 is tagged null record;
     3.    function  Eq(X, Y : T1) return Boolean renames "=";
     4.    function Neq(X, Y : T1) return Boolean renames "/="; -- line 4
     5. end Pak1_1;

 5 lines: No errors
gcc -c -gnatvl pak1_2.ads

GNAT 4.8.0 20130208 (experimental) [trunk revision 195897]
Copyright 1992-2013, Free Software Foundation, Inc.


Compiling: pak1_2.ads (source file time stamp: 2014-08-13 12:33:11)

     1.
     2. package Pak1_2 is
     3.    type T1 is tagged null record;
     4.    function Eq (X, Y : T1) return Boolean renames "=";
     5.
     6.    type T2 is new T1 with null record;
     7.    function Eq (X, Y : T2) return Boolean renames "="; -- line 6
     8. end Pak1_2;

 8 lines: No errors

Same for GNAT GPL 2014 (20140331) ; both on Mac OS X 10.9
Comment 17 Nicolas Boulenguez 2014-08-13 15:29:09 UTC
4.8.2 and 4.9.1 behave well too.
Comment 18 Jakub Jelinek 2014-12-19 13:32:42 UTC
GCC 4.8.4 has been released.
Comment 19 Richard Biener 2015-06-23 08:15:35 UTC
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
Comment 20 Jakub Jelinek 2015-06-26 19:57:08 UTC
GCC 4.9.3 has been released.
Comment 21 Alexandre Oliva 2015-10-10 13:56:20 UTC
This is fixed in all active branches.