This patch inhibits the generation of freeze nodes when pre-analyzing the domain of iteration of an Ada2012 loop that appears as a quantified expression in a predicate for an array type. This prevents a back-end abort on an invisible freeze node that would otherwise appear in an unexpanded code sequence. The following must compile quietly: ---- with Id_Manager; package My_Id_Manager is new Id_Manager (Max_Id_Type => 100_000, Max_Key_Count => 100); ---- generic Max_Id_Type : Positive; Max_Key_Count : Positive; package Id_Manager is type Unique_Id_Type is new Integer range 0 .. Max_Id_Type; Undefined_Id : constant Unique_Id_Type := 0; type Key_Count is new Integer range 0 .. Max_Key_Count; subtype Key_Index is Key_Count range 1 .. Key_Count'Last; type Key_Array is array (Key_Index range <>) of Unique_Id_Type with Predicate => Key_Array'First = 1; type Id_Manager_State (Capacity : Key_Count) is private; procedure Display_Objects (TheObject : Id_Manager_State); private type Id_Manager_State (Capacity : Key_Count) is record Id_Key : Key_Array (1 .. Capacity) := (others => Undefined_Id); Key_Size : Key_Count := 0; end record; end Id_Manager; ---- package body Id_Manager is procedure Display_Objects (TheObject : Id_Manager_State) is begin for Item of TheObject.Id_Key loop null; end loop; end Display_Objects; end Id_Manager; 2018-05-23 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch5.adb (Preanalyze_Range): The pre-analysis of the domain of iteration of an Ada2012 loop is performed to determine the type of the domain, but full analysis is performed once the loop is rewritten as a while-loop during expansion. The pre-analysis suppresses expansion; it must also suppress the generation of freeze nodes, which may otherwise appear in the wrong scope before rewritting. From-SVN: r260582
Name |
Last commit
|
Last update |
---|---|---|
INSTALL | Loading commit data... | |
config | Loading commit data... | |
contrib | Loading commit data... | |
fixincludes | Loading commit data... | |
gcc | Loading commit data... | |
gnattools | Loading commit data... | |
gotools | Loading commit data... | |
include | Loading commit data... | |
intl | Loading commit data... | |
libada | Loading commit data... | |
libatomic | Loading commit data... | |
libbacktrace | Loading commit data... | |
libcc1 | Loading commit data... | |
libcpp | Loading commit data... | |
libdecnumber | Loading commit data... | |
libffi | Loading commit data... | |
libgcc | Loading commit data... | |
libgfortran | Loading commit data... | |
libgo | Loading commit data... | |
libgomp | Loading commit data... | |
libhsail-rt | Loading commit data... | |
libiberty | Loading commit data... | |
libitm | Loading commit data... | |
libmpx | Loading commit data... | |
libobjc | Loading commit data... | |
liboffloadmic | Loading commit data... | |
libquadmath | Loading commit data... | |
libsanitizer | Loading commit data... | |
libssp | Loading commit data... | |
libstdc++-v3 | Loading commit data... | |
libvtv | Loading commit data... | |
lto-plugin | Loading commit data... | |
maintainer-scripts | Loading commit data... | |
zlib | Loading commit data... | |
.dir-locals.el | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
ABOUT-NLS | Loading commit data... | |
COPYING | Loading commit data... | |
COPYING.LIB | Loading commit data... | |
COPYING.RUNTIME | Loading commit data... | |
COPYING3 | Loading commit data... | |
COPYING3.LIB | Loading commit data... | |
ChangeLog | Loading commit data... | |
ChangeLog.jit | Loading commit data... | |
ChangeLog.tree-ssa | Loading commit data... | |
MAINTAINERS | Loading commit data... | |
Makefile.def | Loading commit data... | |
Makefile.in | Loading commit data... | |
Makefile.tpl | Loading commit data... | |
README | Loading commit data... | |
compile | Loading commit data... | |
config-ml.in | Loading commit data... | |
config.guess | Loading commit data... | |
config.rpath | Loading commit data... | |
config.sub | Loading commit data... | |
configure | Loading commit data... | |
configure.ac | Loading commit data... | |
depcomp | Loading commit data... | |
install-sh | Loading commit data... | |
libtool-ldflags | Loading commit data... | |
libtool.m4 | Loading commit data... | |
ltgcc.m4 | Loading commit data... | |
ltmain.sh | Loading commit data... | |
ltoptions.m4 | Loading commit data... | |
ltsugar.m4 | Loading commit data... | |
ltversion.m4 | Loading commit data... | |
lt~obsolete.m4 | Loading commit data... | |
missing | Loading commit data... | |
mkdep | Loading commit data... | |
mkinstalldirs | Loading commit data... | |
move-if-change | Loading commit data... | |
symlink-tree | Loading commit data... | |
ylwrap | Loading commit data... |