Bug 32286 - [4.2/4.3 Regression] ICE in dwarf2out with -g: sees Ada f-e unconstrained_array_type node
Summary: [4.2/4.3 Regression] ICE in dwarf2out with -g: sees Ada f-e unconstrained_arr...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.3.0
: P5 normal
Target Milestone: 4.2.1
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-06-11 15:37 UTC by Duncan Sands
Modified: 2007-12-08 09:53 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 4.1.2
Known to fail: 4.2.0
Last reconfirmed: 2007-06-11 20:17:07


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Sands 2007-06-11 15:37:45 UTC
The following occurs with svn head and GNAT GPL 2007.

$ gcc -c -g -gnat05 e.adb
+===========================GNAT BUG DETECTED==============================+
| 4.3.0 20070611 (experimental) (i686-pc-linux-gnu) GCC error:             |
| in gen_type_die_with_usage, at dwarf2out.c:12921                         |
| Error detected around e.adb:8                                            |
...

This occurs because a node type that should be internal to the
Ada f-e (unconstrained_array_type) has made its way as far as
gen_type_die_with_usage in dwarf2out.c.

Testcase:

package E is
   type T (S : access String) is null record;
   procedure P (X : T);
end;
package body E is
   procedure P (X : T) is
      S : String renames X.S.all;
      F : String (S'Range);
      for F'Address use S (S'First)'Address;
   begin
      null;
   end;
end;
Comment 1 Laurent GUERBY 2007-06-11 20:17:07 UTC
gcc -c -g -gnat05 e.adb works on 4.1.2, but it ICEs on 4.2 and 4.3.

+===========================GNAT BUG DETECTED==============================+
| 4.2.0 (i686-pc-linux-gnu) in gen_type_die, at dwarf2out.c:12720          |
| Error detected at e.adb:8:7                                              |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |

Comment 2 Samuel Tardieu 2007-12-07 12:37:54 UTC
Have you tried with a recent trunk GCC? Your GCC reads "20070611", but with the current trunk (4.3.0 20071207), I cannot reproduce the bug on i686-pc-linux-gnu:

% gcc -c -g -gnat05 e.adb

Laurent, which version did you use?
Comment 3 Laurent GUERBY 2007-12-07 17:44:20 UTC
Trunk from 20070611, but if it doesn't show up now (I haven't checked) this should be marked as fixed on trunk.
Comment 4 Duncan Sands 2007-12-08 09:53:22 UTC
This is fixed on trunk.