* gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK
[official-gcc.git] / gcc / ada / ChangeLog
blob6015967ab325349a1744e79edef814d108dc7dd4
1 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
3         * gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK
4         and TYPE_BY_REFERENCE_P flags on types after various promotions.
5         * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
6         Consider all kinds of entities.
8 2017-09-09  Eric Botcazou  <ebotcazou@adacore.com>
10         * gcc-interface/utils.c (convert): When converting to a padding type,
11         reuse an existing CONSTRUCTOR if it has got the right size.
13 2017-09-08  Nicolas Roche  <roche@adacore.com>
15         * gcc-interface/Make-lang.in, gcc-interface/Makefile.in: Find runtime
16         source in libgnat/
17         * a-lfztio.ads, g-timsta.ads, g-sercom-linux.adb, s-osprim-solaris.adb,
18         a-inteio.ads, s-stchop-rtems.adb, s-casuti.adb, s-pack39.adb,
19         i-vxwork-x86.ads, a-strbou.adb, a-stzmap.adb, s-assert.adb,
20         a-sfecin.ads, a-cohama.adb, s-casuti.ads, a-suenco.adb, s-pack39.ads,
21         a-stzmap.ads, a-strbou.ads, s-stalib.adb, s-trasym.adb, g-comver.adb,
22         s-assert.ads, s-vector.ads, g-cgi.adb, a-cohama.ads, s-wchcnv.adb,
23         a-titest.adb, s-pack48.adb, a-suenco.ads, a-strunb.adb, s-stalib.ads,
24         s-trasym.ads, a-nudira.adb, g-comver.ads, a-nuflra.adb, g-cgi.ads,
25         a-chacon.adb, s-wchcnv.ads, a-excach.adb, s-pack48.ads, a-titest.ads,
26         a-strunb.ads, s-dwalin.adb, a-nudira.ads, a-chtgbo.adb, s-resfil.adb,
27         a-scteio.ads, a-nuflra.ads, g-soliop-mingw.ads, s-pack57.adb,
28         a-chacon.ads, s-bytswa.ads, s-pooloc.adb, g-os_lib.adb, s-dwalin.ads,
29         a-szuzha.adb, s-resfil.ads, a-chtgbo.ads, s-spsufi.adb, s-pack57.ads,
30         s-pooloc.ads, g-os_lib.ads, a-stfiha.ads, a-lcteio.ads, a-wtcoau.adb,
31         a-szuzha.ads, s-mmosin-unix.adb, a-stmaco.ads, s-spsufi.ads,
32         s-stchop-limit.ads, a-wtcoau.ads, a-exctra.adb, s-mmosin-unix.ads,
33         s-sequio.adb, s-conca2.adb, g-table.adb, s-imglli.adb,
34         a-numaux-x86.adb, a-strsea.adb, s-wchstw.adb, a-clrefi.adb,
35         a-wwboio.adb, a-exctra.ads, s-sequio.ads, s-conca2.ads, a-wwunio.ads,
36         system-linux-hppa.ads, g-table.ads, s-dimkio.ads, s-imglli.ads,
37         a-cofove.adb, a-numaux-x86.ads, s-wchstw.ads, a-strsea.ads,
38         a-clrefi.ads, a-wwboio.ads, s-stratt-xdr.adb, s-crc32.adb,
39         s-excmac-arm.adb, g-busora.adb, a-cofove.ads, s-osprim-unix.adb,
40         g-io.adb, s-pack49.adb, s-crc32.ads, s-excmac-arm.ads, a-fzteio.ads,
41         g-busora.ads, s-stausa.adb, system-linux-mips.ads, sequenio.ads,
42         g-exctra.adb, g-rewdat.adb, a-cgaaso.adb, g-io.ads, s-pack49.ads,
43         a-wtflau.adb, a-undesu.adb, s-stausa.ads, a-ztenau.adb, g-enutst.ads,
44         calendar.ads, s-pack58.adb, g-rewdat.ads, g-exctra.ads, s-ststop.adb,
45         a-cgaaso.ads, a-strfix.adb, a-comlin.adb, a-strunb-shared.adb,
46         a-wtflau.ads, a-undesu.ads, a-cbhase.adb, a-ztenau.ads, s-os_lib.adb,
47         a-coorse.adb, a-chlat1.ads, s-pack58.ads, s-ststop.ads, a-strfix.ads,
48         a-comlin.ads, a-strunb-shared.ads, a-nscefu.ads, s-valboo.adb,
49         directio.ads, a-chtgke.adb, a-cbhase.ads, a-wtinau.adb,
50         system-linux-alpha.ads, s-os_lib.ads, a-coorse.ads,
51         system-linux-s390.ads, s-imgwiu.adb, a-chtgop.adb, s-valboo.ads,
52         a-chtgke.ads, a-tienio.adb, s-conca3.adb, a-wtinau.ads,
53         system-darwin-ppc.ads, i-c.adb, s-expllu.adb, g-expect.adb,
54         g-sha256.ads, s-vallld.adb, s-imgwiu.ads, a-chtgop.ads, a-strmap.adb,
55         a-tienio.ads, s-conca3.ads, s-imgint.adb, i-c.ads, s-expllu.ads,
56         s-osprim-darwin.adb, a-cogeso.adb, g-expect.ads, a-iwteio.ads,
57         s-vallld.ads, a-coinho-shared.adb, g-shsh64.adb, a-strmap.ads,
58         g-comlin.adb, a-excpol.adb, s-imgint.ads, a-ztdeau.adb, a-cogeso.ads,
59         a-coinho-shared.ads, g-shsh64.ads, g-comlin.ads, a-stzsup.adb,
60         a-rbtgbk.adb, a-wtmoau.adb, a-ztdeau.ads, s-exnlli.adb, g-tty.adb,
61         g-heasor.adb, g-socthi-dummy.adb, s-llflex.ads, a-zchara.ads,
62         a-stzsup.ads, a-ztcstr.adb, a-rbtgbk.ads, a-sfwtio.ads, a-wtmoau.ads,
63         a-sulcin.adb, s-exnlli.ads, system-freebsd.ads, a-stunha.adb,
64         a-charac.ads, g-tty.ads, g-heasor.ads, s-exctra.adb,
65         g-socthi-dummy.ads, a-coboho.adb, a-ztcstr.ads, a-tideio.adb,
66         a-sulcin.ads, a-wrstfi.adb, g-alleve.adb, s-pack59.adb, a-ngrear.adb,
67         a-stboha.adb, a-stunau-shared.adb, a-stunha.ads, a-lfwtio.ads,
68         s-fileio.adb, s-exctra.ads, a-coboho.ads, a-ioexce.ads, a-tideio.ads,
69         a-ngrear.ads, a-wrstfi.ads, s-pack59.ads, g-alleve.ads, a-stboha.ads,
70         s-poosiz.adb, g-traceb.adb, g-rannum.adb, machcode.ads, s-purexc.ads,
71         s-fileio.ads, a-cfinve.adb, a-crbtgk.adb, system-solaris-x86.ads,
72         s-poosiz.ads, g-rannum.ads, g-traceb.ads, a-except.adb, s-conca4.adb,
73         a-stream.adb, a-cfinve.ads, a-crbtgk.ads, s-wchwts.adb,
74         system-mingw.ads, a-except.ads, s-conca4.ads, a-chzla9.ads,
75         s-valenu.adb, s-soflin.adb, a-stream.ads, a-cgarso.adb, s-valllu.adb,
76         g-crc32.adb, s-wchwts.ads, s-fatflt.ads, s-imguns.adb, s-strcom.adb,
77         g-decstr.adb, s-valenu.ads, s-soflin.ads, a-cgarso.ads, a-cwila1.ads,
78         s-valllu.ads, g-crc32.ads, s-imguns.ads, g-spipat.adb, s-valwch.adb,
79         s-strcom.ads, g-decstr.ads, text_io.ads, g-debuti.adb, s-stchop.adb,
80         g-spipat.ads, s-valwch.ads, a-string.ads, s-exnint.adb, g-awk.adb,
81         g-tasloc.adb, s-wwdenu.adb, s-boustr.adb, a-zchuni.adb, s-stchop.ads,
82         g-debuti.ads, s-stopoo.adb, system-dragonfly-x86_64.ads,
83         system-linux-x86.ads, s-exnint.ads, g-awk.ads, a-stzhas.adb,
84         g-tasloc.ads, s-wwdenu.ads, g-debpoo.adb, g-except.ads,
85         g-sse.ads, s-boustr.ads, a-zchuni.ads, s-bitops.adb, s-wwdwch.adb,
86         s-stopoo.ads, a-catizo.adb, a-stzhas.ads, a-nlcefu.ads, g-debpoo.ads,
87         i-vxwoio.adb, s-bitops.ads, g-io-put-vxworks.adb, s-wwdwch.ads,
88         g-sehamd.adb, a-ssicst.adb, a-catizo.ads, s-mmap.adb, g-string.adb,
89         s-traceb.adb, a-swunau.adb, s-rannum.adb, a-ticoau.adb, i-vxwoio.ads,
90         g-sehamd.ads, a-stwiun.adb, a-ssicst.ads, s-conca5.adb, a-ssitio.ads,
91         s-mmap.ads, a-zttest.adb, g-string.ads, g-sercom.adb, a-cdlili.adb,
92         a-swunau.ads, s-traceb.ads, s-rannum.ads, a-ticoau.ads, system-aix.ads,
93         a-cforma.adb, a-stwiun.ads, s-conca5.ads, s-carsi8.adb, a-zttest.ads,
94         g-sercom.ads, a-cdlili.ads, a-cihama.adb, g-sptain.ads, a-cforma.ads,
95         s-maccod.ads, s-carsi8.ads, a-strsup.adb, g-sha1.adb, a-cihama.ads,
96         g-stseme.adb, s-traent.adb, s-valcha.adb, g-curexc.ads, a-strsup.ads,
97         g-sha1.ads, a-sflcin.ads, s-traent.ads, s-pack10.adb, s-valcha.ads,
98         a-coteio.ads, s-tasloc.adb, g-utf_32.adb, a-suteio.adb, s-except.adb,
99         a-direct.adb, g-stsifd-sockets.adb, a-numaux-vxworks.ads, s-winext.ads,
100         s-pack10.ads, a-ztexio.adb, a-tiflau.adb, system-vxworks-arm.ads,
101         s-tasloc.ads, a-suteio.ads, g-utf_32.ads, s-except.ads,
102         a-direct.ads, a-swbwha.adb, g-hesorg.adb, s-wwdcha.adb, a-wtedit.adb,
103         a-ztexio.ads, a-wtcoio.adb, a-tiflau.ads, a-ssizti.ads, s-casi32.adb,
104         a-swbwha.ads, s-veboop.adb, g-hesorg.ads, s-parame-rtems.adb,
105         s-wwdcha.ads, a-wtedit.ads, a-stuten.adb, a-coinve.adb, a-wtcoio.ads,
106         s-casi32.ads, s-string.adb, a-tiinau.adb, a-cusyqu.adb, s-conca6.adb,
107         s-veboop.ads, a-cgcaso.adb, a-numaux-darwin.adb, a-envvar.adb,
108         a-stuten.ads, s-secsta.adb, a-coinve.ads, s-string.ads, a-cusyqu.ads,
109         a-tiinau.ads, s-osprim-vxworks.adb, s-conca6.ads, g-spchge.adb,
110         s-parint.adb, a-cuprqu.adb, a-cgcaso.ads, a-numaux-darwin.ads,
111         a-envvar.ads, s-secsta.ads, g-spchge.ads, s-parint.ads, a-cuprqu.ads,
112         a-swuwti.adb, a-flteio.ads, a-sbhcin.adb, a-coprnu.adb, g-u3spch.adb,
113         s-atocou.adb, g-ctrl_c.adb, a-swuwti.ads, a-calend.adb, a-sbhcin.ads,
114         a-coprnu.ads, g-dirope.adb, g-sha512.ads, g-u3spch.ads, s-atocou.ads,
115         g-ctrl_c.ads, a-timoau.adb, a-witeio.adb, s-pack11.adb, a-strhas.adb,
116         a-wtflio.adb, g-spitbo.adb, a-calend.ads, a-ztenio.adb, g-dirope.ads,
117         a-slcain.adb, g-sechas.adb, a-timoau.ads, a-witeio.ads, s-pack11.ads,
118         s-shasto.adb, s-traceb-mastop.adb, a-ciorse.adb, s-utf_32.adb,
119         a-strhas.ads, a-wtflio.ads, g-spitbo.ads, a-ztenio.ads, a-slcain.ads,
120         g-sechas.ads, s-gearop.adb, a-siztio.ads, s-pack20.adb, s-shasto.ads,
121         a-ciorse.ads, s-utf_32.ads, s-crtl.ads, a-wtinio.adb, s-elaall.adb,
122         s-explli.adb, s-chepoo.ads, s-gearop.ads, a-einuoc.adb, s-pack20.ads,
123         system-linux-ia64.ads, a-swunau-shared.adb, a-wtinio.ads, g-alvety.ads,
124         a-liztio.ads, g-calend.adb, s-conca7.adb, s-elaall.ads, s-explli.ads,
125         a-einuoc.ads, s-widboo.adb, s-imgdec.adb, a-cbhama.adb, g-calend.ads,
126         s-conca7.ads, a-llitio.ads, i-cexten.ads, a-coorma.adb, s-widboo.ads,
127         s-diflio.adb, g-souinf.ads, s-imgdec.ads, g-strhas.ads, a-cbhama.ads,
128         g-shshco.adb, a-ztdeio.adb, s-gloloc.adb, a-coorma.ads, g-wispch.adb,
129         s-pack03.adb, g-eacodu.adb, s-casi16.adb, s-diflio.ads, a-colien.adb,
130         g-shshco.ads, a-wtmoio.adb, a-rbtgbo.adb, a-ztdeio.ads,
131         system-rtems.ads, s-gloloc.ads, a-csquin.ads, a-cofuse.adb,
132         g-wispch.ads, s-pack03.ads, s-casi16.ads, s-io.adb, a-colien.ads,
133         g-alveop.adb, gnat.ads, s-diinio.adb, a-cfdlli.adb, g-pehage.adb,
134         a-wtmoio.ads, a-stwiha.adb, a-locale.adb, a-tirsfi.adb, a-nscoty.ads,
135         a-rbtgbo.ads, s-pack12.adb, a-cofuse.ads, a-sfteio.ads, s-io.ads,
136         g-alveop.ads, a-cfdlli.ads, s-diinio.ads, a-stwiha.ads, g-pehage.ads,
137         a-locale.ads, a-tirsfi.ads, s-pack12.ads, s-valuti.adb, g-cppexc.adb,
138         system-vxworks-ppc.ads, g-memdum.adb, a-lfteio.ads, s-pack21.adb,
139         s-unstyp.ads, s-valuti.ads, g-cppexc.ads, system-hpux-ia64.ads,
140         g-memdum.ads, g-soccon.ads, g-altive.ads, a-crbtgo.adb, s-pack21.ads,
141         a-llizti.ads, a-numaux-libc-x86.ads, s-expint.adb, s-conca8.adb,
142         a-crbtgo.ads, s-pack30.adb, s-vallli.adb, s-geveop.adb, s-expint.ads,
143         a-direio.adb, s-conca8.ads, a-widcha.ads, s-pack30.ads, s-vallli.ads,
144         s-strhas.adb, s-geveop.ads, g-md5.adb, a-direio.ads, a-numaux.ads,
145         s-ransee.adb, a-szbzha.adb, i-cobol.adb, g-busorg.adb, s-strhas.ads,
146         g-md5.ads, s-widenu.adb, s-ransee.ads, s-widllu.adb, a-szbzha.ads,
147         a-ststio.adb, i-cobol.ads, g-busorg.ads, g-regpat.adb, s-widenu.ads,
148         a-secain.adb, s-widllu.ads, s-pack13.adb, g-encstr.adb, a-ztcoau.adb,
149         a-ststio.ads, s-widwch.adb, g-regpat.ads, s-atacco.adb, a-cborse.adb,
150         a-secain.ads, s-pack13.ads, g-encstr.ads, a-ztcoau.ads, s-widwch.ads,
151         g-io_aux.adb, s-atacco.ads, a-ncelfu.ads, interfac.ads, a-cborse.ads,
152         g-regexp.adb, s-pack22.adb, a-szuzti.adb, g-io_aux.ads, s-caun32.adb,
153         a-nselfu.ads, g-regexp.ads, s-pack22.ads, a-ticoio.adb, a-szuzti.ads,
154         g-diopit.adb, s-caun32.ads, s-conca9.adb, a-tags.adb, a-swmwco.ads,
155         a-sbecin.adb, s-pack31.adb, s-expuns.adb, a-ticoio.ads, s-valint.adb,
156         s-conca9.ads, g-diopit.ads, a-tags.ads, a-nllcef.ads, a-izteio.ads,
157         a-sbecin.ads, s-expuns.ads, s-pack31.ads, g-dyntab.adb, s-powtab.ads,
158         s-flocon-none.adb, s-valint.ads, a-ssiwti.ads, s-mmosin-mingw.adb,
159         s-pack40.adb, s-pack05.adb, a-ztflau.adb, g-dyntab.ads,
160         a-szuzti-shared.adb, g-alvevi.ads, a-stwise.adb, s-mmosin-mingw.ads,
161         s-pack40.ads, a-diocst.adb, a-ztflau.ads, s-pack05.ads, a-nlcoty.ads,
162         a-contai.ads, a-stwisu.adb, g-byorma.adb, a-siwtio.ads, a-stwise.ads,
163         s-regpat.adb, g-mbdira.adb, s-pack14.adb, a-diocst.ads, g-flocon.ads,
164         g-mbflra.adb, a-ztinau.adb, s-dim.ads, s-mantis.adb, a-stwisu.ads,
165         g-byorma.ads, s-atopri.adb, g-wistsp.ads, a-uncdea.ads, s-widcha.adb,
166         a-caldel.adb, s-regpat.ads, g-mbdira.ads, a-tiflio.adb, s-pack14.ads,
167         s-parame.adb, a-liwtio.ads, s-memory.adb, g-mbflra.ads, a-ztinau.ads,
168         a-wtgeau.adb, s-direio.adb, s-mantis.ads, s-atopri.ads, s-widcha.ads,
169         a-caldel.ads, s-pack23.adb, a-unccon.ads, a-tiflio.ads, s-parame.ads,
170         a-llftio.ads, s-memory.ads, s-regexp.adb, a-wtgeau.ads, a-exexda.adb,
171         s-direio.ads, s-pack23.ads, g-stheme.adb, a-tiinio.adb, g-sestin.ads,
172         s-regexp.ads, a-wtfiio.adb, a-comutr.adb, a-exexpr.adb, a-tiinio.ads,
173         a-ztmoau.adb, a-cohata.ads, a-wtfiio.ads, s-imgrea.adb, ada.ads,
174         a-szunau-shared.adb, a-comutr.ads, s-valuns.adb, a-ztmoau.ads,
175         system-linux-arm.ads, s-osprim-x32.adb, s-pack41.adb, s-pack06.adb,
176         s-imgrea.ads, s-valuns.ads, s-finroo.adb, s-caun16.adb, s-pooglo.adb,
177         a-zrstfi.adb, a-suenst.adb, s-pack41.ads, g-binenv.adb, s-pack06.ads,
178         a-calari.adb, a-nlcoar.ads, s-finroo.ads, a-timoio.adb, s-caun16.ads,
179         s-flocon.adb, a-suenst.ads, a-zrstfi.ads, s-pooglo.ads, s-wchcon.adb,
180         s-traceb-hpux.adb, s-pack50.adb, i-fortra.adb, s-pack15.adb,
181         a-ngcefu.adb, g-sptavs.ads, g-binenv.ads, s-wchjis.adb, a-calari.ads,
182         a-timoio.ads, a-decima.adb, s-flocon.ads, s-wchcon.ads, a-llfzti.ads,
183         i-fortra.ads, s-pack50.ads, s-pack15.ads, a-ngcefu.ads, a-cfhase.adb,
184         s-wchjis.ads, g-soliop.ads, a-decima.ads, a-chlat9.ads, s-pack24.adb,
185         a-nlelfu.ads, a-cfhase.ads, g-locfil.adb, s-atocou-builtin.adb,
186         s-memcop.ads, a-szunau.adb, s-pack24.ads, s-imgllb.adb, s-auxdec.adb,
187         g-locfil.ads, s-pack33.adb, a-szunau.ads, s-parame-vxworks.adb,
188         s-imgllb.ads, a-ciorma.adb, s-auxdec.ads, a-cobove.adb, s-dsaser.ads,
189         a-elchha.adb, s-pack33.ads, a-cofuve.adb, s-parame-vxworks.ads,
190         a-ciorma.ads, system-darwin-x86.ads, s-multip.adb, a-stwiun-shared.adb,
191         a-wichun.adb, a-cobove.ads, s-imgbiu.adb, s-tsmona-mingw.adb,
192         a-coormu.adb, a-siocst.adb, s-win32.ads, a-elchha.ads, s-pack42.adb,
193         s-pack07.adb, a-cofuve.ads, system-hpux.ads, a-teioed.adb,
194         a-convec.adb, g-speche.adb, s-multip.ads, a-stwiun-shared.ads,
195         a-wichun.ads, s-imgbiu.ads, a-numeri.ads, a-siocst.ads, a-coormu.ads,
196         a-lliwti.ads, s-pack42.ads, s-pack07.ads, a-teioed.ads, a-convec.ads,
197         g-speche.ads, g-socthi.adb, a-nucoty.ads, a-szmzco.ads, s-pack51.adb,
198         s-osprim-mingw.adb, s-casi64.adb, g-strspl.ads, g-socthi.ads,
199         g-socket-dummy.adb, s-pack51.ads, s-dimmks.ads, s-casi64.ads,
200         a-wtenau.adb, s-stchop-vxworks.adb, s-pack60.adb,
201         system-solaris-sparc.ads, s-pack25.adb, g-socket-dummy.ads,
202         a-exstat.adb, a-cofuma.adb, s-tsmona-linux.adb, a-wtenau.ads,
203         s-pack60.ads, s-pack25.ads, i-cstrea.adb, a-cofuma.ads, g-exptty.adb,
204         a-chzla1.ads, s-pack34.adb, i-cstrea.ads, s-excdeb.adb, a-iteint.ads,
205         g-exptty.ads, i-pacdec.adb, s-pack34.ads, s-rident.ads, s-sopco3.adb,
206         i-vxwork.ads, s-excdeb.ads, system-linux-ppc.ads, a-swuwti-shared.adb,
207         s-widlli.adb, s-pack43.adb, i-pacdec.ads, a-cwila9.ads, s-sopco3.ads,
208         a-fwteio.ads, s-widlli.ads, s-pack43.ads, a-suhcin.adb, a-wtdeau.adb,
209         g-allein.ads, a-suezst.adb, a-dirval-mingw.adb, g-zspche.adb,
210         s-bignum.adb, a-ztedit.adb, g-regist.adb, a-nllefu.ads, a-ztcoio.adb,
211         s-pack52.adb, a-llctio.ads, a-nucoar.ads, s-pack17.adb, a-suhcin.ads,
212         a-wtdeau.ads, a-suezst.ads, a-dirval.adb, g-zspche.ads, g-regist.ads,
213         a-ztedit.ads, s-bignum.ads, a-wtcstr.adb, system.ads, s-pack52.ads,
214         a-ztcoio.ads, s-pack17.ads, s-imgboo.adb, a-rbtgso.adb, a-dirval.ads,
215         a-cohase.adb, s-pack61.adb, a-wtcstr.ads, s-pack26.adb, s-osprim.ads,
216         a-tigeau.adb, s-imgboo.ads, a-nuelfu.ads, a-swfwha.ads, s-commun.adb,
217         g-socthi-vxworks.adb, a-rbtgso.ads, a-cohase.ads, g-zstspl.ads,
218         s-pack61.ads, s-pack26.ads, a-intnam-dragonfly.ads, s-imglld.adb,
219         a-tigeau.ads, s-commun.ads, g-socthi-vxworks.ads, a-cborma.adb,
220         a-stwifi.adb, g-moreex.adb, s-pack35.adb, s-imglld.ads, s-valdec.adb,
221         a-tifiio.adb, a-cborma.ads, g-moreex.ads, a-stwifi.ads, s-pack35.ads,
222         s-sopco4.adb, g-sha224.ads, g-socket.adb, a-intnam-rtems.ads,
223         s-finmas.adb, s-valdec.ads, s-addima.adb, a-finali.adb, a-tifiio.ads,
224         s-rpc.adb, a-ztflio.adb, s-pack44.adb, s-pack09.adb, a-sblcin.adb,
225         s-sopco4.ads, a-textio.adb, g-socket.ads, g-sptabo.ads, s-finmas.ads,
226         g-shsh32.adb, s-addima.ads, a-finali.ads, s-mmauni-long.ads, s-rpc.ads,
227         a-ztflio.ads, system-djgpp.ads, s-stache.adb, s-pack44.ads,
228         s-pack09.ads, a-sblcin.ads, a-textio.ads, a-cidlli.adb, g-shsh32.ads,
229         a-chtgbk.adb, a-tiocst.adb, s-pack53.adb, s-pack18.adb, s-stache.ads,
230         a-zchhan.adb, s-fatlfl.ads, a-ztinio.adb, s-strops.adb, a-siteio.ads,
231         a-cidlli.ads, a-chtgbk.ads, g-ssvety.ads, a-tiocst.ads, s-pack53.ads,
232         s-parame-hpux.ads, s-pack18.ads, a-zchhan.ads, s-strops.ads,
233         a-ztinio.ads, a-wichha.adb, a-stwima.adb, a-nlrear.ads, a-liteio.ads,
234         s-pack62.adb, s-pack27.adb, s-fore.adb, s-vercon.adb, a-wichha.ads,
235         a-stwima.ads, s-pack62.ads, system-linux-sparc.ads, s-pack27.ads,
236         g-dynhta.adb, s-fore.ads, s-vercon.ads, a-cofuba.adb, a-cimutr.adb,
237         i-cpoint.adb, s-imgenu.adb, a-stwibo.adb, s-pack36.adb, i-cstrin.adb,
238         s-imgllu.adb, a-suteio-shared.adb, g-excact.adb, s-stoele.adb,
239         s-addope.adb, g-dynhta.ads, a-cofuba.ads, a-ztmoio.adb, a-llfwti.ads,
240         a-cimutr.ads, i-cpoint.ads, s-imgenu.ads, a-stwibo.ads, a-wttest.adb,
241         s-pack36.ads, a-tgdico.ads, s-sopco5.adb, s-scaval.adb, i-cstrin.ads,
242         s-imgllu.ads, g-excact.ads, s-stoele.ads, g-deutst.ads, s-addope.ads,
243         s-imgwch.adb, g-sha384.ads, a-ztmoio.ads, s-pack45.adb, a-wttest.ads,
244         s-sopco5.ads, s-excmac-gcc.adb, s-scaval.ads, a-storio.adb,
245         a-coinho.adb, a-btgbso.adb, s-imgwch.ads, s-carun8.adb, memtrack.adb,
246         s-pack45.ads, a-sfhcin.ads, s-excmac-gcc.ads, a-storio.ads,
247         a-coinho.ads, a-btgbso.ads, s-stratt.adb, s-carun8.ads, a-shcain.adb,
248         s-pack54.adb, s-pack19.adb, a-colire.adb, a-tigeli.adb, s-caun64.adb,
249         s-stratt.ads, s-fatgen.adb, a-shcain.ads, a-stzunb-shared.adb,
250         s-pack54.ads, s-pack19.ads, a-colire.ads, a-calcon.adb, s-caun64.ads,
251         s-fatgen.ads, s-pack63.adb, g-arrspl.adb, a-stzunb-shared.ads,
252         s-pack28.adb, a-nllrar.ads, a-zzboio.adb, a-zzunio.ads, a-stunau.adb,
253         a-calcon.ads, g-cgideb.adb, s-objrea.adb, s-mastop.adb, a-tienau.adb,
254         g-altcon.adb, g-arrspl.ads, s-pack63.ads, s-restri.adb, s-pack28.ads,
255         a-zzboio.ads, a-stunau.ads, g-cgideb.ads, g-htable.adb, g-sothco.adb,
256         s-objrea.ads, g-soliop-solaris.ads, s-mastop.ads, a-tienau.ads,
257         system-linux-m68k.ads, g-altcon.ads, s-dmotpr.ads, s-memory-mingw.adb,
258         g-cgicoo.adb, s-pack37.adb, s-restri.ads, s-fatllf.ads, s-expmod.adb,
259         a-swuwha.adb, a-exextr.adb, a-cfhama.adb, s-gloloc-mingw.adb,
260         a-tiboio.adb, g-forstr.adb, g-sothco.ads, a-stzbou.adb, a-nllcty.ads,
261         a-suecin.adb, g-htable.ads, s-exctab.adb, a-tiunio.ads, g-cgicoo.ads,
262         s-osprim-posix.adb, s-pack37.ads, a-ciormu.adb, s-atocou-x86.adb,
263         a-swuwha.ads, s-expmod.ads, a-cfhama.ads, s-ficobl.ads, a-ngcoty.adb,
264         g-forstr.ads, a-tiboio.ads, a-calfor.adb, a-stzbou.ads, a-suecin.ads,
265         a-conhel.adb, a-crbltr.ads, s-exctab.ads, a-dhfina.ads, s-imgcha.adb,
266         s-pack46.adb, a-ciormu.ads, system-linux-sh4.ads, a-chahan.adb,
267         a-ngcoty.ads, a-stzunb.adb, a-szfzha.ads, a-calfor.ads, a-cbdlli.adb,
268         a-conhel.ads, s-imgcha.ads, s-pack46.ads, a-assert.adb, a-chahan.ads,
269         a-stzunb.ads, a-crdlli.adb, s-pack55.adb, a-cbdlli.ads, a-tideau.adb,
270         a-assert.ads, ioexcept.ads, s-boarop.ads, g-hesora.adb, a-crdlli.ads,
271         s-pack55.ads, a-tideau.ads, g-bubsor.adb, a-wtenio.adb, a-cbsyqu.adb,
272         g-hesora.ads, s-pack29.adb, a-nurear.ads, g-catiio.adb, s-stposu.adb,
273         g-bubsor.ads, a-wtenio.ads, a-cbsyqu.ads, a-suewst.adb,
274         system-vxworks-x86.ads, s-pack29.ads, a-cbmutr.adb, a-cbprqu.adb,
275         s-imenne.adb, g-sothco-dummy.adb, g-casuti.adb, g-catiio.ads,
276         s-stposu.ads, a-stzsea.adb, s-pack38.adb, a-suewst.ads, s-imgllw.adb,
277         a-cbprqu.ads, a-cbmutr.ads, s-imenne.ads, g-sothco-dummy.ads,
278         g-casuti.ads, s-htable.adb, s-fatsfl.ads, g-trasym.adb, unchconv.ads,
279         a-stzsea.ads, s-arit64.adb, s-pack38.ads, a-nllcar.ads, s-valrea.adb,
280         s-imgllw.ads, s-htable.ads, a-sequio.adb, g-trasym.ads, a-ngcoar.adb,
281         s-exnllf.adb, s-pack47.adb, s-arit64.ads, g-sercom-mingw.adb,
282         s-valrea.ads, g-socthi-mingw.adb, g-bytswa.adb, g-sehash.adb,
283         unchdeal.ads, a-sequio.ads, a-ngcoar.ads, s-exnllf.ads, a-wtdeio.adb,
284         s-pack47.ads, g-socthi-mingw.ads, a-excpol-abort.adb, a-ztgeau.adb,
285         g-bytswa.ads, g-sehash.ads, s-pack56.adb, a-wtdeio.ads, a-ngelfu.adb,
286         a-ztgeau.ads, a-cforse.adb, s-filatt.ads, a-stzfix.adb, a-cihase.adb,
287         s-pack56.ads, a-sfztio.ads, a-ngelfu.ads, s-trasym-dwarf.adb,
288         a-cforse.ads, a-ztfiio.adb, g-timsta.adb, a-stzfix.ads, a-cihase.ads,
289         a-ztfiio.ads, system-darwin-arm.ads: Move non-tasking runtime sources
290         to libgnat subdirectory.
292 2017-09-08  Yannick Moy  <moy@adacore.com>
294         * sem_aux.adb, sem_aux.ads (Get_Called_Entity): New function to
295         return the entity associated with the call.
296         * sem_util.adb, sem_util.ads (Check_Function_Writable_Actuals):
297         Replace the internal Get_Function_Id with the new
298         Sem_Aux.Get_Called_Entity.
299         (Iterate_Call_Parameters): New
300         procedure to iterate on formals and actuals at the same time.
301         * sem_ch12.adb (Analyze_Subprogram_Instantiation):
302         Set SPARK_Mode from spec when set, for analysis
303         of instance. Restore after analysis of instance.
304         (Instantiate_Subprogram_Body): Set SPARK_Mode from body when
305         set, for analysis of body instance. Restored automatically at
306         the end of the subprogram.
307         * gnat1drv.adb (Adjust_Global_Switches): Set
308         Check_Validity_Of_Parameters to False in GNATprove mode.
309         * opt.ads (Check_Validity_Of_Parameters): Document switch to
310         set option.
312 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
314         * sem_util.adb (NCT_Tables_In_Use): Move to library level from...
315         (New_Copy_Tree): ...there.  Reset the hash tables only if they
316         were used in the previous invocation.
317         * s-htable.adb: Fix typo.
319 2017-09-08  Bob Duff  <duff@adacore.com>
321         * a-ssicst.adb (Open): Set File.Last_Op to the appropriate value.
323 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
325         * sem_aggr.adb: minor style fix.
327 2017-09-08  Bob Duff  <duff@adacore.com>
329         * sprint.adb (Write_Corresponding_Source): Ignore if there is
330         no current source file.
331         (Write_Name_With_Col_Check, Write_Name_With_Col_Check_Sloc):
332         Print something helpful in case N is invalid.
333         * sprint.ads: Minor comment fix.
335 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
337         * exp_aggr.adb: (Aggr_Assignment_OK_For_Backend): Add early return for
338         access types.
340 2017-09-08  Bob Duff  <duff@adacore.com>
342         * par-prag.adb, sem_prag.adb, snames.ads-tmpl: Implement pragma
343         Ada_2020, along the same lines as the other Ada version pragmas.
345 2017-09-08  Gary Dismukes  <dismukes@adacore.com>
347         * sem_ch12.adb: Minor typo fixes and reformatting.
349 2017-09-08  Yannick Moy  <moy@adacore.com>
351         * sem_aggr.adb (Resolve_Record_Aggregate):
352         Rewrite bounds of aggregate subexpressions which may depend on
353         discriminants of the enclosing aggregate.
355 2017-09-08  Yannick Moy  <moy@adacore.com>
357         * sem_ch5.adb: Prevent assertion failure on illegal code.
359 2017-09-08  Yannick Moy  <moy@adacore.com>
361         * lib-xref-spark_specific.adb (Add_SPARK_Xrefs.Is_SPARK_Scope): Avoid
362         calling Renamed_Entity on an entity which cannot be a renaming.
364 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
366         * exp_aggr.adb: Add with & use clause for Urealp.
367         (Aggr_Assignment_OK_For_Backend): Accept (almost all)
368         elementary types instead of just discrete types.
369         * sem_eval.adb (Expr_Value): Deal with N_Null for access types.
370         * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>:
371         Be prepared for the FP zero value in the memset case.  Add small
372         guard.
374 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
376         * s-htable.adb (Static_HTable.Reset): Use aggregate instead
377         of loop.
379 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
381         * exp_aggr.adb (Expand_Array_Aggregate): Use New_Copy_Tree instead
382         of New_Copy because the latter leaves the syntactic structure of
383         the tree inconsistent (a child is accessible through two parents)
384         and prevents proper replication of itypes by subsequent calls
385         to New_Copy_Tree.
386         * exp_ch4.adb (Expand_Concatenate): Use New_Copy_Tree instead of
387         New_Copy because the latter leaves the syntactic structure of the
388         tree inconsistent (a child is accessible through two parents)
389         and prevents proper replication of itypes by subsequent calls
390         to New_Copy_Tree.
391         * sem_util.adb (In_Subtree): New routine.
392         (New_Copy_Tree): Reimplemented.
393         * sem_util.ads (In_Subtree): New routine.
394         (New_Copy_Tree): Reimplemented.
396 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
398         * sem_ch13.adb (Resolve_Aspect_Expressions): The expression
399         for aspect Default_Value is a static scalar value, but it does
400         not freeze the type. Yhis allows for subsequent representation
401         clauses for the type.
403 2017-09-08  Javier Miranda  <miranda@adacore.com>
405         * sem_ch8.adb (Find_Direct_Name.Undefined): Do
406         not add entries into the undefined reference table when we are
407         compiling with errors ignored.
409 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
411         * sem_ch12.adb (Check_Formal_Packages): Do not apply conformance
412         check if the instance is within an enclosing instance body. The
413         formal package was legal in the enclosing generic, and is
414         legal in the enclosing instantiation.  This optimisation may be
415         applicable elsewhere, and it also removes spurious errors that
416         may arise with on-the-fly processing  of instantiations that
417         contain Inline_Always subprograms.
419 2017-09-08  Vincent Celier  <celier@adacore.com>
421         * gnatcmd.adb: Disregard empty argument of GNAT driver.
423 2017-09-08  Justin Squirek  <squirek@adacore.com>
425         * checks.adb (Insert_Valid_Check): Manually decorate
426         the generated temporary for range valdity checks.
428 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
430         * usage.adb (Usage): Document new -gnatw.q/-gnatw.Q switches.
432 2017-09-08  Justin Squirek  <squirek@adacore.com>
434         * switch-c.adb (Scan_Front_End_Switches): Add new warning switch
435         case to handle underscore flags.
436         * warnsw.adb, warnsw.ads (Set_Underscore_Warning_Switch): Create
437         new procedure to handle underscores.
439 2017-09-08  Javier Miranda  <miranda@adacore.com>
441         * exp_ch4.adb (Expand_N_Op_Divide): Reordering code that handles
442         divisions with fixed point results to avoid generating twice
443         the runtime check on divide by zero.
444         * checks.adb (Apply_Divide_Checks): Ensure that operands are
445         not evaluated twice (once for their runtime checks and once for
446         their regular computation).
448 2017-09-08  Yannick Moy  <moy@adacore.com>
450         * sem_prag.adb (Analyze_Part_Of): Add missing
451         return statements after issuing errors.  Add detection of
452         out-of-order item and single concurrent type.
454 2017-09-08  Nicolas Roche  <roche@adacore.com>
456         * gcc-interface/Makefile.in, a-extiti.ads, s-taprop-linux.adb,
457         s-osinte-solaris.adb, a-intnam.ads, s-osinte-solaris.ads,
458         s-tpobop.adb, s-intman-android.adb, s-tasinf.adb, s-tpobop.ads,
459         s-tasinf.ads, i-vxinco.adb, a-exetim-posix.adb, i-vxinco.ads,
460         a-astaco.adb, a-astaco.ads, s-tporft.adb, s-tpoaal.adb, a-taside.adb,
461         a-taside.ads, s-tpopsp-posix.adb, s-tasdeb.adb, s-tasdeb.ads,
462         s-tpoben.adb, a-dinopr.ads, s-inmaop-vxworks.adb, s-tpoben.ads,
463         s-interr-vxworks.adb, s-interr-dummy.adb, s-tassta.adb,
464         a-intnam-mingw.ads, s-tassta.ads, s-taasde.adb, a-stcoed.ads,
465         s-taasde.ads, s-osinte-darwin.adb, s-proinf.adb, s-taprop-dummy.adb,
466         s-osinte-darwin.ads, s-proinf.ads, s-linux.ads, a-intnam-linux.ads,
467         s-tasren.adb, s-tasren.ads, s-mudido.adb, g-semaph.adb, s-mudido.ads,
468         s-taprop-posix.adb, g-semaph.ads, s-osinte-mingw.ads, s-vxwork-x86.ads,
469         s-tposen.adb, s-linux-sparc.ads, s-taprop-vxworks.adb, s-tasini.adb,
470         s-tposen.ads, s-tasini.ads, a-etgrbu.ads, s-interr-hwint.adb,
471         s-osinte-linux.ads, s-taprop.ads, s-tasque.adb, s-tasque.ads,
472         s-taenca.adb, s-taspri-vxworks.ads, s-taenca.ads, a-dynpri.adb,
473         s-tpopsp-solaris.adb, a-dynpri.ads, s-taprop-hpux-dce.adb,
474         a-interr.adb, a-intnam-freebsd.ads, s-tarest.adb, a-interr.ads,
475         s-intman-susv3.adb, a-synbar.adb, a-intnam-dummy.ads, s-tadeca.adb,
476         s-osinte-vxworks.adb, s-tarest.ads, s-taskin.adb, a-synbar.ads,
477         s-taspri-hpux-dce.ads, s-tadeca.ads, s-osinte-vxworks.ads,
478         s-taskin.ads, s-intman-solaris.adb, a-sytaco.adb, s-vxwext-kernel.adb,
479         s-mudido-affinity.adb, a-sytaco.ads, s-vxwext-kernel.ads, s-taprob.adb,
480         s-intman-mingw.adb, s-taprob.ads, s-osinte-kfreebsd-gnu.ads,
481         s-osinte-dummy.ads, s-osinte-gnu.adb, s-osinte-rtems.adb, s-interr.adb,
482         s-inmaop.ads, s-vxwext-rtp.adb, s-osinte-gnu.ads, s-osinte-rtems.ads,
483         a-synbar-posix.adb, s-interr.ads, s-taspri-posix-noaltstack.ads,
484         s-vxwext-rtp.ads, a-synbar-posix.ads, a-extiin.ads, s-osinte-posix.adb,
485         s-tpinop.adb, s-tasres.ads, s-tpinop.ads, a-disedf.ads, a-diroro.ads,
486         s-linux-alpha.ads, a-tasatt.adb, s-solita.adb, a-intnam-solaris.ads,
487         a-tasatt.ads, s-solita.ads, s-tasinf-solaris.adb, s-tasinf-solaris.ads,
488         s-vxwork-arm.ads, s-tpopsp-posix-foreign.adb, s-intman-dummy.adb,
489         s-intman.ads, s-stusta.adb, s-stusta.ads, s-intman-posix.adb,
490         s-tpopsp-vxworks.adb, s-inmaop-dummy.adb, s-taspri-mingw.ads,
491         a-intnam-darwin.ads, s-osinte-aix.adb, s-osinte-dragonfly.adb,
492         s-osinte-aix.ads, s-tasinf-mingw.adb, s-osinte-dragonfly.ads,
493         s-linux-hppa.ads, s-osinte-x32.adb, s-inmaop-posix.adb,
494         s-tasinf-mingw.ads, s-intman-vxworks.adb, s-linux-mips.ads,
495         s-intman-vxworks.ads, s-osinte-android.adb, s-tasinf-linux.adb,
496         s-osinte-android.ads, s-vxwork-ppc.ads, s-tasinf-linux.ads,
497         a-dispat.adb, a-dispat.ads, s-tadert.adb, g-thread.adb, s-tadert.ads,
498         g-thread.ads, a-intnam-hpux.ads, s-linux-android.ads, s-tataat.adb,
499         a-exetim.ads, s-tataat.ads, a-reatim.adb, a-reatim.ads, thread.c,
500         g-boubuf.adb, s-osinte-freebsd.adb, g-boubuf.ads, s-osinte-freebsd.ads,
501         s-tasuti.adb, s-taspri-dummy.ads, a-exetim-mingw.adb, s-linux-x32.ads,
502         s-tasuti.ads, g-signal.adb, a-exetim-mingw.ads, s-interr-sigaction.adb,
503         g-signal.ads, s-osinte-hpux.ads, a-intnam-vxworks.ads,
504         s-osinte-hpux-dce.adb, s-taspri-posix.ads, s-osinte-hpux-dce.ads,
505         s-tasinf-vxworks.ads, g-tastus.ads, s-tpopsp-tls.adb,
506         s-taprop-solaris.adb, a-retide.adb, a-exetim-darwin.adb, a-retide.ads,
507         s-vxwext.adb, s-vxwext.ads, a-rttiev.adb, a-rttiev.ads, g-boumai.ads,
508         a-exetim-default.ads, s-taprop-mingw.adb, s-taspri-solaris.ads,
509         a-intnam-aix.ads: Move libgnarl sources to libgnarl subdir.
511 2017-09-08  Arnaud Charlet <charlet@adacore.com>
513         * doc/share/conf.py, doc/share/latex_elements.py,
514         doc/share/ada_pygments.py, doc/Makefile: Improve support for Ada
515         highlighting.
517 2017-09-08  Arnaud Charlet <charlet@adacore.com>
519         * gnat_rm.texi, gnat_ugn.texi,
520         doc/gnat_ugn/the_gnat_compilation_model.rst,
521         doc/gnat_ugn/getting_started_with_gnat.rst,
522         doc/gnat_ugn/inline_assembler.rst,
523         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
524         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
525         doc/gnat_ugn/about_this_guide.rst,
526         doc/gnat_ugn/platform_specific_information.rst,
527         doc/gnat_ugn/example_of_binder_output.rst,
528         doc/gnat_ugn/gnat_and_program_execution.rst,
529         doc/gnat_ugn/gnat_utility_programs.rst,
530         doc/gnat_rm/implementation_of_specific_ada_features.rst,
531         doc/gnat_rm/interfacing_to_other_languages.rst,
532         doc/gnat_rm/implementation_defined_aspects.rst,
533         doc/gnat_rm/intrinsic_subprograms.rst,
534         doc/gnat_rm/implementation_defined_characteristics.rst,
535         doc/gnat_rm/implementation_advice.rst,
536         doc/gnat_rm/implementation_defined_attributes.rst,
537         doc/gnat_rm/compatibility_and_porting_guide.rst,
538         doc/gnat_rm/standard_library_routines.rst,
539         doc/gnat_rm/the_gnat_library.rst,
540         doc/gnat_rm/implementation_defined_pragmas.rst,
541         doc/gnat_rm/representation_clauses_and_pragmas.rst,
542         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
543         doc/gnat_rm/obsolescent_features.rst,
544         doc/gnat_rm/about_this_guide.rst,
545         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
546         doc/gnat_rm/implementation_of_ada_2012_features.rst,
547         doc/gnat_ugn.rst,
548         doc/gnat_rm.rst: Update documentation.
550 2017-09-08  Arnaud Charlet <charlet@adacore.com>
552         * s-dwalin.ads, s-dwalin.adb, s-trasym-dwarf.adb, s-objrea.ads,
553         s-objrea.adb, s-tsmona-linux.adb, s-tsmona-mingw.adb: New.
554         * gcc-interface/Makefile.in: Enable s-trasym-dwarf.adb on x86*linux.
556 2017-09-08  Bob Duff  <duff@adacore.com>
558         * s-ststop.ads, s-ststop.adb, rtsfind.ads (String_Input_Tag):
559         New routine to read the Tag robustly.
560         * exp_attr.adb (Input): Change the expansion of 'Input,
561         in the class-wide case, to call String_Input_Tag instead of
562         String_Input_Blk_IO.
564 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
566         * s-rident.ads (Restriction_Id): reorder enum
567         literals, so that Pure_Barriers is no longer in range of the
568         Cunit_Boolean_Restrictions subtype.
570 2017-09-08  Nicolas Roche  <roche@adacore.com>
572         * a-taster.ads, a-taster.adb: Move to libgnarl
573         * gcc-interface/Makefile.in: Remove obsolete targets. Code cleanups.
574         Add support for files in libgnarl.
576 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
578         * exp_ch4.adb (Expand_N_Type_Conversion): Do not apply
579         accessibility check to an interface conversion, whose purpose
580         is to perform a pointer adjustment in a dispatching call.
581         * exp_ch6.adb (Expand_Call_JHelper): Add accessibility checks
582         when the actual is a construct that involves a dereference of an
583         expression that includes a formal of the enclosing subprogram,
584         In such cases, the accessibility level of the actual is that of
585         the corresponding formal, which is passed in as an additional
586         actual in the outer call.
588 2017-09-08  Bob Duff  <duff@adacore.com>
590         * exp_intr.adb (Add_Source_Info): Do not decode
591         file names; they were not encoded in the first place.
593 2017-09-08  Bob Duff  <duff@adacore.com>
595         * a-tags.adb (Internal_Tag): Unsuppress checks, so we get
596         exceptions instead of crashes. Check for absurdly long strings
597         and empty strings. Empty strings cause trouble because they can
598         have super-null ranges (e.g. 100..10), which causes Ext_Copy to
599         be empty, which causes an array index out of bounds.
600         * s-ststop.adb (Input): Unsuppress checks, so we get exceptions
601         instead of crashes.
603 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
605         * sem_util.adb (Is_CCT_Instance): allow use in
606         the context of protected types.
608 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
610         * a-tigeli.adb: minor remove extra whitespace.
612 2017-09-08  Gary Dismukes  <dismukes@adacore.com>
614         * par-ch4.adb: Reformatting of an error message.
616 2017-09-08  Javier Miranda  <miranda@adacore.com>
618         * sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
619         identifiers to ensure their correct decoration of names on
620         aspect expressions.
622 2017-09-08  Yannick Moy  <moy@adacore.com>
624         * exp_attr.adb (Expand_Loop_Entry_Attribute): Do
625         not skip a loop coming from source which is rewritten into a loop.
627 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
629         * freeze.adb (Wrap_Imported_Subprogram): Indicate that the
630         wrapper has convention Ada, to prevent spurious warnings on
631         unconstrained array parameters.
633 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
635         * sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
636         (Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
638 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
640         * sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
642 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
644         * exp_intr.adb (Append_Entity_Name): Move to ...
645         * sem_util.ads, sem_util.adb: ... here to share it.
646         (Subprogram_Name): New subprogram, to compute the name of the enclosing
647         subprogram/entity.
648         * errutil.adb (Error_Msg): Fill new field Node.
649         * erroutc.ads (Subprogram_Name_Ptr): New.
650         (Error_Msg_Object): New field Node.
651         * erroutc.adb (dmsg, Output_Msg_Text): Take new field Node into account.
652         * errout.adb (Error_Msg): New variant with node id parameter.
653         Fill new parameter Node when emitting messages. Revert previous
654         changes for Include_Subprogram_In_Messages.
655         * sem_ch5.adb (Check_Unreachable_Code): Supply Node parameter when
656         generating warning message.
658 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
660         * par-ch4.adb (P_Iterated_Component_Association): Place construct
661         under -gnat2020 flag, given that it is a future feature of
662         the language.
663         * sem_aggr.adb (Resolve_Iterated_Component_Association): Mark
664         defining identifier as referenced to prevent spurious warnings:
665         corresponding loop is expanded into one or more loops whose
666         variable has the same name, and the expression uses those names
667         and not the original one.
669 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
671         * sem_elab.adb (Check_A_Call): Do not consider
672         references to internal variables for SPARK semantics.
674 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
676         * inline.adb (In_Package_Spec): refine type of
677         the parameter from Node_Id to Entity_Id.
679 2017-09-08  Justin Squirek  <squirek@adacore.com>
681         * exp_ch5.adb (Expand_Formal_Container_Loop):
682         Reset the scope of the loop parameter after it is reanalyzed.
684 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
686         * sem_util.ads (Set_Rep_Info): New inline procedure.
687         * sem_util.adb (Set_Rep_Info): Implement it.
688         * sem_ch3.adb (Process_Subtype): If the case of a constraint present,
689         always copy the representation aspects onto the subtype.
691 2017-09-08  Georges-Alex Jaloyan  <jaloyan@adacore.com>
693         * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_key):
694         Correction of the return type from access type to option type.
695         (Simple_HTable): Moving the Instance_Data to ads file.
697 2017-09-08  Yannick Moy  <moy@adacore.com>
699         * sem_prag.adb: Use System.Case_Util.To_Lower to simplify code.
701 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
703         * opt.ads (Include_Subprogram_In_Messages): New variable.
704         * errout.ads (Current_Subprogram_Ptr): New variable.
705         * errout.adb (Error_Msg): Prepend current subprogram info
706         in messages if Include_Subprogram_In_Messages is set.
707         * sem_util.adb (elab code): Initialize Current_Subprogram_Ptr to
708         Current_Subprogram.
709         * gnat1drv.adb (Adjust_Global_Switches): Set
710         Include_Subprogram_In_Messages when -gnatdJ is set.
711         * debug.adb: Document and reserve -gnatdJ.
713 2017-09-08  Georges-Axel Jaloyan  <jaloyan@adacore.com>
715         * g-dynhta.adb, g-dynhta.ads (Get_First_Key, Get_Next_Key): New
716         functions to iterate over simple hastables.
717         (Load_Factor_HTable): Remove obsolete and inefficient implementation.
719 2017-09-08  Javier Miranda  <miranda@adacore.com>
721         * exp_ch6.adb (Unqual_BIP_Function_Call): Adding
722         missing checks on the presence of Entity() before checking the
723         entity attributes.
725 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
727         * sem_ch6.adb (Analyze_Expression_Function): Reorder some
728         statements, use local variable and remove unnecessary processing.
730 2017-09-08  Javier Miranda  <miranda@adacore.com>
732         * exp_ch6.ads (Make_Build_In_Place_Iface_Call_In_Allocator): New
733         subprogram.
734         (Make_Build_In_Place_Iface_Call_In_Anonymous_Context): New subprogram.
735         (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
736         subprogram.
737         (Unqual_BIP_Iface_Function_Call): New subprogram.
738         * exp_ch6.adb (Replace_Renaming_Declaration_Id): New
739         subprogram containing code that was previously inside
740         Make_Build_In_Place_Call_In_Object_Declaration since it is also
741         required for one of the new subprograms.
742         (Expand_Actuals):
743         Invoke Make_Build_In_Place_Iface_Call_In_Anonymous_Context
744         (Expand_N_Extended_Return_Statement): Extend the
745         cases covered by an assertion on expected BIP object
746         declarations.
747         (Make_Build_In_Place_Call_In_Assignment):
748         Removing unused code; found working on this ticket.
749         (Make_Build_In_Place_Call_In_Object_Declaration): Move the code
750         that replaces the internal name of the renaming declaration
751         into the new subprogram Replace_Renaming_Declaration_Id.
752         (Make_Build_In_Place_Iface_Call_In_Allocator): New subprogram.
753         (Make_Build_In_Place_Iface_Call_In_Anonymous_Context):
754         New subprogram.
755         (Make_Build_In_Place_Iface_Call_In_Object_Declaration): New
756         subprogram.
757         (Unqual_BIP_Iface_Function_Call): New subprogram.
758         * exp_ch3.adb (Expand_N_Object_Declaration): Invoke the new
759         subprogram Make_Build_In_Place_Iface_Call_In_Object_Declaration.
760         * exp_attr.adb (Expand_N_Attribute_Reference): Invoke the new
761         subprogram Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
762         * exp_ch4.adb (Expand_Allocator_Expression): Invoke the new
763         subprogram Make_Build_In_Place_Iface_Call_In_Allocator.
764         (Expand_N_Indexed_Component): Invoke the new subprogram
765         Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
766         (Expand_N_Selected_Component): Invoke the new subprogram
767         Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
768         (Expand_N_Slice): Invoke the new subprogram
769         Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
770         * exp_ch8.adb (Expand_N_Object_Renaming_Declaration):
771         Invoke the new subprogram
772         Make_Build_In_Place_Iface_Call_In_Anonymous_Context.
774 2017-09-08  Javier Miranda  <miranda@adacore.com>
776         * exp_disp.adb (Expand_Interface_Conversion): Fix handling of
777         access to interface types.  Remove also the accessibility check.
779 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
781         * sem_ch6.adb (Freeze_Expr_Types): Really freeze
782         all the types that are referenced by the expression.
783         (Analyze_Expression_Function): Call Freeze_Expr_Types for
784         a completion instead of manually freezing the type of the
785         expression.
786         (Analyze_Subprogram_Body_Helper): Do not call Freeze_Expr_Types here.
788 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
790         * exp_prag.adb (Replace_Discriminals_Of_Protected_Op):
791         New procedure, auxiliary to Expand_Pragma_Check, to handle
792         references to the discriminants of a protected type within a
793         precondition of a protected operation. This is needed because
794         the original precondition has been analyzed in the context of
795         the protected declaration, but in the body of the operation
796         references to the discriminants have been replaved by references
797         to the discriminants of the target object, and these references
798         are only created when expanding the protected body.
800 2017-09-08  Yannick Moy  <moy@adacore.com>
802         * sem_prag.adb (Analyze_Pragma): Issue more precise error messages on
803         Loop_Variant.
805 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
807         * exp_attr.adb (Build_Record_VS_Func): If the record is an
808         unchecked union, do not emit checks for its (non-existent)
809         discriminants, or for variant parts that depend on them.
811 2017-09-08  Justin Squirek  <squirek@adacore.com>
813         * sem_ch4.adb (Find_Equality_Types.Try_One_Interp,
814         Find_Comparison_Type.Try_One_Interp): Add check for generic
815         instances.
817 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
819         * sem_ch3.adb, layout.adb, layout.ads, exp_attr.adb, debug.adb,
820         exp_pakd.adb, sem_prag.adb, gnat1drv.adb, targparm.adb, targparm.ads,
821         repinfo.adb, exp_ch6.adb, exp_aggr.adb, sem_eval.adb, sem_ch13.adb,
822         exp_ch3.adb: Remove references to Frontend_Layout_On_Target and
823         remaining references to AAMP_On_Target.
825 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
827         * style.adb: Fix typo.
829 2017-09-08  Javier Miranda  <miranda@adacore.com>
831         * einfo.adb (Underlying_Type): Add missing support for class-wide
832         types that come from the limited view.
833         * exp_attr.adb (Attribute_Address): Check class-wide type
834         interfaces using the underlying type to handle limited-withed
835         types.
836         (Attribute_Tag): Check class-wide type interfaces using
837         the underlying type to handle limited-withed types.
839 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
841         * exp_ch5.adb (Expand_Predicated_Loop): Handle properly a loop
842         over a subtype of a type with a static predicate, taking into
843         account the predicate function of the parent type and the bounds
844         given in the loop specification.
845         * sem_ch3.adb (Inherit_Predicate_Flags): For qn Itype created for
846         a loop specification that is a subtype indication whose type mark
847         is a type with a static predicate, inherit predicate function,
848         used to build case statement for rewritten loop.
850 2017-09-08  Justin Squirek  <squirek@adacore.com>
852         * lib-load.adb: Modify printing of error message to exclude file
853         line number.
855 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
857         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode):
858         don't inline subprograms declared in both visible and private
859         parts of a package.
860         (In_Package_Spec): previously In_Package_Visible_Spec; now
861         detects subprograms declared both in visible and private parts
862         of a package spec.
864 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
866         * exp_util.adb (Build_Invariant_Procedure_Declaration): If
867         the type is an anonymous array in an object declaration, whose
868         component type has an invariant, use the object declaration
869         as the insertion point for the invariant procedure, given that
870         there is no explicit type declaration for an anonymous array type.
872 2017-09-08  Bob Duff  <duff@adacore.com>
874         * a-cbprqu.ads, a-cbdlli.adb: Suppress warnings.
876 2017-09-08  Bob Duff  <duff@adacore.com>
878         * a-strfix.adb (Trim): Compute Low and High only if needed.
880 2017-09-08  Justin Squirek  <squirek@adacore.com>
882         * lib-load.adb (Load_Main_Source): Add error output in the case a
883         source file is missing.
885 2017-09-08  Bob Duff  <duff@adacore.com>
887 PR ada/80888
888         * a-textio.adb, a-witeio.adb, a-ztexio.adb (Set_WCEM): Use
889         Default_WCEM by default (i.e. if the encoding is not specified
890         by the Form string).
892 2017-09-08  Bob Duff  <duff@adacore.com>
894         * s-trasym.ads (Hexa_Traceback): If
895         Suppress_Hex is True, print "..." instead of a hexadecimal
896         address.
897         * s-trasym.adb: Ignore No_Hex in this version.
898         Misc cleanup.
900 2017-09-08  Bob Duff  <duff@adacore.com>
902         * debug.adb: Minor reformatting.
904 2017-09-08  Bob Duff  <duff@adacore.com>
906         * a-cbdlli.adb, a-cohama.adb, a-cohase.adb (Copy): Rewrite the
907         code so it doesn't trigger an "uninit var" warning.
909 2017-09-08  Nicolas Roche  <roche@adacore.com>
911         * s-hibaen.ads: Remove obsolete file.
913 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
915         * a-locale.ads: Add comment explaining the state of this package.
917 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
919         * sem_util.adb (Is_CCT_Instance): Allow calls in the context
920         of packages.
921         * sem_prag.ads, sem_prag.adb (Find_Related_Declaration_Or_Body):
922         allow calls in the context of package spec (for pragma
923         Initializes) and bodies (for pragma Refined_State).
925 2017-09-08  Bob Duff  <duff@adacore.com>
927         * checks.adb (Insert_Valid_Check): Copy the Do_Range_Check flag to the
928         new Exp.
930 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
932         * debug.adb (dA): Adjust comment.
933         * gnat1drv.adb (Gnat1drv): Likewise.
934         * opt.ads (List_Representation_Info_Extended): New variable.
935         * repinfo.adb (List_Record_Info): Split implementation into...
936         (Compute_Max_Length): ...this.  Recurse on records if requested.
937         (List_Record_Layout): Likewise.
938         * switch-c.adb (Scan_Front_End_Switches) <'R'>: Use case
939         statement, accept '0' and set List_Representation_Info_Extended
940         on 'e'.
941         * usage.adb (Usage): Document new -gnatRe variant.
943 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
945         * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
946         Do not save the given entity in the global variable Default_Pool
947         if the pragma appears within a generic unit.
949 2017-09-08  Bob Duff  <duff@adacore.com>
951         * errout.adb (Delete_Warning): Do not
952         decrement Warnings_Treated_As_Errors. This is called before
953         Warnings_Treated_As_Errors has been incremented to account for
954         this warning. Decrementing it here can lead to negative values
955         of Warnings_Treated_As_Errors, raising Constraint_Error in
956         checks-on builds, and causing the compiler to return an error
957         code in checks-off builds.
959 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
961         * sem_util.ads, sem_util.adb (Is_CCT_Instance): Only expect
962         entities of named concurrent types as Ref_Id and not of anonymous
963         concurrent objects (because callers already know when a conversion
964         is necessary and can easily do it); also, do not expect protected
965         types or protected objects as Context_Id (because no flow-related
966         SPARK pragmas are attached there); reflect these changes in a
967         more precise comment.
969 2017-09-08  Olivier Hainque  <hainque@adacore.com>
971         * g-altive.ads: Add documentation.
973 2017-09-08  Bob Duff  <duff@adacore.com>
975         * sem_util.ads, debug.adb: Minor comment fix.
976         * erroutc.ads: Comment fix.
978 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
980         * sem_ch12.adb (Validate_Array_Type_Instance): Suppress check
981         for compatibility of component types of formal and actual in an
982         instantiation of a child unit,  when the component type of the
983         formal is itself a formal of an enclosing generic.
985 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
987         * sem_util.ads, sem_util.adb (Is_CCT_Instance): moved from
988         sem_prag.adb to make it available for GNATprove; for concurrent
989         types replace custom scope climbing with Scope_Same_Or_Within; for
990         single concurrent objects add scope climbing (with Scope_Within),
991         which was not there (that's the primary semantic change of this
992         commit); also, when comparing a single concurrent object with
993         its corresponding concurrent type rely on equality of types,
994         not of objects (because that's simpler to code).
995         * sem_prag.adb (Is_CCT_Instance): lifted to sem_util.ads.
996         (Analyze_Global_Item): adjust special-casing of references to the
997         current instance of a concurrent unit in the Global contracts
998         of task types and single tasks objects; similar for references
999         in the protected operations and entries of protected types and
1000         single protected objects (in all these cases the current instance
1001         behaves as an implicit parameter and must not be mentioned in
1002         the Global contract).
1004 2017-09-08  Arnaud Charlet  <charlet@adacore.com>
1006         * exp_ch6.adb (Expand_Call_Helper): Introduce temporary for
1007         function calls returning a record within a subprogram call,
1008         for C generation.
1010 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1012         * sem_ch8.adb (Find_Expanded_Name): Handle properly an expanded
1013         name that designates the current instance of a child unit in its
1014         own body and appears as the prefix of a reference to an entity
1015         local to the child unit.
1016         * exp_ch6.adb, freeze.adb, sem_ch3.adb, sem_prag.adb, sem_util.adb:
1017         Minor reformatting.
1019 2017-09-08  Yannick Moy  <moy@adacore.com>
1021         * sem_res.adb (Resolve_Equality_Op): Do not warn on comparisons that
1022         may be intentional.
1024 2017-09-08  Tristan Gingold  <gingold@adacore.com>
1026         * sem_warn.adb (Check_Unused_Withs): Remove test that disabled
1027         warnings on internal units in configurable run time mode.
1029 2017-09-08  Bob Duff  <duff@adacore.com>
1031         * sem_ch3.adb (Build_Derived_Private_Type): Inherit
1032         representation items from interfaces that the derived type
1033         implements, not just from the parent type.
1034         * sem_util.ads, sem_util.adb (Abstract_Interface_List): Change
1035         this to return an empty list when there are no interfaces.
1036         * einfo.ads, sem_ch13.adb: Minor comment fixes.
1037         * sem_attr.adb: Minor comment fix.
1039 2017-09-08  Doug Rupp  <rupp@adacore.com>
1041         * sigtramp-vxworks.c [i386]: Adjust the kernel context for
1042         x86-vx7.
1044 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
1046         * exp_ch4.adb (Expand_N_Allocator): Generate a
1047         call to Allocate_Any_Controlled when the allocation does not
1048         require any initialization.
1050 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
1052         * sem_util.adb (Copy_Node_With_Replacement):
1053         Update the Renamed_Object field of a replicated object renaming
1054         declaration.
1056 2017-09-08  Patrick Bernardi  <bernardi@adacore.com>
1058         * exp_ch9.adb (Is_Pure_Barrier): Allow type
1059         conversions and components of objects. Simplified the detection
1060         of the Count attribute by identifying the corresponding run-time
1061         calls.
1063 2017-09-08  Yannick Moy  <moy@adacore.com>
1065         * exp_ch9.adb, exp_disp.adb, repinfo.adb, sem_ch12.adb, sem_dim.adb,
1066         sem_type.adb, sinfo.ads: Minor reformatting.
1068 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1070         * freeze.adb (Has_Incomplete_Compoent): New predicate, subsidiary
1071         of Freeze_Profile, used to inhibit the freezing of the profile
1072         of an expression function declared within a nested package, when
1073         some type in the profile depends on a private type declared in
1074         an enclosing package.
1076 2017-09-08  Bob Duff  <duff@adacore.com>
1078         * gnat1drv.adb (Gnat1drv): Do not set the Force_ALI_Tree_File flag in
1079         the subunit case. It's still OK to set it in the "missing subunits"
1080         case, because that won't cause the obsolete .ali files that cause
1081         confusion.
1083 2017-09-08  Bob Duff  <duff@adacore.com>
1085         * sinput-l.adb: Remove unused "with Unchecked_Conversion;". It's
1086         unclear why this didn't cause a warning.
1087         * a-uncdea.ads, a-unccon.ads: Add "Ada." to names in the
1088         pragmas. It's unclear why this didn't cause an error.
1090 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
1092         * exp_spark.adb (Expand_SPARK_N_Object_Renaming_Declaration):
1093         Reimplemented.
1094         (Expand_SPARK_Potential_Renaming): Code clean up.
1095         * sem_prag.adb (Analyze_Initialization_Item): Add a guard in case
1096         the item does not have a proper entity.
1097         (Analyze_Input_Item): Add a guard in case the item does not have a
1098         proper entity.
1099         (Collect_States_And_Objects): Include object renamings in the
1100         items being collected.
1101         (Resolve_State): Update the documentation of this routine.
1102         * sem_util.adb (Entity_Of): Add circuitry to handle
1103         renamings of function results.
1104         (Remove_Entity): New routine.
1105         (Remove_Overloaded_Entity): Take advantage of factorization.
1106         * sem_util.ads (Entity_Of): Update the documentation
1107         of this routine.
1108         (Remove_Entity): New routine.
1109         (Remove_Overloaded_Entity): Update the documentation of this
1110         routine.
1112 2017-09-08  Eric Botcazou  <ebotcazou@adacore.com>
1114         * repinfo.adb (List_Record_Info): During first loop,
1115         do not override the normalized position and first bit
1116         if they have already been set.  Move fallback code
1117         for the packed case to the case where it belongs.
1118         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
1119         Also adjust the normalized position of components.
1120         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): Likewise.
1122 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1124         * exp_disp.adb (Make_DT, Set_All_DT_Position): Handle properly
1125         the placement of a primitive operation O that renames an operation
1126         R declared in an inner package, and which is thus not a primitive
1127         of the dispatching type of O. In this case O is a new primitive
1128         and does not inherit its dispatch table position from R (which
1129         has none).
1131 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1133         * sem_dim.adb (Analyze_Dimension_If_Expression,
1134         Analyze_Dimension_Case_Expression): new subprograms to verify
1135         the dimensional correctness of Ada2012 conditional expressions,
1136         and set properly the dimensions of the construct.
1137         * sem_res.adb (Resolve_If_Expression, Resolve_Case_Expression)):
1138         call Analyze_Dimension.
1140 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1142         * sem_type.adb (Expand_Interface_Conversion): Prevent an infinite
1143         loop on an interface declared as a private extension of another
1144         synchronized interface.
1146 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1148         * sem_ch12.adb (Check_Generic_Parent): New procedure within
1149         Analyze_Associations, to handle actual packages that depend on
1150         previous instances.  If a package IAP that is an instantiation is
1151         used as an actual in a subsequent instantiation SI in the same
1152         scope, and IAP has a body, IAP must be frozen before SI. If
1153         the generic parent of IAP is itself declared in a previous
1154         instantiation in the same scope, that instantiation must also
1155         be frozen before SI.
1156         (Install_Body): Prevent double insertion of freeze node for
1157         instance.
1159 2017-09-08  Hristian Kirtchev  <kirtchev@adacore.com>
1161         * sem_prag.adb (Resolve_State): Update the
1162         comment on documentation. Generate a reference to the state once
1163         resolution takes place.
1165 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1167         * sem_ch13.adb (Analyze_Aspect_Specifications, case
1168         Linker_Section): If the aspect applies to an object declaration
1169         with explicit initialization, do not delay the freezing of the
1170         object, to prevent access-before-elaboration in the generated
1171         initialization code.
1173 2017-09-08  Ed Schonberg  <schonberg@adacore.com>
1175         * a-wtdeio.adb (Put, all versions): Use Long_Long_Integer
1176         (Integer_Value (Item)) when the size of the fixed decimal type
1177         is larger than Integer.
1179 2017-09-07  Eric Botcazou  <ebotcazou@adacore.com>
1181         PR ada/82127
1182         * gcc-interface/decl.c (copy_and_substitute_in_layout): Put the fields
1183         in order of increasing position in more cases.
1185 2017-09-07  Yannick Moy  <moy@adacore.com>
1187         * a-exetim-mingw.ads: Add contract Global=>null
1188         on all operations that are modeled as having no read or write
1189         of global variables in SPARK.
1191 2017-09-07  Raphael Amiard  <amiard@adacore.com>
1193         * a-chtgop.adb, a-chtgop.ads (Generic_Iteration_With_Position): Added
1194         to Hmaps.Generic_Ops.
1195         * a-cohama.adb (Ada.Containers.Hmaps.Iterate): Pass proper position in
1196         cursors.
1197         * a-cihama.adb (Ada.Containers.Indefinite_Hmaps.Iterate): Pass pos in
1198         cursors.
1199         * a-cohase.adb (Ada.Containers.Hashed_Sets.Iterate): Pass proper
1200         position in cursors.
1202 2017-09-07  Javier Miranda  <miranda@adacore.com>
1204         * sem_elab.adb (Check_Task_Activation): Adding switch -gnatd.y to
1205         allow disabling the generation of implicit pragma Elaborate_All
1206         on task bodies.
1208 2017-09-07  Javier Miranda  <miranda@adacore.com>
1210         * exp_disp.adb (Make_Tags): Avoid suffix counter
1211         in the external name of the elaboration flag. Required to fix
1212         the regressions introduced by the initial version of this patch.
1214 2017-09-07  Bob Duff  <duff@adacore.com>
1216         * sem_ch6.adb (Analyze_Function_Return): Do not
1217         insert an explicit conversion to force the displacement of the
1218         "this" pointer to reference the secondary dispatch table in the
1219         case where the return statement is returning a raise expression,
1220         as in "return raise ...".
1222 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1224         * sem_disp.adb (Is_User_Defined_Equality): Removed procedure.
1225         * sem_util.ads, sem_util.adb (Is_User_Defined_Equality): Copied
1226         procedure from sem_disp.adb.
1227         * sem_ch12.ads (Get_Unit_Instantiation_Node): rename Package
1228         with Unit.
1229         * sem_ch12.adb (Get_Unit_Instantiation_Node): function extended to
1230         return the instantiation node for subprograms. Update references
1231         to Get_Unit_Instantiation_Node.
1232         * sem_ch7.adb (Install_Parent_Private_Declarations): update
1233         reference to Get_Unit_Instantiation_Node.
1234         * exp_dist.adb (Build_Package_Stubs): update reference to
1235         Get_Unit_Instantiation_Node.
1236         * sem_ch9.adb: minor typo in comment.
1237         * lib-xref-spark_specific.adb
1238         (Traverse_Declaration_Or_Statement): traverse into task type
1239         definition.
1241 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1243         * sem_dim.adb (Analyze_Dimension_Type_Conversion): New procedure
1244         to handle properly various cases of type conversions where the
1245         target type and/or the expression carry dimension information.
1246         (Dimension_System_Root); If a subtype carries dimension
1247         information, obtain the source parent type that carries the
1248         Dimension aspect.
1250 2017-09-07  Dmitriy Anisimkov  <anisimko@adacore.com>
1252         * g-socket.adb, g-socket.ads (GNAT.Sockets.To_Ada): New routine.
1254 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1256         * exp_attr.adb (Expand_N_Attribute_Reference, case 'Constrained):
1257         If the prefix is a reference to an object, rewrite it as an
1258         explicit dereference, as required by 3.7.2 (2) and as is done
1259         with most other attributes whose prefix is an access value.
1261 2017-09-07  Bob Duff  <duff@adacore.com>
1263         * par-ch13.adb: Set the Inside_Depends flag if we are inside a
1264         Refined_Depends aspect.
1265         * par-ch2.adb: Set the Inside_Depends flag if we are inside a
1266         Refined_Depends pragma.
1267         * scans.ads: Fix documentation of Inside_Depends flag.
1268         * styleg.adb, styleg.ads: Minor reformatting and comment fixes.
1270 2017-09-07  Hristian Kirtchev  <kirtchev@adacore.com>
1272         * exp_ch7.adb (Insert_Actions_In_Scope_Around):
1273         Account for the case where the are no lists to insert, but the
1274         secondary stack still requires management.
1275         * a-chtgop.adb, a-cihama.adb, a-cohama.adb, a-cohase.adb, a-tags.adb,
1276         comperr.adb, einfo.adb, exp_aggr.adb, exp_ch3.adb, exp_disp.adb,
1277         lib-xref.adb, lib-xref-spark_specific.adb, sem_ch12.adb, sem_ch13.adb,
1278         sem_ch6.adb, sem_dim.adb, sem_dim.ads, sem_elab.adb, sem_prag.adb:
1279         Minor reformatting.
1281 2017-09-07  Vincent Celier  <celier@adacore.com>
1283         * clean.adb: Do not get the target parameters before calling
1284         gprclean.
1286 2017-09-07  Nicolas Roche  <roche@adacore.com>
1288         * s-osinte-solaris-posix.ads: Removed.
1290 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1292         * sem_prag.adb (Collect_States_And_Objects): Detect also instances of
1293         single concurrent objects.
1295 2017-09-07  Javier Miranda  <miranda@adacore.com>
1297         * s-regexp.ads: Fix documentation of the globbing grammar.
1299 2017-09-07  Gary Dismukes  <dismukes@adacore.com>
1301         * a-tags.ads, einfo.ads, exp_disp.ads: Minor reformatting.
1303 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1305         * gnat1drv.adb (Gnat1drv): Enable pragma Ignore_Pragma (Global)
1306         in CodePeer mode, to support more legacy code automatically.
1308 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1310         * exp_disp.adb (Replace_Formals): If thr formal is classwide,
1311         and thus not a controlling argument, preserve its type after
1312         rewriting because it may appear in an nested call with a classwide
1313         parameter.
1315 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1317         * comperr.adb (Delete_SCIL_Files): Handle case of
1318         N_Package_Instantiation.
1320 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1322         * sem_ch10.adb (Remove_Private_With_Clause): If a private with
1323         clause for a unit U appears in a context that includes a regular
1324         with_clause on U, rewrite the redundant private clause into a null
1325         statement, rather than removing it altogether from the context,
1326         so that ASIS tools can reconstruct the original source.
1328 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1330         * sem_ch13.adb (Check_Aspect_At_Freeze_Point): The expression
1331         for aspect Small can be of any real type (not only a universal
1332         real literal) as long as it is a static constant.
1334 2017-09-07  Thomas Quinot  <quinot@adacore.com>
1336         * par_sco.adb: Minor reformatting.
1338 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1340         * s-parame-ae653.ads: Removed.
1342 2017-09-07  Nicolas Roche  <roche@adacore.com>
1344         * s-traces-default.adb, s-trafor-default.adb, s-trafor-default.ads,
1345         s-traces.adb, s-traces.ads, s-tratas-default.adb, s-tfsetr-default.adb,
1346         s-tfsetr-vxworks.adb, s-tratas.adb, s-tratas.ads, s-tasuti.adb,
1347         s-parame-hpux.ads, s-tassta.adb, s-taasde.adb, s-tasren.adb,
1348         s-taprob.adb, a-caldel.adb, s-parame.ads, Makefile.rtl, s-tpobop.adb,
1349         s-taenca.adb, s-parame-vxworks.ads: Remove support for System.Traces.
1351 2017-09-07  Yannick Moy  <moy@adacore.com>
1353         * a-ngelfu.ads Add preconditions to all functions
1354         listed in Ada RM A.5.1(19-33) as having constraints on inputs.
1356 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1358         * lib-xref.adb (Generate_Reference): ignore
1359         references to entities which are Part_Of single concurrent
1360         objects.
1362 2017-09-07  Eric Botcazou  <ebotcazou@adacore.com>
1364         * sem_ch7.adb (Hide_Public_Entities): Add paragraph to main
1365         comment.
1367 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1369         * a-taside.adb (Activation_Is_Complete): Raise Program_Error if
1370         Null_Task_Id is passed.
1372 2017-09-07  Javier Miranda  <miranda@adacore.com>
1374         * einfo.ads, einfo.adb (Access_Disp_Table_Elab_Flag): New
1375         attribute. Defined for record types and subtypes.
1376         * exp_ch3.ads (Init_Secondary_Tags): Adding new formal
1377         (Init_Tags_List) to facilitate generating separate code in the
1378         IP routine to initialize the object components and for completing
1379         the elaboration of dispatch tables.
1380         * exp_ch3.adb (Build_Init_Procedure): Improve the code
1381         generated in the IP routines by means of keeping separate
1382         the initialization of the object components from the
1383         initialization of its dispatch tables.  (Init_Secondary_Tags):
1384         Adding new formal (Init_Tags_List) and adjusting calls to
1385         Ada.Tags.Set_Dynamic_Offset_To_Top since it has a new formal;
1386         adjusting also calls to Ada.Tags.Register_Interface_Offset
1387         because the type of one of its formals has been changed.
1388         * a-tags.ads, a-tags.adb (Register_Interface_Offset): Profile
1389         modified. Instead of receiving a pointer to an object this
1390         routine receives now a primary tag.
1391         (Set_Dyanic_Offset_To_Top): Profile modified. This routine receives an
1392         additional formal: the tag of the primary dispatch table.
1393         * exp_disp.ads (Elab_Flag_Needed): New subprogram.
1394         * exp_disp.adb (Elab_Flag_Needed): New subprogram.
1395         (Make_Tags): Adding the declaration of the elaboration flag (if needed).
1396         * exp_aggr.adb (Build_Record_Aggr_Code): Adding actual of new
1397         formal in calls to Init_Secondary_Tags.
1399 2017-09-07  Javier Miranda  <miranda@adacore.com>
1401         * ghost.adb (Mark_And_Set_Ghost_Instantiation.Check_Ghost_Actuals): New
1402         subprogram.
1403         * sem_prag.adb (Pragma_Ghost): Add missing support for ghost
1404         applied to generic subprograms.
1406 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1408         * sem_util.adb (Check_Part_Of_Reference): rename Conc_Typ to Conc_Obj
1409         (because it refers to the anonymous concurrent object, not its type);
1410         fix condition for emitting error message about task/protected type,
1412 2017-09-07  Bob Duff  <duff@adacore.com>
1414         * binde.adb (Debug_Flag_Old): If both -do and -dp
1415         are specified, behave as if just -do was specified, rather than
1416         using a mixture.
1418 2017-09-07  Nicolas Roche  <roche@adacore.com>
1420         * system-vxworks-sparcv9.ads, s-vxwork-m68k.ads, s-vxwork-mips.ads,
1421         system-vxworks-m68k.ads, system-vxworks-mips.ads: Removed.
1423 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1425         * sem_prag.adb (Find_Role): The Global_Seen flag
1426         is now consulted not only for abstract states and variables,
1427         but for all kinds of items.
1428         (Collect_Subprogram_Inputs_Outputs): Do not process formal
1429         generic parameters, because unlike ordinary formal parameters,
1430         generic formals only act as input/ outputs if they are explicitly
1431         mentioned in a Global contract.
1433 2017-09-07  Yannick Moy  <moy@adacore.com>
1435         * ghost.adb (Check_Ghost_Context): Do not err on ghost code inside
1436         predicate procedure. Check predicate pragma/aspect with Ghost entity.
1437         * exp_ch6.adb, par-ch6.adb, sem_ch13.adb, sem_prag.adb; Minor
1438         reformatting.
1440 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1442         * sem_aggr.adb: Move New_Copy_Tree_And_Dimensions to sem_dim
1443         (code cleanup);
1444         * sem_ch3.adb (Build_Derived_Record_Type):i Call
1445         Copy_Dimensions_Of_Components after creating the copy of the
1446         record declaration.
1447         * sem_dim.ads, sem_dim.adb (Copy_Dimensions_Of_Components): For a
1448         derived recor type, copy the dikensions if any of each component
1449         of the parent record to the corresponding component declarations
1450         of the derived record. These expressions are used among other
1451         things as default values in aggregates with box associations.
1452         * a-dirval-mingw.adb, g-cgi.adb, gnatcmd.adb, lib-xref.adb,
1453         repinfo.adb, sem_attr.adb, sem_ch10.adb, sem_ch6.adb, sem_prag.adb:
1454         Minor reformatting.
1456 2017-09-07  Arnaud Charlet  <charlet@adacore.com>
1458         * sem_util.adb: Remove extra space after THEN.
1460 2017-09-07  Eric Botcazou  <ebotcazou@adacore.com>
1462         * sem_ch7.adb (Has_Referencer): For a subprogram renaming,
1463         also mark the renamed subprogram as referenced.
1465 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1467         * par-ch6.adb (P_Subprogram): Improve error message on null
1468         procedure with misplaced aspect specification, which the parser
1469         first attempts to interpret as a malformed expression function.
1471 2017-09-07  Gary Dismukes  <dismukes@adacore.com>
1473         * sem_attr.adb (Analyze_Attribute_Old_Result):
1474         Allow attributes Result and Old in the case of an expression
1475         function.
1477 2017-09-07  Justin Squirek  <squirek@adacore.com>
1479         * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Propagate
1480         Volatile to subcomponents.
1482 2017-09-07  Bob Duff  <duff@adacore.com>
1484         * exp_ch7.adb (Find_Last_Init): Check for the
1485         case where a build-in-place function call has been replaced by a
1486         'Reference attribute reference.
1488 2017-09-07  Eric Botcazou  <ebotcazou@adacore.com>
1490         * sem_ch7.adb (Has_Referencer): Recurse on Actions of freeze
1491         nodes.
1493 2017-09-07  Bob Duff  <duff@adacore.com>
1495         * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration,
1496         Make_Build_In_Place_Call_In_Anonymous_Context): Do not use the
1497         secondary stack for all functions that return limited tagged
1498         types -- just do it for dispatching calls.  Misc cleanup.
1499         * sem_util.ads, sem_util.adb (Unqual_Conv): New function to
1500         remove qualifications and type conversions. Fix various bugs
1501         where only a single level of qualification or conversion was
1502         removed, so e.g. "T1'(T2'(X))" would incorrectly return "T2'(X)"
1503         instead of "X".
1504         * checks.adb, exp_util.ads, exp_util.adb, sem_res.adb: Misc related
1505         cleanup.
1507 2017-09-07  Ed Schonberg  <schonberg@adacore.com>
1509         * sem_ch6.adb (setr_Actual_Subtypes): Within a predicate function
1510         do not create actual subtypes that may generate further predicate
1511         functions.
1512         * sem_ch13.adb (Build_Predicate_Functions): Indicate that entity
1513         of body is a predicate function as well.
1514         (Resolve_Aspect_Expressions, Resolve_Name): For a component
1515         association, only the expression needs resolution, not the name.
1516         (Resolve_Aspect_Expressions, case Predicates): Construct and
1517         analyze the predicate function declaration in the scope of the
1518         type, before making the type and its discriminants visible.
1520 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1522         * gcc-interface/decl.c (warn_on_field_placement): Issue the warning
1523         only if the record type itself comes from source.
1525 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
1527         * sem_ch5.adb: Minor reformatting and a typo fix
1529 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
1531         * sinput-l.ads: minor remove extra period at the end of comment
1533 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
1535         * sem_prag.adb (Add_Item_To_Name_Buffer): remove support for
1536         E_Discriminant.
1537         (Find_Role): remove support for E_Discriminant.
1539 2017-09-06  Javier Miranda  <miranda@adacore.com>
1541         * exp_ch6.adb (Expand_Simple_Function_Return):
1542         Add missing implicit type conversion to force displacement of the
1543         "this" pointer.
1545 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
1547         * sem_ch3.adb, sem_aux.adb, sem_res.adb: Minor reformatting.
1549 2017-09-06  Yannick Moy  <moy@adacore.com>
1551         * sem_ch12.adb (Analyze_Instance_And_Renamings): Refactor to set
1552         global variable Ignore_SPARK_Mode_Pragmas_In_Instance only once.
1554 2017-09-06  Bob Duff  <duff@adacore.com>
1556         * sem_ch8.adb: Change Assert to be consistent with
1557         other similar ones.
1559 2017-09-06  Bob Duff  <duff@adacore.com>
1561         * binde.adb (Find_Elab_Order): Do not run Elab_Old unless
1562         requested. Previously, the -do switch meant "run Elab_New and
1563         Elab_Old and use the order chosen by Elab_Old, possibly with
1564         debugging printouts comparing the two orders."  Now it means
1565         "do not run Elab_New." This is of use if there are bugs that
1566         cause Elab_New to crash.
1567         (Elab_Position, Num_Chosen): Change type to Nat, to avoid various
1568         type conversions.
1569         * ali.ads (Elab_Position): Change type to Nat, to avoid various
1570         type conversions.
1572 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
1574         * sem_prag.adb (Check_Mode_Restriction_In_Enclosing_Context): Fix
1575         reference to SPARK RM.
1577 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1579         * layout.adb: Use SSU short hand consistently throughout the file.
1581 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1583         * freeze.adb (Freeze_Record_Type)
1584         <Sized_Component_Total_Round_RM_Size>: New local variable to
1585         accumulate the rounded RM_Size of components.  Update it for
1586         every component whose RM_Size is statically known.  Add missing
1587         guard to check that bit packing is really required before issuing
1588         the error about packing.  Swap condition for clarity's sake.
1589         * sem_prag.adb (Usage_Error): Fix reference to SPARK RM in comment.
1591 2017-09-06  Fedor Rybin  <frybin@adacore.com>
1593         * makeutl.adb, makeutl.ads, mlib.adb, mlib.ads, mlib-fil.adb,
1594         mlib-fil.ads, mlib-prj.adb, mlib-prj.ads, mlib-tgt.adb, mlib-tgt.ads,
1595         mlib-tgt-specific.adb, mlib-tgt-specific.ads,
1596         mlib-tgt-specific-aix.adb, mlib-tgt-specific-darwin.adb,
1597         mlib-tgt-specific-hpux.adb, mlib-tgt-specific-linux.adb,
1598         mlib-tgt-specific-mingw.adb, mlib-tgt-specific-solaris.adb,
1599         mlib-tgt-specific-vxworks.adb, mlib-tgt-specific-xi.adb, mlib-utl.adb,
1600         mlib-utl.ads, prj.adb, prj.ads, prj-attr.adb, prj-attr.ads,
1601         prj-attr-pm.adb, prj-attr-pm.ads, prj-com.ads, prj-conf.adb,
1602         prj-conf.ads, prj-dect.adb, prj-dect.ads, prj-env.adb, prj-env.ads,
1603         prj-err.adb, prj-err.ads, prj-ext.adb, prj-ext.ads, prj-makr.adb,
1604         prj-makr.ads, prj-nmsc.adb, prj-nmsc.ads, prj-pars.adb, prj-pars.ads,
1605         prj-part.adb, prj-part.ads, prj-pp.adb, prj-pp.ads, prj-proc.adb,
1606         prj-proc.ads, prj-strt.adb, prj-strt.ads, prj-tree.adb, prj-tree.ads,
1607         prj-util.adb, prj-util.ads, sinput-p.adb, sinput-p.ads: Remove obsolete
1608         project manager sources.
1610 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1612         * sem_ch5.adb (Analyze_Assigment): If the left-hand side is an
1613         entity of a mutable type and the right-hand side is a conditional
1614         expression, resolve the alternatives of the conditional using
1615         the base type of the target entity, because the alternatives
1616         may have distinct subtypes. This is particularly relevant if
1617         the alternatives are aggregates.
1619 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1621         * checks.adb (Apply_Predicate_Check): If the expression is an
1622         aggregate that is the RHS of an assignment, apply the check to
1623         the LHS after the assignment, rather than to the aggregate. This
1624         is more efficient than creating a temporary for the aggregate,
1625         and prevents back-end crashes when the aggregate includes a
1626         dynamic "others' association.
1628 2017-09-06  Yannick Moy  <moy@adacore.com>
1630         * sem_ch12.adb (Analyze_Instance_And_Renamings):
1631         Set variable to ignore SPARK_Mode in instance before the analysis
1632         of the generated package declaration.
1634 2017-09-06  Yannick Moy  <moy@adacore.com>
1636         * sem_res.adb (Resolve_Call): Do not issue a
1637         message for calls inside expression function, unless body was
1638         seen and is candidate for inlining.
1640 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1642         * sem_aux.adb (Is_Generic_Formal): Handle properly formal packages.
1643         * sem_ch3.adb (Analyze_Declarations): In a generic subprogram
1644         body. do not freeze the formals of the generic unit.
1646 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
1648         * errout.adb (Error_Msg): Separate the
1649         treatment for warning vs. style messages in inlinings and
1650         instantiations. Prevents blowups on calls to Warn_Insertion for
1651         style messages, which should not be called in that case because
1652         Warning_Msg_Char is not set.
1654 2017-09-06  Justin Squirek  <squirek@adacore.com>
1656         * sem_prag.adb (Check_VFA_Conflicts): Created
1657         to group all Volatile_Full_Access checks relating to other
1658         representation pragmas (Mark_Component_Or_Object): Created
1659         to centeralize the flagging of attributes for the record type
1660         component case, a pragma applied individually to a component, and
1661         the object case.
1662         (Process_Atomic_Independent_Shared_Volatile):
1663         Add propagation of certain pragmas to record components and move
1664         evaluation of VFA checks
1666 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1668         * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram):
1669         Do not warn on conditions that are not obeyed for Inline_Always
1670         subprograms, when assertions are not enabled.
1672 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
1674         * sem_util.adb (Unique_Entity): For abstract states return their
1675         non-limited view.
1677 2017-09-06  Bob Duff  <duff@adacore.com>
1679         * sem_ch12.adb (Copy_Generic_Node): When we copy a node
1680         that is a proper body corresponding to a stub, we defer the
1681         adjustment of the sloc until after the correct adjustment has
1682         been computed. Otherwise, Adjust_Instantiation_Sloc will ignore
1683         the adjustment, because it will be outside the range in (the old,
1684         incorrect) S_Adjustment.
1685         * inline.adb: Use named notation for readability and uniformity.
1686         * sinput-l.adb: Minor improvements to debugging output printed
1687         for Debug_Flag_L.
1688         * sinput-l.ads (Create_Instantiation_Source): Minor comment
1689         correction.
1691 2017-09-06  Vincent Celier  <celier@adacore.com>
1693         * make.adb: Do not invoke gprbuild for -bargs -P.
1695 2017-09-06  Sylvain Dailler  <dailler@adacore.com>
1697         * sem_eval.adb (Compile_Time_Known_Value_Or_Aggr): Adding a
1698         case when Op is of kind N_Qualified_Expression. In this case,
1699         the function is called recursively on the subexpression like in
1700         other cases.
1701         * make.adb: Minor reformatting
1703 2017-09-06  Justin Squirek  <squirek@adacore.com>
1705         * einfo.adb (Set_Linker_Section_Pragma): Modify
1706         Set_Linker_Section_Pragma to be consistant with the "getter"
1707         Linker_Section_Pragma.
1708         * exp_ch5.adb (Expand_Formal_Container_Loop): Add proper error
1709         checking for container loops so that the index cursor is not
1710         directly changable by the user with the use of E_Loop_Parameter.
1711         * sem_ch5.adb (Analyze_Block_Statement): Revert previous change.
1712         * sem_warn.adb (Check_References): Revert previous change.
1714 2017-09-06  Bob Duff  <duff@adacore.com>
1716         * exp_util.adb (Is_Displace_Call): Make sure it works for indirect
1717         calls and the like.
1719 2017-09-06  Yannick Moy  <moy@adacore.com>
1721         * sem_prag.adb (Analyze_Depends_Global): Reinforce test on object
1722         declarations to only consider valid uses of Global/Depends those on
1723         single concurrent objects.
1725 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1727         * sem_ch13.adb (Check_Record_Representation_Clause): Give an
1728         error as soon as one of the specified components overlaps the
1729         parent field.
1731 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
1733         * sem_prag.ads: minor fix typo in comment.
1735 2017-09-06  Justin Squirek  <squirek@adacore.com>
1737         * sem_ch5.adb (Analyze_Block_Statement): Verify a block comes
1738         from source before checking source references.
1739         * sem_warn.adb (Check_References): Add check for internal block
1740         before recursing.
1742 2017-09-06  Vincent Celier  <celier@adacore.com>
1744         * make.adb, makeusg.adb, switch-m.adb, switch-m.ads, make_util.adb,
1745         make_util.ads, sinput.adb, sinput.ads, clean.adb, gnatls.adb,
1746         gnatname.adb: Remove the Project Manager from the GNAT tools.
1747         * gcc-interface/Makefile.in: ditto.
1749 2017-09-06  Bob Duff  <duff@adacore.com>
1751         * sem_util.ads: Minor comment fix.
1753 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1755         * sem_ch12.adb (Analyze_Associations, case of Formal_Package):
1756         Generate a freeze node for the actual of a formal package, if
1757         the actual is declared in the same unit and has a corresponding
1758         body, to prevent the current instance from being frozen before
1759         the actual is.
1761 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1763         * sem_ch7.adb (Entity_Table_Size): Change to nearest prime number.
1765 2017-09-06  Yannick Moy  <moy@adacore.com>
1767         * sem_warn.adb: Minor refactoring.
1769 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1771         * einfo.ads, einfo.adb (Get_Classwwide_Pragma): New utility,
1772         to retrieve the inherited classwide precondition/postcondition
1773         of a subprogram.
1774         * freeze.adb (Freeze_Entity): Use Get_Classwide_Pragma when
1775         freezing a subprogram, to complete the generation of the
1776         corresponding checking code.
1778 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
1780         * exp_util.adb (Is_Controlled_Indexing): New routine.
1781         (Is_Displace_Call): Use routine Strip to remove indirections.
1782         (Is_Displacement_Of_Object_Or_Function_Result): Code clean up. Add a
1783         missing case of controlled generalized indexing.
1784         (Is_Source_Object): Use routine Strip to remove indirections.
1785         (Strip): New routine.
1787 2017-09-06  Bob Duff  <duff@adacore.com>
1789         * sysdep.c (__gnat_has_cap_sys_nice): If HAVE_CAPABILITY is defined,
1790         we include the proper header. Otherwise, we just declare the necessary
1791         things from the capabilities library. This is so we can build on
1792         machines without that library, while still enabling that library.
1793         At run time, we're using weak symbols, so __gnat_has_cap_sys_nice will
1794         simply return 0 if the library is not present, or not included
1795         in the link.
1797 2017-09-06  Pierre-Marie de Rodat  <derodat@adacore.com>
1799         * exp_dbug.adb (Debug_Renaming_Declaration): Do not create an encoding
1800         for renamings that involve function calls in prefix form.
1802 2017-09-06  Bob Duff  <duff@adacore.com>
1804         * sem_ch3.adb (Analyze_Subtype_Declaration):
1805         Set Has_Delayed_Freeze on a subtype of an incomplete type.
1807 2017-09-06  Pierre-Marie de Rodat  <derodat@adacore.com>
1809         * par_sco.adb (Extend_Statement_Sequence): When the accept statement
1810         has no parameter specification and no entry index, use the entry name
1811         as the end of the generated SCO statement.
1813 2017-09-06  Steve Baird  <baird@adacore.com>
1815         * exp_util.adb (Side_Effect_Free): For CodePeer (only) treat
1816         uses of 'Image and related attributes as having side effects in
1817         order to avoid replicating such uses.
1818         * pprint.ads (Expression_Image) Add new generic formal flag
1819         Hide_Temp_Derefs.  The flag defaults to False; CodePeer will
1820         (eventually) override the default.
1821         * pprint.adb (Expression_Image) If the new flag is set, then
1822         suppress the ".all" suffix when displaying a dereference whose
1823         prefix is a use of a value-capturing compiler temp of the sort
1824         generated by Expr_Util.Remove_Side_Effects .
1825         * exp_attr.adb, g-catiio.adb, inline.adb, sem_attr.adb, sem_ch13.adb,
1826         sem_ch7.adb, sem_dim.adb, sem_util.adb, sem_util.ads, sem_warn.adb:
1827         Minor reformatting.
1828         * inline.adb: Minor wording change.
1830 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1832         * sem_ch7.adb: Update comment.
1834 2017-09-06  Yannick Moy  <moy@adacore.com>
1836         * einfo.adb, einfo.ads (Is_Subprogram_Or_Entry): New predicate.
1837         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Use new function.
1838         * sem_util.adb, sem_util.ads (Within_Protected_Type): Renaming
1839         with slight modification from Is_Subp_Or_Entry_Inside_Protected,
1840         so that applies to any entity.
1842 2017-09-06  Yannick Moy  <moy@adacore.com>
1844         * sem_ch3.adb (Derived_Type_Declaration): Use
1845         Incomplete_Or_Partial_View rather than local Find_Partial_View.
1847 2017-09-06  Javier Miranda  <miranda@adacore.com>
1849         * g-catiio.ads, g-catiio.adb (Value): Extended to parse an UTC time
1850         following ISO-8861.
1852 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1854         * sem_dim.adb (Analyze_Dimension): In an instance, a type
1855         conversion takes its dimensions from the expression, not from
1856         the context type.
1857         (Dimensions_Of_Operand): Ditto.
1859 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1861         * exp_ch6.adb (Expand_Call_Helper): Do not optimize calls to
1862         null procedures when GNAT coverage is used, so that their (empty)
1863         bodies are properly covered.
1865 2017-09-06  Bob Duff  <duff@adacore.com>
1867         * sem_ch13.adb (Resolve_Aspect_Expressions): If
1868         the entity is a type with discriminants, make the discriminants
1869         directly visible in aspect clauses.
1871 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1873         * sem_res.adb (Resolve_Arithmentic_Op): If both operands are
1874         Universal_Real and the context is a floating-point type, resolve
1875         both operands to the target type.
1877 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
1879         * a-comlin.adb, exp_aggr.adb, exp_ch6.adb, frontend.adb, gnatbind.adb,
1880         sem_ch3.adb, sem_util.adb: Minor reformatting.
1882 2017-09-06  Yannick Moy  <moy@adacore.com>
1884         * freeze.adb (Check_Inherited_Conditions): Rewriting
1885         of inherited preconditions and postconditions should only occur
1886         in GNATprove mode, that is, when GNATprove_Mode is True, not to
1887         be confused with SPARK_Mode being On.
1889 2017-09-06  Yannick Moy  <moy@adacore.com>
1891         * sem_warn.adb (Check_References): Take into
1892         account possibility of attribute reference as original node.
1894 2017-09-06  Yannick Moy  <moy@adacore.com>
1896         * exp_attr.adb (Expand_N_Attribute_Reference): Protect against invalid
1897         use of attribute.
1899 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
1901         * inline.adb (Split_Unconstrained_Function): Also set Is_Inlined
1902         on the procedure created to encapsulate the body.
1903         * sem_ch7.adb: Add with clause for GNAT.HTable.
1904         (Entity_Table_Size): New constant.
1905         (Entity_Hash): New function.
1906         (Subprogram_Table): New instantiation of GNAT.Htable.Simple_HTable.
1907         (Is_Subprogram_Ref): Rename into...
1908         (Scan_Subprogram_Ref): ...this. Record references to subprograms in
1909         the table instead of bailing out on them. Scan the value of constants
1910         if it is not known at compile time.
1911         (Contains_Subprograms_Refs): Rename into...
1912         (Scan_Subprogram_Refs): ...this.
1913         (Has_Referencer): Scan the body of all inlined subprograms. Reset the
1914         Is_Public flag on subprograms if they are not actually referenced.
1915         (Hide_Public_Entities): Beef up comment on the algorithm.
1916         Reset the table of subprograms on entry.
1918 2017-09-06  Yannick Moy  <moy@adacore.com>
1920         * inline.adb: Add comments to Can_Be_Inlined_In_GNATprove_Mode.
1922 2017-09-06  Javier Miranda  <miranda@adacore.com>
1924         * exp_aggr.adb (Component_Not_OK_For_Backend): The C backend
1925         cannot handle a type conversion of an array as an aggregate
1926         component.
1928 2017-09-06  Bob Duff  <duff@adacore.com>
1930         * g-comlin.adb (Try_Help): Remove ".exe" so we
1931         get the same results on windows and unix.
1933 2017-09-06  Justin Squirek  <squirek@adacore.com>
1935         * exp_imgv.adb (Expand_Image_Attribute),
1936         (Expand_Wide_Image_Attribute), (Expand_Wide_Wide_Image_Attribute):
1937         Added case to handle new-style 'Image expansion
1938         (Rewrite_Object_Image): Moved from exp_attr.adb
1939         * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
1940         attribute cases so that the relevant subprograms in exp_imgv.adb
1941         handle all expansion.
1942         (Rewrite_Object_Reference_Image): Moved to exp_imgv.adb
1943         * sem_attr.adb (Analyze_Attribute): Modified Image attribute
1944         cases to call common function Analyze_Image_Attribute.
1945         (Analyze_Image_Attribute): Created as a common path for all
1946         image attributes (Check_Object_Reference_Image): Removed
1947         * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
1948         Removed and refactored into Is_Object_Image (Is_Object_Image):
1949         Created as a replacement for Is_Image_Applied_To_Object
1951 2017-09-06  Yannick Moy  <moy@adacore.com>
1953         * sem_prag.adb (Analyze_Depends_In_Decl_Part): Add continuation
1954         message for missing input.
1956 2017-09-06  Yannick Moy  <moy@adacore.com>
1958         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Prevent inlining
1959         of protected subprograms and entries.
1960         * sem_util.adb, sem_util.ads (Is_Subp_Or_Entry_Inside_Protected):
1961         New function to detect when a subprogram of entry is defined
1962         inside a protected object.
1964 2017-09-06  Bob Duff  <duff@adacore.com>
1966         * sysdep.c (__gnat_has_cap_sys_nice): New function to determine
1967         whether the current process has the CAP_SYS_NICE capability.
1968         * s-taprop-linux.adb (Get_Ceiling_Support): Update this to allow
1969         ceiling priorities if the current process has the CAP_SYS_NICE
1970         capability.
1972 2017-09-06  Bob Duff  <duff@adacore.com>
1974         * a-comlin.ads, a-comlin.adb (Argument): Move the constraint
1975         check back to the body, because SPARK is not yet ready for
1976         "or else raise Constraint_Error".
1978 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
1980         * exp_ch6.adb (Expand_Call_Helper): Replace call to null
1981         procedure by a single null statement, after evaluating the
1982         actuals that require it.
1984 2017-09-06  Javier Miranda  <miranda@adacore.com>
1986         * exp_aggr.adb (Backend_Processing_Possible.Component_Check):
1987         Generating C code improve the code that checks the use of nested
1988         aggregates to initialize object declarations.
1990 2017-09-06  Yannick Moy  <moy@adacore.com>
1992         * sem_ch3.adb (Derived_Type_Declaration): Detect
1993         violations of new rule SPARK RM 3.4(1).  Also refactor existing
1994         check to use the new function Find_Partial_View.
1996 2017-09-06  Vincent Celier  <celier@adacore.com>
1998         * gnatcmd.adb: gnat ls -V -P... invokes gprls -V -P...  The code
1999         from the Prj hierarchy has been removed from the GNAT driver.
2001 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2003         * sem_type.adb (Interface_Present_In_Ancestor): Within an
2004         expression function, or within a spec expression (default value,
2005         etc) a reference to an incomplete type is legal: legality of
2006         the operation will be checked when some related entity (type,
2007         object or subprogram) is frozen.
2009 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
2011         * exp_ch5.adb, s-diinio.ads, sem_ch4.adb, s-diflio.ads: Minor spelling
2012         adjustments and a typo fix.
2014 2017-09-06  Yannick Moy  <moy@adacore.com>
2016         * sem_res.adb (Resolve_Call): Do not issue info
2017         message about inlining of calls to functions in assertions,
2018         for functions whose body has not been seen yet.
2020 2017-09-06  Bob Duff  <duff@adacore.com>
2022         * a-comlin.ads, a-comlin.adb (Argument): Simplify the code, now that
2023         we can use modern Ada in this package.
2024         * s-resfil.ads, s-resfil.adb, a-clrefi.ads, a-clrefi.adb:
2025         Move Ada.Command_Line.Response_File to System.Response_File,
2026         and make Ada.Command_Line.Response_File into a rename of
2027         System.Response_File. This is to avoid having gnatbind depend
2028         Ada.Command_Line, which would damage the bootstrap process now
2029         that Ada.Command_Line contains modern Ada (the raise expression).
2030         * gnatbind.adb: Avoid dependence on
2031         Ada.Command_Line. Depend on System.Response_File instead
2032         of Ada.Command_Line.Response_File. Change one call to
2033         Ada.Command_Line.Command_Name to use Fill_Arg.  Change one call
2034         to Ada.Command_Line.Argument_Count to use Arg_Count.
2035         * gcc-interface/Make-lang.in, Makefile.rtl: Take note of the new files.
2037 2017-09-06  Bob Duff  <duff@adacore.com>
2039         * frontend.adb (Frontend): Skip -gnatec=gnat.adc
2040         switch, because we've already read gnat.adc by default.
2042 2017-09-06  Bob Duff  <duff@adacore.com>
2044         * exp_ch5.adb (Get_Default_Iterator): Replace
2045         "Assert(False)" with "return Iter", because if an iterable
2046         type is derived from a noniterable one, then we won't find an
2047         overriding or inherited default iterator.
2049 2017-09-06  Yannick Moy  <moy@adacore.com>
2051         * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
2052         literal index used to access a string is null or negative.
2054 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2056         * einfo.adb (Status_Flag_Or_Transient_Decl): The attribute is now
2057         allowed on loop parameters.
2058         (Set_Status_Flag_Or_Transient_Decl): The attribute is now allowed
2059         on loop parameters.
2060         (Write_Field15_Name): Update the output for
2061         Status_Flag_Or_Transient_Decl.
2062         * einfo.ads: Attribute Status_Flag_Or_Transient_Decl now applies
2063         to loop parameters. Update the documentation of the attribute
2064         and the E_Loop_Parameter entity.
2065         * exp_ch7.adb (Process_Declarations): Remove the bogus guard
2066         which assumes that cursors can never be controlled.
2067         * exp_util.adb (Requires_Cleanup_Actions): Remove the bogus
2068         guard which assumes that cursors can never be controlled.
2070 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2072         * exp_attr.adb, sem_util.adb, sem_attr.adb, sem_ch6.adb, sem_ch8.adb,
2073         sem_warn.adb: Minor reformatting.
2075 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2077         * sem_warn.adb (Warn_On_Overlapping_Actuals): Refine previous
2078         fix and preserve older GNAT warning on overlapping actuals that
2079         are not elementary types.
2081 2017-09-06  Justin Squirek  <squirek@adacore.com>
2083         * sem_attr.adb: Comment correction.
2085 2017-09-06  Gary Dismukes  <dismukes@adacore.com>
2087         * sem_util.adb: Minor reformatting.
2089 2017-09-06  Yannick Moy  <moy@adacore.com>
2091         * a-comlin.ads (Argument): Add precondition for analysis.
2093 2017-09-06  Yannick Moy  <moy@adacore.com>
2095         * sem_res.adb (Resolve): Update message for function call as statement.
2097 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2099         * sem_ch6.adb (Check_Returns): Clean up warnings coming from
2100         generated bodies for renamings that are completions, when renamed
2101         procedure is No_Return.
2102         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
2103         rule in 6.5.1 (7/2): if a renaming is a completion of a subprogram
2104         with No_Return, the renamed entity must be No_Return as well.
2106 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2108         * exp_ch5.adb, freeze.adb, exp_ch4.adb, exp_ch6.adb, lib-xref.adb:
2109         Minor reformatting.
2111 2017-09-06  Justin Squirek  <squirek@adacore.com>
2113         * exp_attr.adb (Expand_N_Attribute_Reference): Modified Image
2114         attribute cases (Rewrite_Object_Reference_Image): Created to
2115         aid the rewriting of new-style 'Image attributes.
2116         * sem_attr.adb (Analyze_Attribute): Modified Image attribute cases
2117         (Check_Object_Reference_Image): Created to handle verification of
2118         'Image with object-references as prefixes.
2119         * sem_util.ads, sem_util.adb (Is_Image_Applied_To_Object):
2120         Create predicate to identify cases where an 'Image attribute's
2121         prefix applies to an object reference.
2123 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2125         * freeze.adb (Freeze_Entity): Do not generate a freeze
2126         node for a generic unit, even if it includes delayed aspect
2127         specifications. Freeze nodes for generic entities must never
2128         appear in the tree that reaches the back-end of the compiler.
2130 2017-09-06  Yannick Moy  <moy@adacore.com>
2132         * treepr.adb (Print_Entity_Info): Do not print empty Elist.
2134 2017-09-06  Yannick Moy  <moy@adacore.com>
2136         * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Do not consider calls
2137         to subprograms in other units as possibly inlined.
2139 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2141         * freeze.adb (Freeze_Entity): For a derived type that has no
2142         explicit delayed aspects but may inherit delayed aspects from its
2143         parent type, analyze aspect at freeze point for proper capture
2144         of an inherited aspect.
2146 2017-09-06  Arnaud Charlet  <charlet@adacore.com>
2148         * lib-xref.adb (Get_Through_Renamings): Get through subprogram
2149         renamings; also, avoid repeated calls to Renamed_Object when getting
2150         through object renamings.
2152 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2154         * sem_ch3.adb (Array_Type_Declaration): Handle properly an
2155         array type declaration in a private part, when an index is a
2156         subtype indication of a discrete type with a private partial view.
2158 2017-09-06  Javier Miranda  <miranda@adacore.com>
2160         * exp_ch4.adb (Expand_Modular_Op): Force generating
2161         temporary to improve the generated code.
2163 2017-09-06  Tristan Gingold  <gingold@adacore.com>
2165         * s-fatgen.adb: Minor typo fix in comment.
2167 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2169         * exp_ch5.adb (Make_Field_Assign): If the type
2170         of the right-hand side has stored constraint, use its values
2171         (except for those that are renamings of parent discriminants)
2172         to produce additional assignments for the discriminants of the
2173         left-hand side, which are invisible in the righ-hand side and
2174         not retrievable as selected components.
2176 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2178         * sem_util.adb (Needs_One_Formal): The first formal of such a
2179         function must be a controlling formal, so that Obj.F (X, Y)
2180         can have the interpretation F(Obj)(X, Y).
2181         * sem_util.ads: Clarify documentation.
2183 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
2185         * table.ads, table.adb: Restore original implementation.
2186         * namet.h (Names_Ptr): Adjust back.
2187         (Name_Chars_Ptr): Likewise.
2188         * uintp.h (Uints_Ptr): Likewise.
2189         (Udigits_Ptr): Likewise.
2190         * g-table.ads: Remove pragma Compiler_Unit_Warning.
2191         * par_sco.adb: Do not with GNAT.Table and use Table consistently.
2192         * scos.ads: Replace GNAT.Table with Table and adjust instantiations.
2193         * spark_xrefs.ads: Likewise.
2194         * scos.h: Undo latest changes.
2196 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2198         * sem_ch12.adb (Analyze_Subprogram_Instantiation): Propagate
2199         No_Return flag to instance if pragma applies to generic unit. This
2200         must be done explicitly because the pragma does not appear
2201         directly in the generic declaration (unlike the corresponding
2202         aspect specification).
2204 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
2206         * sem_ch7.adb (Has_Referencer): Move up and expand comment
2207         explaining the test used to detect inlining.  Use same test
2208         in second occurrence.
2209         (Analyze_Package_Body_Helper): Minor formatting fixes.
2211 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2213         * exp_ch4.adb (Handle_Changed_Representation): For an untagged
2214         derived type with a mixture of renamed and constrained parent
2215         discriminants, the constraint for the target must obtain the
2216         discriminant values from both the operand and from the stored
2217         constraint for it, given that the constrained discriminants are
2218         not visible in the object.
2219         * exp_ch5.adb (Make_Field_Assign): The type of the right-hand
2220         side may be derived from that of the left-hand side (as in the
2221         case of an assignment with a change of representation) so the
2222         discriminant to be used in the retrieval of the value of the
2223         component must be the entity in the type of the right-hand side.
2225 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2227         * sem_ch3.adb, sem_ch7.adb, sem_util.adb, g-debpoo.adb, sem_ch4.adb,
2228         sem_ch6.adb, sem_ch8.adb: Minor reformatting.
2229         * exp_util.adb (Is_Source_Object): Account for
2230         the cases where the source object may appear as a dereference
2231         or within a type conversion.
2232         * exp_ch6.adb: Fix missing space in error message.
2234 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2236         * sem_prag.adb: Update description of Eliminate.
2238 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2240         * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
2241         properly an attribute reference 'Loop_Entry that appears in the
2242         list of indices of an indexed expression, to prevent an infinite
2243         loop in the compiler.
2245 2017-09-06  Bob Duff  <duff@adacore.com>
2247         * s-fileio.adb (Name): Do not raise Use_Error for temp files.
2249 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2251         * sem_ch4.adb (Analyze_Set_Membership):  If an alternative
2252         in a set membership is an overloaded enumeration literal, and
2253         the type of the alternative is resolved from a previous one,
2254         replace the entity of the alternative as well as the type,
2255         to prevent inconsistencies between the entity and the type.
2257 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
2259         * ali.ads (ALIs_Record): Add No_Component_Reordering component.
2260         (No_Component_Reordering_Specified): New switch.
2261         * ali.adb (Initialize_ALI): Set No_Component_Reordering_Specified.
2262         (Scan_ALI): Set No_Component_Reordering and deal with NC marker.
2263         * bcheck.adb (Check_Consistent_No_Component_Reordering):
2264         New check.
2265         (Check_Configuration_Consistency): Invoke it.
2266         * debug.adb (d.r): Toggle the effect of the switch.
2267         (d.v): Change to no-op.
2268         * einfo.ads (Has_Complex_Representation):
2269         Restrict to record types.
2270         (No_Reordering): New alias for Flag239.
2271         (OK_To_Reorder_Components): Delete.
2272         (No_Reordering): Declare.
2273         (Set_No_Reordering): Likewise.
2274         (OK_To_Reorder_Components): Delete.
2275         (Set_OK_To_Reorder_Components): Likewise.
2276         * einfo.adb (Has_Complex_Representation): Expect record types.
2277         (No_Reordering): New function.
2278         (OK_To_Reorder_Components): Delete.
2279         (Set_Has_Complex_Representation): Expect base record types.
2280         (Set_No_Reordering): New procedure.
2281         (Set_OK_To_Reorder_Components): Delete.
2282         (Write_Entity_Flags): Adjust to above change.
2283         * fe.h (Debug_Flag_Dot_R): New macro and declaration.
2284         * freeze.adb (Freeze_Record_Type): Remove conditional code setting
2285         OK_To_Reorder_Components on record types with convention Ada.
2286         * lib-writ.adb (Write_ALI): Deal with NC marker.
2287         * opt.ads (No_Component_Reordering): New flag.
2288         (No_Component_Reordering_Config): Likewise.
2289         (Config_Switches_Type): Add No_Component_Reordering component.
2290         * opt.adb (Register_Opt_Config_Switches): Copy
2291         No_Component_Reordering onto No_Component_Reordering_Config.
2292         (Restore_Opt_Config_Switches): Restore No_Component_Reordering.
2293         (Save_Opt_Config_Switches): Save No_Component_Reordering.
2294         (Set_Opt_Config_Switches): Set No_Component_Reordering.
2295         * par-prag.adb (Prag): Deal with Pragma_No_Component_Reordering.
2296         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Also set the
2297         No_Reordering flag from the default.
2298         (Build_Derived_Private_Type): Likewise.
2299         (Build_Derived_Record_Type): Likewise.  Then inherit it
2300         for untagged types and clean up handling of similar flags.
2301         (Record_Type_Declaration): Likewise.
2302         * sem_ch13.adb (Same_Representation): Deal with No_Reordering and
2303         remove redundant test on Is_Tagged_Type.
2304         * sem_prag.adb (Analyze_Pragma): Handle No_Component_Reordering.
2305         (Sig_Flags): Likewise.
2306         * snames.ads-tmpl (Name_No_Component_Reordering): New name.
2307         (Pragma_Id): Add Pragma_No_Component_Reordering value.
2308         * warnsw.adb (Set_GNAT_Mode_Warnings): Enable -gnatw.q as well.
2309         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>:
2310         Copy the layout of the parent type only if the No_Reordering
2311         settings match.
2312         (components_to_record): Reorder record types with
2313         convention Ada by default unless No_Reordering is set or -gnatd.r
2314         is specified and do not warn if No_Reordering is set in GNAT mode.
2316 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2318         * sem_util.ads, sem_util.adb (Check_Previous_Null_Procedure):
2319         new predicate to reject declarations that can be completions,
2320         when there is a visible prior homograph that is a null procedure.
2321         * sem_ch6.adb (Analyze_Null_Procedure): use it.
2322         * sem_ch8.adb (Analyze_Subprogram_Renaming): ditto.
2324 2017-09-06  Thomas Quinot  <quinot@adacore.com>
2326         * s-regpat.adb (Compile.Parse_Literal): Fix handling of literal
2327         run of 253 characters or more.
2329 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2331         * einfo.adb (Designated_Type): Use Is_Incomplete_Type to handle
2332         properly incomplete subtypes that may be created by explicit or
2333         implicit declarations.
2334         (Is_Base_Type): Take E_Incomplete_Subtype into account.
2335         (Subtype_Kind): Ditto.
2336         * sem_ch3.adb (Build_Discriminated_Subtype): Set properly the
2337         Ekind of a subtype of a discriminated incomplete type.
2338         (Fixup_Bad_Constraint): Use Subtype_Kind in all cases, including
2339         incomplete types, to preserve error reporting.
2340         (Process_Incomplete_Dependents): Do not create a subtype
2341         declaration for an incomplete subtype that is created internally.
2342         * sem_ch7.adb (Analyze_Package_Specification): Handle properly
2343         incomplete subtypes that do not require a completion, either
2344         because they are limited views, of they are generic actuals.
2346 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2348         * checks.adb (Insert_Valid_Check): Remove the
2349         suspicious manipulation of the Do_Range_Check flag as ths is
2350         no linger needed. Suppress validity check when analysing the
2351         validation variable.
2353 2017-09-06  Philippe Gil  <gil@adacore.com>
2355         * g-debpoo.adb: adapt GNAT.Debug_Pools to allow safe thread
2356         GNATCOLL.Memory
2358 2017-09-06  Bob Duff  <duff@adacore.com>
2360         * sem_elim.adb: Minor comment fix.
2362 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2364         * sem_util.adb (Is_Object_Reference): A function call is an
2365         object reference, and thus attribute references for attributes
2366         that are functions (such as Pred and Succ) as well as predefined
2367         operators are legal in contexts that require an object, such as
2368         the prefix of attribute Img and the Ada2020 version of 'Image.
2370 2017-09-06  Hristian Kirtchev  <kirtchev@adacore.com>
2372         * exp_util.adb, einfo.adb, sem_attr.adb, exp_ch4.adb, gnatls.adb,
2373         exp_ch3.adb, xoscons.adb: Minor reformatting.
2375 2017-09-06  Raphael Amiard  <amiard@adacore.com>
2377         * a-chtgop.ads, a-chtgop.adb: Add versions of First and Next with
2378         Position parameter. If supplied, use it to provide efficient iteration.
2379         * a-cohase.ads, a-cohase.adb, a-cihama.ads, a-cihama.adb,
2380         a-cohama.ads, a-cohama.adb: Add/Use Position to provide efficient
2381         iteration.
2383 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2385         * exp_util.adb (Build_Allocate_Deallocate_Proc): If the
2386         designated type is class-wide and the expression is an unchecked
2387         conversion, preserve the conversion when checking the tag of the
2388         designated object, to prevent spurious semantic errors when the
2389         expression in the conversion has an untagged type (for example
2390         an address attribute).
2392 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2394         * sem_res.adb (Resolve_Entry_Call): Check whether a protected
2395         operation is subject to a pragma Eliminate.
2397 2017-09-06  Ed Schonberg  <schonberg@adacore.com>
2399         * sem_elim.ads, exp_ch4.adb: Minor reformatting.
2401 2017-09-06  Eric Botcazou  <ebotcazou@adacore.com>
2403         * fe.h (Eliminate_Error_Msg): Remove.
2405 2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
2407         * gcc-interface/utils.c (make_packable_type): Update call to
2408         mode_for_size_tree.
2410 2017-09-05  Richard Sandiford  <richard.sandiford@linaro.org>
2412         * gcc-interface/utils2.c (build_load_modify_store):
2413         Use int_mode_for_size.
2415 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2417         PR ada/62235
2418         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2419         for Itypes that are E_Record_Subtype with a cloned subtype.
2420         <E_Record_Subtype>: Use the DECL of the cloned type directly, if any.
2422 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2424         * gcc-interface/trans.c (convert_with_check): Use a custom base type
2425         if the base type of the expression has a different machine mode.
2426         Rename a couple of parameters and local variable.
2428 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2430         * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Address>: Do not strip
2431         conversions around prefixes that are not references.
2433 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2435         * gcc-interface/utils.c (unchecked_convert): When the result type is a
2436         non-biased integral type with size 0, set the result to 0 directly.
2438 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2440         * gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to
2441         (renaming_from_instantiation_p): ...this.
2442         * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate
2443         instead of explicit tests on kind of entities.  Adjust for renaming.
2444         (gnat_to_gnu_profile_type): Likewise.
2445         (gnat_to_gnu_subprog_type): Likewise.
2446         * gcc-interface/trans.c (Identifier_to_gnu): Likewise.
2447         (Case_Statement_to_gnu): Likewise.
2448         (gnat_to_gnu): Likewise.
2449         (process_freeze_entity): Likewise.
2450         (process_type): Likewise.
2451         (add_stmt_with_node): Adjust for renaming.
2452         * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming.
2453         (renaming_from_generic_instantiation_p): Rename to...
2454         (renaming_from_instantiation_p): ...this.  Use inline predicate.
2455         (pad_type_hasher::keep_cache_entry): Fold.
2457 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2459         * gcc-interface/trans.c (adjust_for_implicit_deref): New function.
2460         (gnat_to_gnu) <N_Explicit_Dereference>: Translate result type first.
2461         (N_Indexed_Component): Invoke adjust_for_implicit_deref on the prefix.
2462         (N_Slice): Likewise.
2463         (N_Selected_Component): Likewise.  Do not try again to translate it.
2464         (N_Free_Statement): Invoke adjust_for_implicit_deref on the expression.
2466 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2468         * repinfo.ads: Document new treatment of dynamic values.
2469         (TCode): Bump upper bound to 29.
2470         (Dynamic_Val): New constant set to 29.
2471         * repinfo.adb (Print_Expr) <Dynamic_Val>: New case.
2472         (Rep_Value)  <Dynamic_Val>: Likewise.
2473         * repinfo.h (Dynamic_Val): New macro.
2474         * gcc-interface/decl.c (annotate_value): Tidy up and cache result for
2475         DECL_P nodes too.
2476         <INTEGER_CST>: Set TCODE instead of recursing.
2477         <COMPONENT_REF>: Set TCODE instead of calling Create_Node manually.
2478         <VAR_DECL>: New case.
2479         <MULT_EXPR, PLUS_EXPR>: Fold conversions into inner operations.
2480         <BIT_AND_EXPR>: Adjust.
2481         <CALL_EXPR>: Do not fall through.
2483 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2485         * gcc-interface/trans.c (Call_to_gnu): If this is a function call and
2486         there is no target, do not create a temporary for the return value for
2487         an allocator either.
2489 2017-09-05  Eric Botcazou  <ebotcazou@adacore.com>
2491         * gcc-interface/trans.c (pos_to_constructor): Skip conversions to an
2492         unconstrained array type.
2494 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2495             Alan Hayward  <alan.hayward@arm.com>
2496             David Sherwood  <david.sherwood@arm.com>
2498         * gcc-interface/decl.c (validate_size): Use NARROWEST_INT_MODE
2499         instead of GET_CLASS_NARROWEST_MODE (MODE_INT).
2501 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2502             Alan Hayward  <alan.hayward@arm.com>
2503             David Sherwood  <david.sherwood@arm.com>
2505         * gcc-interface/decl.c (check_ok_for_atomic_type): Use
2506         is_a <scalar_int_mode>.
2507         * gcc-interface/trans.c (Pragma_to_gnu): Likewise.
2508         * gcc-interface/utils.c (gnat_type_for_mode): Likewise.
2510 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2511             Alan Hayward  <alan.hayward@arm.com>
2512             David Sherwood  <david.sherwood@arm.com>
2514         * gcc-interface/decl.c (gnat_to_gnu_entity): Use int_mode_for_size
2515         instead of mode_for_size.
2516         (gnat_to_gnu_subprog_type): Likewise.
2517         * gcc-interface/utils.c (make_type_from_size): Likewise.
2519 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2520             Alan Hayward  <alan.hayward@arm.com>
2521             David Sherwood  <david.sherwood@arm.com>
2523         * gcc-interface/misc.c (fp_prec_to_size): Use opt_scalar_float_mode.
2524         (fp_size_to_prec): Likewise.
2526 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2527             Alan Hayward  <alan.hayward@arm.com>
2528             David Sherwood  <david.sherwood@arm.com>
2530         * gcc-interface/utils.c (gnat_type_for_mode): Use is_a
2531         <scalar_float_mode> instead of SCALAR_FLOAT_MODE_P.
2533 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2534             Alan Hayward  <alan.hayward@arm.com>
2535             David Sherwood  <david.sherwood@arm.com>
2537         * gcc-interface/decl.c (validate_size): Update use of
2538         GET_MODE_WIDER_MODE, forcing a wider mode to exist.
2540 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
2541             Alan Hayward  <alan.hayward@arm.com>
2542             David Sherwood  <david.sherwood@arm.com>
2544         * gcc-interface/misc.c (fp_prec_to_size): Use new mode iterators.
2545         (fp_size_to_prec): Likewise.
2547 2017-08-29  Martin Liska  <mliska@suse.cz>
2549         PR other/39851
2550         * gcc-interface/trans.c (Pragma_to_gnu): Set argument to NULL.
2552 2017-08-08  Martin Liska  <mliska@suse.cz>
2554         * gcc-interface/trans.c: Include header files.
2556 2017-07-29  Jakub Jelinek  <jakub@redhat.com>
2558         * gcc-interface/utils.c (gnat_write_global_declarations): Pass false
2559         as new argument to the imported_module_or_decl debug hook.
2561 2017-07-25  Javier Miranda  <miranda@adacore.com>
2563         * checks.adb (Apply_Divide_Checks): Ensure that operands are not
2564         evaluated twice. 
2566 2017-07-19  Jakub Jelinek  <jakub@redhat.com>
2568         * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
2569         TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
2570         (TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
2572 2017-07-18  Mike Frysinger  <vapier@chromium.org>
2574         * gcc-interface/Makefile.in (../../gnatmake$(exeext)): Delete $(P).
2575         (../../gnatlink$(exeext)): Likewise.
2577 2017-07-15  John Paul Adrian Glaubitz  <glaubitz@physik.fu-berlin.de>
2579         PR ada/81446
2580         * system-linux-m68k.ads: Add pragma No_Elaboration_Code_All.
2581         (Backend_Overflow_Checks): Set to True.
2583 2017-06-23  Jakub Jelinek  <jakub@redhat.com>
2585         * gcc-interface/trans.c (gnat_to_gnu): Initialize sync to false.
2587 2017-06-21  Pierre-Marie de Rodat  <derodat@adacore.com>
2589         * gcc-interface/ada-tree.h (DECL_FUNCTION_IS_DEF): Update copyright
2590         notice.  New macro.
2591         * gcc-interface/trans.c (Subprogram_Body_to_gnu): Tag the subprogram
2592         as a definition.
2593         (Compilation_Unit_to_gnu): Tag the elaboration procedure as a
2594         definition.
2595         * gcc-interface/decl.c (gnat_to_gnu_entity): Tag declarations of
2596         imported subprograms for the current compilation unit as
2597         definitions.  Disable debug info for references to variables.
2598         * gcc-interface/gigi.h (create_subprog_decl): Update declaration.
2599         * gcc-interface/utils.c (gnat_pushdecl): Add external DECLs that are
2600         not built-in functions to their binding scope.
2601         (create_subprog_decl): Add a DEFINITION parameter.  If it is true, tag
2602         the function as a definition.  Update all callers.
2603         (gnat_write_global_declarations): Emit debug info for imported
2604         functions.  Filter out external variables for which debug info
2605         is disabled.
2607 2017-06-15  Nicolas Boulenguez  <nicolas.boulenguez@free.fr>
2609         PR ada/81105
2610         * gcc-interface/Makefile.in (x86 kfreebsd): Adjust system.ads setting.
2611         (i[3456]86-pc-gnu): Likewise.
2612         (x86_64 kfreebsd): Likewise.
2614 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2616         PR bootstrap/80897
2617         * exp_ch3.adb (Make_Predefined_Primitive_Specs): Use Positive index.
2619 2017-06-12  Eric Botcazou  <ebotcazou@adacore.com>
2621         PR ada/81070
2622         * s-interr-hwint.adb: Reinstate.
2623         * gcc-interface/Makefile.in (RTEMS): Use it again.
2625 2017-06-08  Olivier Hainque  <hainque@adacore.com>
2627         * vx_crtbegin_auto.c: Update year in copyright notice.
2628         * vx_crtbegin.c: Likewise.
2629         * vx_crtbegin.inc: Likewise. 
2630         * vx_crtend.c:  Likewise.
2632 2017-06-07  Sebastian Huber  <sebastian.huber@embedded-brains.de>
2634         * Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
2635         * s-tpopsp-rtems.adb: Delete.
2637 2017-06-02  Olivier Hainque  <hainque@adacore.com>
2639         * vx_crtbegin_auto.c: New file.
2640         * vx_crtbegin.c: New file.
2641         * vx_crtbegin.inc: New file.
2642         * vx_crtend.c: New file.
2644 2017-05-25  Jonathan Wakely  <jwakely@redhat.com>
2646         * gcc-interface/utils2.c (compare_elmt_bitpos): Remove redundant
2647         const qualifiers that cause -Wignored-qualifiers warnings.
2649 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
2651         * gcc-interface/decl.c (gnat_to_gnu_entity): Skip regular processing
2652         for Itypes that are E_Access_Subtype.
2653         <E_Access_Subtype>: Use the DECL of the base type directly.
2655 2017-05-22  Ed Schonberg  <schonberg@adacore.com>
2656             Eric Botcazou  <ebotcazou@adacore.com>
2658         * sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
2659         limited view may appear in the profile of a function, and a call to
2660         that function in another unit in which the full view is available must
2661         use this full view to spurious type errors at the point of call.
2662         * inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
2663         of parent body with a with clause for the main unit.
2664         * gcc-interface/decl.c (defer_limited_with_list): Document new usage.
2665         (gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
2666         types declared in external units like types from limited with clauses.
2667         Adjust final processing of defer_limited_with_list accordingly.
2668         * gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
2669         again to translate the prefix after the field if it is incomplete.
2671 2017-05-22  Eric Botcazou  <ebotcazou@adacore.com>
2673         * gcc-interface/decl.c (gnat_to_gnu_field): Do not enforce strict
2674         alignment for simple volatile fields and remove associated errors.
2676 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2678         * gcc-interface/gigi.h (get_elaboration_procedure): Delete.
2679         * gcc-interface/trans.c (get_elaboration_procedure): Make static.
2681 2017-05-15  Pierre-Marie de Rodat  <derodat@adacore.com>
2683         * gcc-interface/utils.c (can_materialize_object_renaming_p):
2684         Synchronize with GNAT's Exp_Dbug.Debug_Renaming_Declaration:
2685         process Original_Node instead of expanded names.
2687 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2689         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Only apply the
2690         addressability check in the constrained case.
2692 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2694         * gcc-interface/trans.c (Identifier_to_gnu): Also accept incomplete
2695         types not coming from a limited context.
2697 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2699         * gcc-interface/trans.c (Compilation_Unit_to_gnu): Skip subprograms on
2700         the inlined list that are not public.
2701         * gcc-interface/utils.c (create_subprog_decl): Clear TREE_PUBLIC if
2702         there is a pragma Inline_Always on the subprogram.
2704 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2706         * gcc-interface/trans.c (gnat_to_gnu) <N_Aggregate>: Fix formatting.
2707         <N_Allocator>: Use properly typed constants.
2708         (extract_values): Move around.
2709         (pos_to_constructor): Minor tweaks.
2710         (Sloc_to_locus): Fix formatting.
2711         * gcc-interface/utils.c (process_deferred_decl_context): Minor tweaks.
2712         * gcc-interface/gigi.h (MARK_VISITED): Remove blank line.
2713         (Gigi_Equivalent_Type): Adjust head comment.
2714         * gcc-interface/decl.c (Gigi_Equivalent_Type): Likewise.
2716 2017-05-15  Eric Botcazou  <ebotcazou@adacore.com>
2718         * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: When there
2719         is a representation clause on an extension, propagate the alignment of
2720         the parent type only if the platform requires strict alignment.
2722 2017-05-12  Eric Botcazou  <ebotcazou@adacore.com>
2724         * system-linux-arm.ads (Memory_Size): Use Long_Integer'Size
2725         instead of Word_Size.
2727         Revert
2728         2017-03-28  Andreas Schwab  <schwab@suse.de>
2730         PR ada/80117
2731         * system-linux-aarch64-ilp32.ads: New file.
2732         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
2733         from LIBGNAT_TARGET_PAIRS.
2734         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
2735         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
2736         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
2737         or -mabi=ilp32, resp.
2739 2017-05-10  H.J. Lu  <hongjiu.lu@intel.com>
2741         PR ada/80626
2742         * system-linux-x86.ads (Memory_Size): Use Long_Integer'Size
2743         instead of Word_Size.
2745 2017-05-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
2747         * raise-gcc.c (exception_class_eq): Make ec parameter const.
2749 2017-05-02  Richard Biener  <rguenther@suse.de>
2751         * gcc-interface/misc.c (gnat_post_options): Do not set
2752         -fstrict-overflow.
2754 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2756         * gcc-interface/trans.c (assoc_to_constructor): Make sure
2757         Corresponding_Discriminant is only called on discriminants.
2758         Skip the saving of the result only for them.
2759         (gnat_to_gnu) <N_Selected_Component>: Likewise.
2760         <N_Unchecked_Type_Conversion>: Translate the result type first.
2761         (gigi): Set TREE_NOTHROW on Begin_Handler.
2762         (stmt_list_cannot_raise_p): New predicate.
2763         (Exception_Handler_to_gnu_gcc): Emit a simple final call instead of
2764         a cleanup if the statements of the handler cannot raise.
2765         (process_freeze_entity): Use Is_Record_Type.
2766         (process_type): Likewise.
2768 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2770         * einfo.ads (Corresponding_Record_Component): New alias
2771         for Node21 used for E_Component and E_Discriminant.
2772         * einfo.adb (Corresponding_Record_Component): New function.
2773         (Set_Corresponding_Record_Component): New procedure.
2774         (Write_Field21_Name): Handle Corresponding_Record_Component.
2775         * sem_ch3.adb (Inherit_Component): Set
2776         Corresponding_Record_Component for every component in
2777         the untagged case.  Clear it afterwards for non-girder
2778         discriminants.
2779         * gcc-interface/decl.c (gnat_to_gnu_entity)
2780         <E_Record_Type>: For a derived untagged type with discriminants
2781         and constraints, apply the constraints to the layout of the
2782         parent type to deduce the layout.
2783         (field_is_aliased): Delete.
2784         (components_to_record): Test DECL_ALIASED_P directly.
2785         (annotate_rep): Check that fields are present except for
2786         an extension.
2787         (create_field_decl_from): Add DEBUG_INFO_P
2788         parameter and pass it in recursive and other calls.  Add guard
2789         for the manual CSE on the size.
2790         (is_stored_discriminant): New predicate.
2791         (copy_and_substitute_in_layout): Consider only
2792         stored discriminants and check that original fields are present
2793         in the old type.  Deal with derived types.  Adjust call to
2794         create_variant_part_from.
2796 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2798         * exp_ch6.adb (Expand_Call_Helper): When locating the
2799         accessibility entity created for an access parameter, handle
2800         properly a reference to a formal of an enclosing subprogram. if
2801         the reference appears in an inherited class-wide condition, it
2802         is the rewriting of the reference in the ancestor expression,
2803         but the accessibility entity must be that of the current formal.
2805 2017-05-02  Javier Miranda  <miranda@adacore.com>
2807         * exp_ch4.adb (Expand_Non_Binary_Modular_Op): New subprogram.
2808         (Expand_N_Op_Add, Expand_N_Op_Divide, Expand_N_Op_Minus,
2809         Expand_N_Op_Multiply, Expand_N_Op_Or, Expand_N_Op_Subtract):
2810         Call Expand_Non_Binary_Modular_Op.
2812 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2814         * sem_ch3.adb (Build_Derived_Private_Type): If the parent type
2815         has discriminants, do not override the Stored_Constraint list of
2816         the full view of the derived type with that of the derived type.
2818 2017-05-02  Bob Duff  <duff@adacore.com>
2820         * sem_attr.adb (Attribute_Enum_Rep): Disallow T'Enum_Rep.
2822 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
2824         * s-os_lib.ads: Minor typo fix.
2826 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
2828         * gnatls.adb: Merge and refactor code from Prj.Env and remove
2829         this deprecated dependency.
2831 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2833         * exp_util.ads: minor comment addition.
2835 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2837         * sem_ch3.adb (Build_Derived_Record_Type): Fix a few typos and
2838         pastos in part #3 of the head comment.
2840 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2842         * exp_ch3.adb (Freeze_Type): Do not generate an invariant
2843         procedure body for a local (sub)type declaration within a
2844         predicate function. Invariant checks do not apply to these, and
2845         the expansion of the procedure will happen in the wrong scope,
2846         leading to misplaced freeze nodes.
2848 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2850         * exp_util.adb (Insert_Library_Level_Action): Use proper scope
2851         to analyze generated actions.  If the main unit is a body,
2852         the required scope is that of the corresponding unit declaration.
2854 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
2856         * einfo.adb (Declaration_Node): flip branches of
2857         an IF statement to avoid repeated negations in its condition;
2858         no change in semantics, only to improve readability.
2860 2017-05-02  Arnaud Charlet  <charlet@adacore.com>
2862         * sem_case.adb: Remove extra spaces in parameter declarations.
2864 2017-05-02  Justin Squirek  <squirek@adacore.com>
2866         * usage.adb: Replace space with hyphen ("run time" -> "run-time")
2867         in usage line for new -gnatwE switch.
2869 2017-05-02  Claire Dross  <dross@adacore.com>
2871         * a-cofuve.ads (Remove): Remove unnecessary
2872         conditions in precondition.
2874 2017-05-02  Vasiliy Fofanov  <fofanov@adacore.com>
2876         * a-stream.ads, exp_imgv.adb, sem_ch10.adb,
2877         sem_attr.adb, s-finmas.ads, osint.adb: Minor typo fix.
2879 2017-05-02  Justin Squirek  <squirek@adacore.com>
2881         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2882         alternative expression.
2883         * sem_res.adb (Resolve_Case_Expression): Ditto.
2885 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2887         * exp_disp.adb (Set_All_DT_Position, In_Predef_Prim_DT):
2888         Refine predicate for the case where the primitive operation
2889         is a renaming of equality.  An overriding operation that is
2890         a user-defined renaming of predefined equality inherits its
2891         slot from the overridden operation. Otherwise it is treated
2892         as a predefined op and occupies the same predefined slot as
2893         equality. A call to it is transformed into a call to its alias,
2894         which is the predefined equality. A dispatching call thus uses
2895         the proper slot if operation is further inherited and called
2896         with class-wide arguments.
2898 2017-05-02  Justin Squirek  <squirek@adacore.com>
2900         * errout.adb (Set_Msg_Text): Add a case to switch the message
2901         type when the character '[' is detected signifying a warning
2902         about a run-time exception.
2903         * opt.ads Add a new Warning_Mode value for new switch
2904         * switch-b.adb (Scan_Binder_Switches): Add case for the binder
2905         to handle new warning mode
2906         * usage.adb (Usage): Add usage entry for -gnatwE
2907         * warnsw.adb (Set_Warning_Switch): Add case for the new switch
2909 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2911         * sem_prag.adb (Process_Conversion): Reject an intrinsic operator
2912         declaration that operates on some fixed point type.
2914 2017-05-02  Justin Squirek  <squirek@adacore.com>
2916         * a-crbtgo.adb, s-taasde.adb: Remove unused use-type clauses.
2918 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
2920         * sem_ch6.adb (Analyze_Null_Procedure): Revert previous change.
2922 2017-05-02  Justin Squirek  <squirek@adacore.com>
2924         * sem_ch4.adb (Analyze_Case_Expression): Add check for valid
2925         expression (Analyze_If_Expression): Add check for valid condition
2926         * sem_eval.adb (Eval_Case_Expression): Add check for error posted
2927         on case-expression
2928         * sem_res.adb (Resolve_If_Expression): Add check for valid
2929         condition and then-expression.
2931 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
2933         * exp_ch3.adb (Build_Initialization_Call): Generate a null
2934         statement if the initialization call is a null procedure, as
2935         can happen with a controlled type with no explicit Initialize
2936         procedure, or an array of such.
2937         * exp_ch7.adb (Process_Object_Declaration): For a type with
2938         controlled components that has a trivial Initialize procedure,
2939         insert declaration for finalization counter after object
2940         declaration itself.
2941         (Make_Deep_Array_Body, Build_Initialize_statements): Do not create
2942         finalization block and attendant declarations if component has
2943         a trivial Initialize procedure.
2944         (Make_Init_Call): Do not generate a call if controlled type has
2945         a trivial Initialize procedure.
2947 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2949         * g-forstr.ads (Data): Move Format component last.
2950         * g-forstr.adb ("+"): Adjust for above change.
2951         * g-rewdat.ads (Buffer): Move Buffer, Current, Pattern and Value last.
2952         * g-sechas.ads (Context): Move Key last.
2953         * g-socket.ads (Service_Entry_Type): Move Aliases last.
2954         * s-fileio.adb (Temp_File_Record): Move Name last.
2955         * s-regexp.adb (Regexp_Value): Move Case_Sensitive last.
2956         * xr_tabls.ads (Project_File): Move Src_Dir and Obj_Dir last.
2958 2017-05-02  Jerome Lambourg  <lambourg@adacore.com>
2960         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: Remove the -nognarl
2961         switch introduced recently. finally not needed.
2963 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
2965         * sem_ch6.adb (Analyze_Null_Procedure): Set the
2966         Corresponding_Body link for a null procedure declaration.
2968 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
2970         * atree.h (Flag290): Add missing terminating parenthesis.
2971         * einfo.adb (Is_Class_Wide_Clone): Use Flag290.
2972         (Set_Is_Class_Wide_Clone): Likewise.
2973         * einfo.ads (Is_Class_Wide_Clone): Likewise.
2975 2017-05-02  Gary Dismukes  <dismukes@adacore.com>
2977         * checks.ads (Null_Exclusion_Static_Checks): Add Boolean
2978         parameter Array_Comp to indicate the case of an array object
2979         with null-excluding components.
2980         * checks.adb (Null_Exclusion_Static_Checks):
2981         Call Compile_Time_Constraint_Error instead of
2982         Apply_Compile_Time_Constraint_Error in the component case. Also
2983         call that when Array_Comp is True, with an appropriate warning for
2984         the array component case. Only create an explicit initialization
2985         by null in the case of an object of a null-excluding access type
2986         (and no longer do that in the component case).
2987         * sem_ch3.adb (Check_Component): Add a Boolean parameter
2988         Array_Comp defaulted to False.  Pass Empty for the Comp
2989         actual when calling Null_Exclusion_Static_Checks in the case
2990         where Comp_Decl matches Object_Decl, because we don't have a
2991         component in that case. In the case of an object or component
2992         of an array type, pass True for Array_Comp on the recursive call
2993         to Check_Component.
2995 2017-05-02  Bob Duff  <duff@adacore.com>
2997         * s-taprop-linux.adb (Prio_To_Linux_Prio): New function to correctly
2998         compute the linux priority from the Ada priority. Call this everywhere
2999         required. In particular, the previous version was not doing this
3000         computation when setting the ceiling priority in various places. It
3001         was just converting to C.int, which results in a ceiling that is off
3002         by 1.
3004 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3006         * sem_ch3.adb: Comment predicate inheritance.
3008 2017-05-02  Tristan Gingold  <gingold@adacore.com>
3010         * s-trasym.ads: Add comment.
3012 2017-05-02  Bob Duff  <duff@adacore.com>
3014         * sem_elab.adb, sem_elab.ads: Minor comment fixes.
3015         * sem_ch4.adb: Minor reformatting.
3016         * s-taprop-linux.adb, s-taspri-posix.ads: Code refactoring.
3017         * s-taspri-posix-noaltstack.ads: Minor refactoring.
3018         * sinput.ads: Minor typo fix.
3020 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3022         * exp_ch9.adb (Discriminated_Size): Moved to sem_util.
3023         * sem_util.ads, sem_util.adb (Discriminated_Size): Predicate moved
3024         here from exp_ch9, to recognize objects whose creation requires
3025         dynamic allocation, so that the proper warning can be emitted
3026         when restriction No_Implicit_Heap_Allocation is in effect.
3027         * sem_ch3.adb (Analyze_Object_Declaration): Use Discriminated_Size
3028         to emit proper warning when an object that requires dynamic
3029         allocation is declared.
3031 2017-05-02  Tristan Gingold  <gingold@adacore.com>
3033         * s-trasym.ads, s-trasym.adb (Enable_Cache): New.
3035 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3037         * sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
3038         visibility rules for equality operators that apply within an
3039         instantiation apply within an inlined body.
3040         * sem_type.adb (Add_One_Interp): ditto.
3042 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
3044         * sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
3045         procedures.
3047 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
3049         * snames.ads-tmpl
3050         (Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
3051         Name_No_Tagged_Streams): Move to regular pragmas.  Add
3052         placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
3053         and Secondary_Stack_Size.
3054         (Pragma_Id): Move Pragma_Assume,
3055         Pragma_Attribute_Definition, Pragma_Loop_Optimize and
3056         Pragma_No_Tagged_Streams to second part.
3058 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
3060         * exp_attr.adb: Minor reformatting.
3062 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3064         * sem_ch4.adb (Analyze_Selected_Component): Improve error
3065         detection for illegal references to private components or
3066         operations of a protected type in the body of the type.
3068 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
3070         * opt.ads: Add missing GNAT markers in comments.
3071         * opt.adb (Set_Opt_Config_Switches): Do not override earlier
3072         settings of Optimize_Alignment at the end.
3074 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
3076         * checks.adb (Apply_Constraint_Check): Do not apply
3077         a discriminant check when the associated type is a constrained
3078         subtype created for an unconstrained nominal type.
3079         * exp_attr.adb: Minor reformatting.
3081 2017-05-02  Bob Duff  <duff@adacore.com>
3083         * sem_ch3.adb (OK_For_Limited_Init_In_05): Handle correctly
3084         the N_Raise_Expression case.
3085         * sem_ch6.adb (Check_Limited_Return): Minor: clarify comment,
3086         and add assertions.
3088 2017-05-02  Yannick Moy  <moy@adacore.com>
3090         * exp_ch4.adb (Expand_N_Op_Ne): Do not bump parenthese level and
3091         optimize length comparison in GNATprove mode.
3092         * exp_spark.adb (Expand_SPARK_Op_Ne): New function to rewrite
3093         operator /= into negation of operator = when needed.
3094         (Expand_SPARK): Call new
3095         function to expand operator /=.
3097 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3099         * exp_fixd.adb (Expand_Divide_Fixed_By_Fixed_Giving_Fixed):
3100         Simplify the expression for a fixed-fixed division to remove
3101         divisions by constants whenever possible, as an optimization
3102         for restricted targets.
3104 2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>
3106         * checks.adb, sem_ch3.adb, sem_ch6.adb: Minor reformatting.
3108 2017-05-02  Bob Duff  <duff@adacore.com>
3110         * exp_attr.adb (Callable, Identity, Terminated): Use Find_Prim_Op
3111         to find primitive ops, instead of using an Identifier that will
3112         later be looked up. This is necessary because these ops are not
3113         necessarily visible at all places where we need to call them.
3114         * exp_util.ads: Minor comment fix.
3116 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3118         * sem_ch6.adb (Fully_Conformant_Expressions): Two entity
3119         references are fully conformant if they are both expansions
3120         of the discriminant of a protected type, within one of the
3121         protected operations. One occurrence may be expanded into a
3122         constant declaration while the other is an input parameter to
3123         the corresponding generated subprogram.
3125 2017-05-02  Justin Squirek  <squirek@adacore.com>
3127         * sem_ch3.adb (Check_For_Null_Excluding_Components): Created for
3128         recursivly searching composite-types for null-excluding access
3129         types and verifying them.
3130         (Analyze_Object_Declaration): Add a
3131         call to Check_Null_Excluding_Components for static verification
3132         of non-initialized objects.
3133         * checks.adb, checks.ads (Null_Exclusion_Static_Checks): Added
3134         a parameter for a composite-type's component and an extra case
3135         for printing component information.
3137 2017-05-02  Yannick Moy  <moy@adacore.com>
3139         * sem_ch10.adb (Analyze_Subunit): Take
3140         configuration pragma into account when restoring appropriate
3141         pragma for analysis of subunit.
3143 2017-05-02  Justin Squirek  <squirek@adacore.com>
3145         * s-tasren.adb, s-tasini.adb, s-taprop-linux.adb,
3146         s-mudido-affinity.adb,, a-exetim-posix.adb, a-direio.adb,
3147         g-socket.adb, s-taenca.adb, s-fileio.adb: Remove unused use-type
3148         clauses from the runtime.
3150 2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>
3152         * freeze.adb (Check_Component_Storage_Order): Do not treat bit-packed
3153         array components specially.
3155 2017-05-02  Ed Schonberg  <schonberg@adacore.com>
3157         * sem_ch8.adb (Premature_Usage): If the premature usage of
3158         an entity is as the expression in its own object decaration,
3159         rewrite the reference as Any_Id to prevent cascaded errors or
3160         compiler loops when such an entity is used in an address clause.
3162 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
3164         * gcc-interface/decl.c (components_to_record): Add missing guard.
3166 2017-05-01  Eric Botcazou  <ebotcazou@adacore.com>
3168         * gcc-interface/decl.c (components_to_record): Add more comments.
3169         Put back pending fields onto the regular list if the misalignment
3170         happens to cancel itself.
3172 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3174         * sem_ch4.adb (Complete_Object_Operation): When rewriting the
3175         controlling actual in a prefixed call, preserve the original node
3176         information if the prefix itself has been rewritten, for ASIS use.
3178 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3180         * exp_ch6.adb (Insert_Post_Call_Actions):
3181         Code clean up. Insert the post-call actions after an enclosing
3182         procedure call when N denotes a function call and appears as an
3183         actual parameter in the procedure call.
3185 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
3187         * freeze.adb (Check_Component_Storage_Order): If there is a clause
3188         for the component, also reject the attribute if the component
3189         doesn't end on a byte boundary and its scalar storage order is
3190         different from that of the enclosing record type.
3192 2017-04-28  Javier Miranda  <miranda@adacore.com>
3194         * atree.ads (Info_Messages): Removed.
3195         (Warning_Info_Messages): New counter.
3196         (Report_Info_Messages): New counter.
3197         * err_vars.ads Update documentation.
3198         * errout.adb (Delete_Warning_And_Continuations): Update
3199         Info_Message occurrences.
3200         (Error_Msg_Internal): Update Info_Message occurrences.
3201         (Delete_Warning): Update Info_Message occurrences.
3202         (Write_Error_Summary): Update Info_Message occurrences.
3203         (Output_Messages): Update Info_Message occurrences.
3204         (To_Be_Removed): Update Info_Message occurrences.
3205         (Reset_Warnings): Update Info_Message occurrences.
3206         * errutil.adb (Error_Msg): Update Info_Message occurrences.
3207         (Finalize): Update Info_Message occurrences.
3208         (Initialize): Update Info_Message occurrences.
3209         * erroutc.adb (Delete_Msg): Update Info_Message occurrences.
3210         (Compilation_Errors): Update Info_Message_Occurences.
3212 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
3214         * exp_ch3.adb (Build_Init_Statements): Likewise on Nam.
3215         * freeze.adb (Check_Component_Storage_Order): And on Comp_Byte_Aligned.
3216         * sem_aggr.adb (Resolve_Record_Aggregate): Initialize Box_Node.
3217         * sem_attr.adb (Loop_Entry): Initialize Encl_Loop.
3218         * sem_ch12.adb (Build_Operator_Wrapper): Add pragma Warnings on Expr.
3219         * sem_ch13.adb (Validate_Address_Clauses): Initialize Y_Alignment and
3220         Y_Size.
3221         * sem_eval.adb (Why_Not_Static): Initialize Typ.
3222         * sem_prag.adb (Analyze_Pragma): Add pragma Warnings on Str.
3224 2017-04-28  Bob Duff  <duff@adacore.com>
3226         * sem_util.ads, sem_util.adb (Might_Raise): New function
3227         that replaces Is_Exception_Safe, but has the opposite
3228         sense. Is_Exception_Safe was missing various cases -- calls inside
3229         a pragma Debug, calls inside an 'if' or assignment statement,
3230         etc. Might_Raise now walks the entire subtree looking for things
3231         that can raise.
3232         * exp_ch9.adb (Is_Exception_Safe): Remove.
3233         (Build_Protected_Subprogram_Body): Replace call to
3234         Is_Exception_Safe with "not Might_Raise". Misc cleanup (use
3235         constants where possible).
3236         * exp_ch7.adb: Rename Is_Protected_Body -->
3237         Is_Protected_Subp_Body. A protected_body is something different
3238         in the grammar.
3240 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
3242         * inline.adb (Expand_Inlined_Call): Initialize Targ1 variable.
3243         * par-ch3.adb (P_Component_Items): Initialize Decl_Node variable.
3244         (P_Discrete_Choice_List): Initialize Expr_Node variable.
3245         * par-ch9.adb (P_Task): Initialize Aspect_Sloc variable.
3246         (P_Protected): Likewise.
3247         * sem_case.adb (Check_Duplicates):
3248         Add pragma Warnings on variable.
3249         * sem_ch12.adb (Preanalyze_Actuals): Initialize Vis variable.
3250         * sem_ch4.adb (List_Operand_Interps):  Add pragma Warnings on variable.
3251         * sem_ch5.adb (Analyze_Assignment): Initialize Save_Full_Analysis.
3252         (Analyze_Exit_Statement): Initialize Scope_Id variable.
3253         (Analyze_Iterator_Specification): Initialize Bas variable.
3254         * sem_ch9.adb (Allows_Lock_Free_Implementation): Initialize
3255         Error_Count (Satisfies_Lock_Free_Requirements): Likewise.
3256         (Analyze_Accept_Statement): Initialize Task_Nam.
3258 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3260         * checks.adb (Install_Primitive_Elaboration_Check):
3261         Do not generate an elaboration check if all checks have been
3262         suppressed.
3264 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3266         * sem_ch13.adb (Analyze_Aspect_Specifications, case
3267         Interrupt_Handler and Attach_Handler): Generate reference
3268         to protected operation to prevent spurious warnings about
3269         unreferenced entities. Previous scheme failed with style checks
3270         enabled.
3272 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3274         * sem_prag.adb (Relocate_Pragmas_To_Body): A pragma Warnings
3275         that follows an expression function must not be relocated to
3276         the generated body, because it applies to the code that follows.
3278 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
3280         * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test
3281         Relaxed_RM_Semantics to avoid having CodePeer issue errors on
3282         code that might violate the more stringent checking for 'Access
3283         introduced in Ada 2005.
3285 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
3287         * a-cforse.adb: minor style fix in comment.
3289 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
3291         * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
3292         initialize Block_Decls variable.
3293         (Expand_Entry_Barrier): Add pragma Warnings on Func_Body variable.
3294         (Build_Dispatching_Requeue): Add pragma Warnings on Op variable.
3295         * exp_disp.adb (Expand_Interface_Actuals): Initialize
3296         Formal_DDT and Actual_DDT variables.
3297         (Expand_Interface_Thunk): Initialize Iface_Formal.
3298         (Make_DT): Initialize Size_Comp.
3299         (Make_Select_Specific_Data_Table): Initialize Decls.
3300         * exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies):
3301         Also initialize more RPC_Receiver_* variables.
3302         (Build_To_Any_Function): Initialize Cstr_Formal.
3303         * exp_prag.adb (Expand_Pragma_Contract_Cases): Initialize Msg_Str.
3305 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3307         * sem_ch6.adb (Freeze_Type_Refs): For an interface conversion
3308         node between access types, freeze the designated type as well,
3309         so that dispatch table pointers are created in the proper scope,
3310         and not in the constructed body of the expression function.
3312 2017-04-28  Bob Duff  <duff@adacore.com>
3314         * alloc.ads (Nodes_Initial): Go back to previous value. The large
3315         value makes large compilations faster, but small compilations slower.
3317 2017-04-28  Arnaud Charlet  <charlet@adacore.com>
3319         * sem_util.adb: minor typos in Is_Child_Or_Sibling.
3321 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3323         * erroutc.adb (Compilation_Errors): Do not consider info messages
3324         as suitable warnings when warnings must be treated as errors.
3325         * sem_ch7.adb (Analyze_Package_Specification): Do not consider
3326         internally-generated packages when outputting completion
3327         information.
3328         * errout.adb (Output_Messages): Do not consider info messages as
3329         suitable warnings when warnings must be treated as errors.
3330         * errutil.adb (Finalize): Do not consider info messages as
3331         suitable warnings when warnings must be treated as errors.
3333 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
3335         * warnsw.ads: Minor fix for incorrect wording in comment.
3337 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3339         * sem_res.adb (In_Instance_Code): New predicate in
3340         Valid_Conversion, to determine whether a type conversion appears
3341         as (or within) an actual for a formal object.  Type conversions
3342         in instances are not rechecked in Valid_Conversion because
3343         visibility changes between generic location andi instance may
3344         lead to spurious errors, but conversions within an actual must be
3345         fully checked, and they are not fully resolved when pre-analyzing
3346         the actuals.
3348 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3350         * exp_ch6.adb (Expand_N_Extended_Return_Statement): Use
3351         New_Copy_Tree instead of Relocate_Node as any subsequent copies
3352         of the relocated node will have mangled Parent pointers.
3353         * sem_util.adb (Build_NCT_Hash_Tables): Reset both hash
3354         tables used in conjunction with entity and itype replication.
3355         (Visit_Entity): Rewrite the restriction on which entities
3356         require duplication.  The restriction now includes all types.
3358 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3360         * a-cofuse.ads, a-cfdlli.ads, a-cfhase.adb, a-cfhase.ads, a-cfinve.adb,
3361         a-cfinve.ads, a-cforma.adb, a-cforma.ads, a-cofuma.adb, a-cofuma.ads,
3362         a-cfhama.adb, a-cfhama.ads, a-cforse.adb: Minor reformatting and code
3363         cleanups.
3365 2017-04-28  Hristian Kirtchev  <kirtchev@adacore.com>
3367         * exp_util.adb, g-dyntab.adb, par-ch4.adb, sem_util.adb, sem_attr.adb,
3368         gnat1drv.adb, exp_disp.adb, namet.adb, alloc.ads: Minor reformatting.
3370 2017-04-28  Gary Dismukes  <dismukes@adacore.com>
3372         * exp_util.adb: Minor reformatting.
3374 2017-04-28  Ed Schonberg  <schonberg@adacore.com>
3376         * sem_ch4.adb: Fix copy/pasto.
3378 2017-04-27  Tristan Gingold  <gingold@adacore.com>
3380         * gcc-interface/Make-lang.in: Define EH_MECHANISM while building
3381         raise-gcc.c. Fix include search path for raise-gcc.c
3383 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
3385         * fe.h (Warn_On_Questionable_Layout): Declare.
3386         * warnsw.ads (Warn_On_Record_Holes): Move down.
3387         (Warn_On_Questionable_Layout): New boolean variable.
3388         (Warning_Record): Add Warn_On_Questionable_Layout field.
3389         * warnsw.adb (All_Warnings): Set Warn_On_Questionable_Layout.
3390         (Restore_Warnings): Likewise.
3391         (Save_Warnings): Likewise.
3392         (Set_Dot_Warning_Switch): Handle 'q' and 'Q' letters.
3393         * gcc-interface/decl.c (gnat_to_gnu_entity): Adjust call to
3394         components_to_record.
3395         (gnu_field_to_gnat): New function.
3396         (warn_on_field_placement): Likewise.
3397         (components_to_record): Add GNAT_RECORD_TYPE and remove REORDER
3398         parameters.  Rename local variables and adjust recursive call.
3399         Rework final scan of the field list and implement warnings on the
3400         problematic placement of specific sorts of fields.
3402 2017-04-27  Bob Duff  <duff@adacore.com>
3404         * errout.adb, exp_aggr.adb, exp_attr.adb, exp_code.adb, fname.adb,
3405         * fname.ads, freeze.adb, inline.adb, lib.adb, lib.ads, lib-list.adb,
3406         * lib-load.adb, lib-writ.adb, par.adb, restrict.adb, rtsfind.adb,
3407         * sem.adb, sem_cat.adb, sem_ch10.adb, sem_ch12.adb, sem_ch3.adb,
3408         * sem_ch4.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
3409         * sem_intr.adb, sem_res.adb, sem_util.adb, sem_warn.adb, sprint.adb:
3410         For efficiency, cache results of Is_Internal_File_Name and
3411         Is_Predefined_File_Name in the Units table. This avoids a lot
3412         of repeated text processing.
3414 2017-04-27  Emmanuel Briot  <briot@adacore.com>
3416         * g-comlin.adb (Sort_Sections): remove useless test.
3418 2017-04-27  Claire Dross  <dross@adacore.com>
3420         * a-cfhase.adb, a-cfhase.ads (=): Generic parameter removed to
3421         allow the use of regular equality over elements in contracts.
3422         (Formal_Model): Ghost package containing model functions that are
3423         used in subprogram contracts.
3424         (Current_To_Last): Removed, model functions should be used instead.
3425         (First_To_Previous): Removed, model functions should be used instead.
3426         (Strict_Equal): Removed, model functions should be used instead.
3427         (No_Overlap): Removed, model functions should be used instead.
3428         (Equivalent_Keys): Functions over cursors are removed. They were
3429         awkward with explicit container parameters.
3430         * a-cforse.adb, a-cforse.ads (=): Generic parameter removed to
3431         allow the use of regular equality over elements in contracts.
3432         (Formal_Model): Ghost package containing model functions that
3433         are used in subprogram contracts.
3434         (Current_To_Last): Removed, model functions should be used instead.
3435         (First_To_Previous): Removed, model functions should be used instead.
3436         (Strict_Equal): Removed, model functions should be used instead.
3437         (No_Overlap): Removed, model functions should be used instead.
3439 2017-04-27  Yannick Moy  <moy@adacore.com>
3441         * gnat1drv.adb: Code cleanup.
3443 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3445         * exp_util.adb (Replace_Entity): The prefix of a 'Result
3446         attribute reference in a post- condition is the subprogram to
3447         which the condition applies. If the condition is inherited
3448         by a type extension, the prefix becomes a reference to the
3449         inherited operation, but there is no need to create a wrapper
3450         for this operation, because 'Result is expanded independently
3451         when elaborating the postconditions.
3453 2017-04-27  Bob Duff  <duff@adacore.com>
3455         * sinput.adb: Minor code cleanup.
3456         * namet.adb (Append): Create faster versions of
3457         Append(String) and Append(Name_Id) by using slice assignment
3458         instead of loops.
3459         * sem_util.adb (In_Instance): Speed this up by removing
3460         unnecessary tests; Is_Generic_Instance is defined for all
3461         entities.
3462         * sem_util.ads, sem_util.adb (In_Parameter_Specification):
3463         Remove unused function.
3464         * alloc.ads (Nodes_Initial): Use a much larger value, because
3465         the compiler was spending a lot of time copying the nodes table
3466         when it grows. This number was chosen in 1996, so is rather out
3467         of date with current memory sizes. Anyway, it's virtual memory.
3468         Get rid of Orig_Nodes_...; use Node_... instead.
3469         * atree.adb (Lock): Do not release the Nodes tables; it's a
3470         waste of time.
3471         Orig_Nodes_ ==> Nodes_
3472         * nlists.adb: Orig_Nodes_ ==> Nodes_
3473         * g-table.adb: Remove unused "with" clause.
3474         * g-table.ads, table.ads: Remove Big_Table_Type, which should
3475         not be used by clients.
3476         * g-dyntab.adb (Last_Allocated): New function
3477         to encapsulate T.P.Last_Allocated, which I'm thinking of changing.
3479 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3481         * sem_eval.adb (Subtypes_Statically_Compatible): Remove duplicated
3482         check.
3483         (Subtypes_Statically_Match): Remove duplicate check.
3484         * sem_prag.adb (Check_Arg_Is_External_Name): Remove duplicate check.
3486 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3488         * exp_aggr.adb (Replace_Type): Remove the special processing
3489         for selected components.
3490         * exp_attr.adb (Expand_N_Attribute_Reference): Merge the
3491         processing for attributes Fixed_Value and Integer_Value.
3492         * exp_util.adb (Side_Effect_Free): Merge the processing for
3493         qualified expressions, type conversions, and unchecked type
3494         conversions.
3495         * g-comlin.adb (Is_In_Config): Merge the processing for No_Space
3496         and Optional.
3497         * par-ch3.adb (P_Declarative_Items): Merge the processing for
3498         tokens function, not, overriding, and procedure.
3499         * sem_ch6.adb (Fully_Conformant_Expressions): Merge the processing
3500         for qualified expressions, type conversions, and unchecked
3501         type conversions.
3502         * sem_util.adb (Compile_Time_Constraint_Error): Merge the
3503         processing for Ada 83 and instances.
3504         (Object_Access_Level): Merge the processing for indexed components
3505         and selected components.
3506         * uname.adb (Add_Node_Name): Merge the processing for stubs.
3508 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3510         * checks.adb (Install_Primitive_Elaboration_Check):
3511         Do not generate the check when restriction No_Elaboration_Code
3512         is in effect.
3514 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3516         * exp_disp.adb (Build_Class_Wide_Check): New subsidiary
3517         of Expand_Dispatching_Call. If the denoted subprogram has a
3518         class-wide precondition, this is the only precondition that
3519         applies to the call, rather that the class-wide preconditions
3520         that may apply to the body that is executed. (This is specified
3521         in AI12-0195).
3523 2017-04-27  Yannick Moy  <moy@adacore.com>
3525         * gnat1drv.adb (Adjust_Global_Switches): Issue
3526         a warning in GNATprove mode if the runtime library does not
3527         support IEEE-754 floats.
3529 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3531         * sem_prag.adb (Inherit_Class_Wide_Pre): If the parent operation
3532         is itself inherited it does not carry any contract information,
3533         so examine its parent operation which is its Alias.
3535 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3537         * sem_attr.adb (Analyze_Attribute, case 'Image): In Ada2012 the
3538         prefix can be an object reference in which case Obj'Image (X)
3539         can only be interpreted as an indexing of the parameterless
3540         version of the attribute.
3541         * par-ch4.adb (P_Name): An attribute reference can be the prefix of
3542         an indexing or a slice operation if the attribute does not require
3543         parameters. In Ada2012 'Image also belongs in this category,
3544         and A'Image (lo .. hi) is legal and must be parsed as a slice.
3546 2017-04-27  Yannick Moy  <moy@adacore.com>
3548         * exp_ch4.adb: Minor reformatting.
3549         * gnat1drv.adb (Adjust_Global_Switches): When in GNATprove mode,
3550         disable the CodePeer and C generation modes. Similar to the
3551         opposite actions done in CodePeer mode.
3553 2017-04-27  Yannick Moy  <moy@adacore.com>
3555         * sem_res.adb: Remove duplicate code.
3556         * sem_attr.adb: Delete duplicate code.
3558 2017-04-27  Bob Duff  <duff@adacore.com>
3560         * g-dyntab.adb: Reduce the amount of copying in
3561         Release. No need to copy items past Last.
3563 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3565         * checks.adb Add with and use clauses for Sem_Disp.
3566         (Install_Primitive_Elaboration_Check): New routine.
3567         * checks.ads (Install_Primitive_Elaboration_Check): New routine.
3568         * exp_attr.adb (Expand_N_Attribute_Reference): Clean up the
3569         processing of 'Elaborated.
3570         * exp_ch6.adb (Expand_N_Subprogram_Body): Install a primitive
3571         elaboration check.
3573 2017-04-27  Bob Duff  <duff@adacore.com>
3575         * g-dyntab.ads, g-dyntab.adb, g-table.ads: Remove incorrect assertion.
3576         If the table grows and then shrinks back to empty, we won't necessarily
3577         point back to the empty array. Code cleanups.
3578         * sinput.ads: Add 'Base to Size clause to match the declared
3579         component subtypes.
3581 2017-04-27  Claire Dross  <dross@adacore.com>
3583         * a-cforma.adb, a-cforma.ads (=): Generic parameter removed to
3584         allow the use of regular equality over elements in contracts.
3585         (Formal_Model): Ghost package containing model functions that
3586         are used in subprogram contracts.
3587         (Current_To_Last): Removed, model functions should be used instead.
3588         (First_To_Previous): Removed, model functions should be used instead.
3589         (Strict_Equal): Removed, model functions should be used instead.
3590         (No_Overlap): Removed, model functions should be used instead.
3591         * a-cofuma.adb, a-cofuma.ads (Enable_Handling_Of_Equivalence)
3592         Boolean generic parameter to disable contracts for equivalence
3593         between keys.
3594         (Witness): Create a witness of a key that is used for handling of
3595         equivalence between keys.
3596         (Has_Witness): Check whether a witness is contained in a map.
3597         (W_Get): Get the element associated to a witness.
3598         (Lift_Equivalent_Keys): Removed, equivalence between keys is handled
3599         directly.
3600         * a-cofuse.adb, a-cofuse.ads (Enable_Handling_Of_Equivalence)
3601         Boolean generic parameter to disable contracts for equivalence
3602         between keys.
3603         * a-cfhama.adb, a-cfhama.ads (Formal_Model.P) Disable handling
3604         of equivalence on functional maps.
3605         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.P) Disable handling
3606         of equivalence on functional maps.
3608 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3610         * exp_ch9.adb (Expand_Entry_Barrier): Code
3611         cleanup. Do not perform the optimization which removes the
3612         declarations of the discriminant and component renamings when
3613         validity checks on operands and attributes are in effect.
3615 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3617         * exp_spark.adb, exp_util.adb, sem_ch7.adb, g-dyntab.adb, g-dyntab.ads,
3618         freeze.adb, a-cfinve.ads, a-cofuma.adb, a-cofuma.ads, a-cfhama.adb,
3619         a-cfhama.ads, a-cofove.ads: Minor reformatting.
3621 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3623         * g-debpoo.adb (Dump_Gnatmem): Protect against a possible null
3624         pointer dereference.
3625         * g-spipat.adb (Dump): Code clean up. Protect against a possible
3626         null pointer dereference.
3628 2017-04-27  Bob Duff  <duff@adacore.com>
3630         * g-dyntab.ads, g-dyntab.adb: Default for Table_Low_Bound.
3631         Rename Empty --> Empty_Table_Ptr, and don't duplicate code for it.
3632         Free renames Init, since they do the same thing.
3633         * g-table.ads: Default for Table_Low_Bound.
3634         * table.ads: Default for Table_Low_Bound, Table_Initial, and
3635         Table_Increment.
3637 2017-04-27  Bob Duff  <duff@adacore.com>
3639         * g-dyntab.ads, g-dyntab.adb: Add assertions to subprograms that
3640         can reallocate.
3641         * atree.adb, elists.adb, fname-uf.adb, ghost.adb, inline.adb,
3642         * lib.adb, namet.adb, nlists.adb, sem.adb, sinput.adb, stringt.adb:
3643         Reorder code so that above assertions do not fail.
3644         * table.ads: Remove obsolete comment on Locked.
3646 2017-04-27  Claire Dross  <dross@adacore.com>
3648         * a-cfdlli.ads: Code cleanup.
3650 2017-04-27  Yannick Moy  <moy@adacore.com>
3652         * exp_spark.adb (Expand_SPARK_Freeze_Type): Build a DIC procedure
3653         when needed for proof.  (Expand_SPARK): Call the new procedure.
3654         * exp_util.ads Fix typo.
3656 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
3658         * a-cofuma.ads, a-cfhama.ads: Minor reformatting, grammar, and typo
3659         fixes.
3661 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3663         * sem_elab.adb Add new type Visited_Element
3664         and update the contents of table Elab_Visited.  Various code clean up.
3665         (Check_Elab_Call): Determine whether a prior call to
3666         the same subprogram was already examined within the same context.
3667         (Check_Internal_Call_Continue): Register the subprogram being
3668         called as examined within a particular context. Do not suppress
3669         elaboration warnings.
3671 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
3673         * xoscons.adb, osint.ads: Minor reformatting.
3675 2017-04-27  Bob Duff  <duff@adacore.com>
3677         * g-dyntab.ads, g-dyntab.adb: Misc cleanup. Rename
3678         Table_Count_Type --> Table_Last_Type, because the name
3679         was confusing (a "count" usually starts at zero).  Add
3680         functionality supported or needed by other tables packages
3681         (Move, Release_Threshold).
3682         * g-table.ads, g-table.adb: This is now just a thin wrapper
3683         around g-dyntab.ads/g-dyntab.adb.  Add functionality supported
3684         or needed by other tables packages (Save, Restore).
3685         * table.ads, table.adb: This is now just a thin wrapper around
3686         * g-table.ads/g-table.adb.
3687         * namet.h, scos.h, uintp.h: These files are reaching into the
3688         private data of some instances of g-table, whose names changed,
3689         so the above change requires some adjustment here. It now uses
3690         public interfaces.
3692 2017-04-27  Bob Duff  <duff@adacore.com>
3694         * namet.adb, namet.ads: Minor: remove unused procedures.
3696 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
3698         * checks.adb (Apply_Scalar_Range_Check): Initialize Ok variable too.
3699         (Minimize_Eliminate_Overflows): Initialize Llo and Lhi.
3700         Add pragma Warnings on Rtype variable in nested block.  *
3701         * exp_ch3.adb (Build_Init_Statements): Initialize VAR_LOC.
3702         * exp_ch4.adb (Expand_Concatenate): Initialize 3 variables.
3703         (Size_In_Storage_Elements): Add pragma Warnings on Res variable.
3704         * exp_ch7.adb (Build_Adjust_Statements): Initialize Bod_Stmts.
3705         (Process_Component_List_For_Finalize): Initialize Counter_Id.
3706         (Build_Finalize_Statements): Initialize Bod_Stmts.
3707         * exp_disp.adb (Expand_Dispatching_Call): Initialize SCIL_Node.
3709 2017-04-27  Claire Dross  <dross@adacore.com>
3711         * a-cfhama.adb, a-cfhamai.ads (=): Generic parameter removed to
3712         allow the use of regular equality over elements in contracts.
3713         (Formal_Model): Ghost package containing model functions that are
3714         used in subprogram contracts.
3715         (Current_To_Last): Removed, model
3716         functions should be used instead.
3717         (First_To_Previous): Removed, model functions should be used instead.
3718         (Strict_Equal): Removed, model functions should be used instead.
3719         (No_Overlap): Removed, model functions should be used instead.
3720         (Equivalent_Keys): Functions over cursors are removed. They were
3721         awkward with explicit container parameters.
3722         * a-cofuma.adb, a-cofuma.ads (Lift_Equivalent_Keys): New lemma
3723         (proof only) procedure to help GNATprove when equivalence over
3724         keys is not equality.
3726 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3728         * exp_util.adb, a-cfdlli.adb, a-cfdlli.ads, exp_ch9.adb, g-dyntab.adb,
3729         sem_dim.adb, a-cfinve.adb, a-cfinve.ads, a-cofove.adb, a-cofove.ads:
3730         Minor reformatting and code cleanups.
3732 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3734         * freeze.adb (Build_Inherited_Condition_Pragmas): New procedure,
3735         subsidiary of Check_Inherited_Conditions, to build pragmas for an
3736         operation whose ancestor has classwide pre/postconditions. This
3737         is used both to check the legality of the inheritance in Ada
3738         and in SPARK, and to determine whether a wrapper is needed for
3739         an inherited operation.
3740         * exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
3741         Improve placement of error message for inherited classwide
3742         conditions that become illegal on type derivation.
3744 2017-04-27  Yannick Moy  <moy@adacore.com>
3746         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Set
3747         SPARK_Mode from context on generic package.
3748         * sem_ch7.adb (Analyze_Package_Declaration): Simplify code to remove
3749         useless test.
3751 2017-04-27  Claire Dross  <dross@adacore.com>
3753         * a-cofuve.ads (Range_Shifted): Rewrite precondition to avoid
3754         overflows in computations.
3755         * a-cofove.ads (Capacity_Range): Rewrite last bound to avoid
3756         overflows in computations.
3757         (Insert): Rewrite precondition to avoid overflows in computations.
3758         * a-cfinve.ads (Capacity_Range): Rewrite last bound to avoid
3759         overflows in computations.
3760         (Insert): Rewrite precondition to avoid overflows in computations.
3762 2017-04-27  Steve Baird  <baird@adacore.com>
3764         * exp_ch9.adb (Expand_N_Asynchronous_Select): Initialize the Cancel
3765         flag when it is declared in order to avoid confusing CodePeer about
3766         the possibility of an uninitialized variable read.
3768 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3770         * sem_dim.adb (Analyze_Dimension_Object_Declaration): There is
3771         no dimensionality error if the subtype of the expression is
3772         identical to the nominal subtype in the declaration, even though
3773         the expression itself may have been constant-folded and lack a
3774         dimension vector.
3775         * sem_dim.ads: Add comments on setting of dimension vectors and
3776         its interaction with node rewritings and side-effect removal.
3778 2017-04-27  Bob Duff  <duff@adacore.com>
3780         * debug.adb: Minor comment correction.
3781         * sem_dim.ads: Minor reformatting and typo fixes.
3783 2017-04-27  Bob Duff  <duff@adacore.com>
3785         * g-table.adb, g-table.adsa, scos.h: From the C side, access First and
3786         Last of the tables via function calls, rather than relying on layout
3787         of data structures.
3789 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3791         * exp_util.adb: No wrapper in GNATprove mode.
3793 2017-04-27  Yannick Moy  <moy@adacore.com>
3795         * sem_res.adb (Resolve_Comparison_Op): Always
3796         evaluate comparisons between values of universal types.
3798 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3800         * sem_elab.adb (Check_Internal_Call_Continue): Do not generate
3801         an elaboration counter nor a check when in GNATprove mode.
3802         * sem_util.adb (Build_Elaboration_Entity): Do not create an
3803         elaboration counter when in GNATprove mode.
3805 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3807         * freeze.adb: copy-paste typo.
3809 2017-04-27  Yannick Moy  <moy@adacore.com>
3811         * sem_prag.adb (Analyze_Pre_Post_In_Decl_Part):
3812         Use correct test to detect call in GNATprove mode instead of
3813         compilation.
3815 2017-04-27  Claire Dross  <dross@adacore.com>
3817         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model.M_Elements_In_Union):
3818         New property function expressing that the element of a
3819         sequence are contained in the union of two sequences.
3820         (Formal_Model.M_Elements_Included): New property function
3821         expressing that the element of a sequence are another sequence.
3822         (Generic_Sorting): Use new property functions to state that
3823         elements are preserved by Sort and Merge.
3824         * a-cofove.adb, a-cofove.ads (=): Generic parameter removed to
3825         allow the use of regular equality over elements in contracts.
3826         (Formal_Model): Ghost package containing model functions
3827         that are used in subprogram contracts.  (Capacity):
3828         On unbounded containers, return the maximal capacity.
3829         (Current_To_Last): Removed, model functions should be used instead.
3830         (First_To_Previous): Removed, model functions should be used instead.
3831         (Append): Default parameter value replaced
3832         by new wrapper to allow more precise contracts.
3833         (Insert): Subprogram restored, it seems it was useful to users even if
3834         it is inefficient.
3835         (Delete): Subprogram restored, it seems it was useful to users even if
3836         it is inefficient.
3837         (Prepend): Subprogram restored, it seems it was useful to users even
3838         if it is inefficient.
3839         (Delete_First): Subprogram restored, it seems it
3840         was useful to users even if it is inefficient.  (Delete_Last):
3841         Default parameter value replaced by new wrapper to allow more
3842         precise contracts.
3843         (Generic_Sorting.Merge): Subprogram restored.
3844         * a-cfinve.adb, a-cfinve.ads (=): Generic parameter removed to
3845         allow the use of regular equality over elements in contracts.
3846         (Formal_Model): Ghost package containing model functions
3847         that are used in subprogram contracts.  (Capacity):
3848         On unbounded containers, return the maximal capacity.
3849         (Current_To_Last): Removed, model functions should be used
3850         instead.
3851         (First_To_Previous): Removed, model functions should be used instead.
3852         (Append): Default parameter value replaced
3853         by new wrapper to allow more precise contracts.
3854         (Insert): Subprogram restored, it seems it was useful to users even if
3855         it is inefficient.
3856         (Delete): Subprogram restored, it seems it was useful to users even if
3857         it is inefficient.
3858         (Prepend): Subprogram restored, it seems it was useful to users even
3859         if it is inefficient.
3860         (Delete_First): Subprogram restored, it seems it
3861         was useful to users even if it is inefficient.  (Delete_Last):
3862         Default parameter value replaced by new wrapper to allow more
3863         precise contracts.
3864         (Generic_Sorting.Merge): Subprogram restored.
3865         (Vector): Do not reuse formal vectors, as it is no longer possible
3866         to supply them with an equality function over elements.
3868 2017-04-27  Bob Duff  <duff@adacore.com>
3870         * g-dyntab.adb (Release): When allocating the new
3871         table, use the correct slice of the old table to initialize it.
3873 2017-04-27  Eric Botcazou  <ebotcazou@adacore.com>
3875         * einfo.ads: Minor fixes in comments.
3877 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3879         * sem_prag.adb: disable clones in SPARK_Mode.
3881 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
3883         * sem_util.ads, contracts.adb: Minor reformatting.
3885 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3887         * sem_util.adb, sem_util.ads (Build_Class_Wide_Clone_Body):
3888         Build body of subprogram that has a class-wide condition that
3889         contains calls to other primitives.
3890         (Build_Class_Wide_Clone_Call); Build a call to the common
3891         class-wide clone of a subprogram with classwide conditions. The
3892         body of the subprogram becomes a wrapper for a call to the
3893         clone. The inherited operation becomes a similar wrapper to which
3894         modified conditions apply, and the call to the clone includes
3895         the proper conversion in a call the parent operation.
3896         (Build_Class_Wide_Clone_Decl (Spec_Id : Entity_Id): For a
3897         subprogram that has a classwide condition that contains calls to
3898         other primitives, build an internal subprogram that is invoked
3899         through a type-specific wrapper for all inherited subprograms
3900         that may have a modified condition.
3901         * sem_prag.adb (Check_References): If subprogram has a classwide
3902         condition, create entity for corresponding clone, to be invoked
3903         through wrapper subprograns.
3904         (Analyze_Pre_Post_Condition_In_Decl_Part): Do not emit error
3905         message about placement if pragma isi internally generated.
3906         * sem_ch6.adb (Analyze_Subprogram_Body_Helper): If subprogram has
3907         a classwide clone, build body of clone as copy of original body,
3908         and rewrite original body as a wrapper as a wrapper for a call to
3909         the clone, so that it incorporates the original pre/postconditions
3910         of the subprogram.
3911         * freeze.adb (Check_Inherited_Conditions): For an inherited
3912         subprogram that inherits a classwide condition, build spec and
3913         body of corresponding wrapper so that call to inherited operation
3914         gets the modified conditions.
3915         * contracts.adb (Analyze_Contracts): If analysis of classwide
3916         condition has created a clone for a primitive operation, analyze
3917         declaration of clone.
3919 2017-04-27  Steve Baird  <baird@adacore.com>
3921         * exp_util.adb (Build_Allocate_Deallocate_Proc):
3922         Add "Suppress => All_Checks" to avoid generating unnecessary
3923         checks.
3925 2017-04-27  Yannick Moy  <moy@adacore.com>
3927         * debug.adb: Reserve debug flag 'm' for no inlining in GNATprove.
3928         * sem_ch6.adb (Anayze_Subprogram_Body_Helper): Skip creation of
3929         inlining body in GNATprove mode when switch -gnatdm used.
3930         * sem_res.adb (Resolve_Call): Skip detection of lack of inlining
3931         in GNATprove mode when switch -gnatdm used.
3933 2017-04-27  Arnaud Charlet  <charlet@adacore.com>
3935         * sem_ch13.adb (Analyze_Attribute_Definition_Clause
3936         [Attribute_Address]): Call Set_Address_Taken when ignoring rep
3937         clauses, so that we keep an indication of the address clause
3938         before removing it from the tree.
3940 2017-04-27  Yannick Moy  <moy@adacore.com>
3942         * exp_util.ads, exp_util.adb (Evaluate_Name): Force evaluation
3943         of expression being qualified, when not an object name, or else
3944         evaluate the underlying name.
3946 2017-04-27  Jerome Lambourg  <lambourg@adacore.com>
3948         * bindusg.adb, bindgen.adb, gnatbind.adb, opt.ads: add -nognarl switch.
3950 2017-04-27  Justin Squirek  <squirek@adacore.com>
3952         * exp_ch7.adb (Build_Finalize_Statements): Move Num_Comps to
3953         Process_Component_List_For_Finalization as a local variable.
3954         (Process_Component_For_Finalize): Add an extra parameter to avoid
3955         global references.
3956         (Process_Component_List_For_Finalization): Correct calls to
3957         Process_Component_For_Finalize to take Num_Comps as a parameter.
3959 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3961         * sem_ch8.adb (Find_Direct_Name): Account for the case where
3962         a use-visible entity is defined within a nested scope of an
3963         instance when giving priority to entities which were visible in
3964         the original generic.
3965         * sem_util.ads, sem_util.adb (Nearest_Enclosing_Instance): New routine.
3967 2017-04-27  Tristan Gingold  <gingold@adacore.com>
3969         * raise-gcc.c: Don't use unwind.h while compiling
3970         for the frontend, but mimic host behavior.
3972 2017-04-27  Javier Miranda  <miranda@adacore.com>
3974         * sem_ch3.adb (Build_Discriminated_Subtype):
3975         Propagate Has_Pragma_Unreferenced_Objects to the built subtype.
3977 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3979         * sem_prag.adb (Analyze_Global_Item):
3980         Do not consider discriminants because they are not "entire
3981         objects". Remove the discriminant-related checks because they are
3982         obsolete.
3983         (Analyze_Input_Output): Do not consider discriminants
3984         because they are not "entire objects".
3986 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
3988         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Do not
3989         perform check if the current scope does not come from source,
3990         as is the case for a rewritten task body, because check has
3991         been performed already, and may not be doable because of changed
3992         visibility.
3994 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
3996         * a-cofuse.adb, a-cfdlli.adb, a-cofuse.ads, a-cfdlli.ads, a-cofuve.adb,
3997         a-cofuve.ads, a-cofuma.adb, a-cofuma.ads, sem_eval.adb, a-cofuba.adb:
3998         Minor reformatting.
4000 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4002         * sem_ch4.adb (Analyze_Call): If the return type of a function
4003         is incomplete in an context in which the full view is available,
4004         replace the type of the call by the full view, to prevent spurious
4005         type errors.
4006         * exp_disp.adb (Check_Premature_Freezing): Disable check on an
4007         abstract subprogram so that compiler does not reject a parameter
4008         of a primitive operation of a tagged type being frozen, when
4009         the untagged type of that parameter cannot be frozen.
4011 2017-04-27  Bob Duff  <duff@adacore.com>
4013         * sem_attr.adb (Compute_Type_Key): Don't walk
4014         representation items for irrelevant types, which could be in a
4015         different source file.
4017 2017-04-27  Steve Baird  <baird@adacore.com>
4019         * exp_attr.adb (Expand_N_Attribute_Reference):
4020         Don't expand Image, Wide_Image, Wide_Wide_Image attributes
4021         for CodePeer.
4023 2017-04-27  Yannick Moy  <moy@adacore.com>
4025         * exp_unst.ads: Fix typos in comments.
4027 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4029         * sem_eval.adb (Choice_Matches): Handle properly a real literal
4030         whose type has a defined static predicate.
4032 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4034         * exp_ch4.adb (Insert_Dereference_Action):
4035         Do not adjust the address of a controlled object when the
4036         associated access type is subject to pragma No_Heap_Finalization.
4037         Code reformatting.
4039 2017-04-27  Pierre-Marie de Rodat  <derodat@adacore.com>
4041         * gcc-interface/utils.c (gnat_type_for_size): Set
4042         TYPE_ARTIFICIAL on created types.
4044 2017-04-27  Claire Dross  <dross@adacore.com>
4046         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
4047         modifications in functional containers.
4048         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
4049         to improve readablity. Subprograms are separated between basic
4050         operations, constructors and properties. Universally quantified
4051         formulas in contracts are factorized in independant functions
4052         with a name and a comment.  Names of parameters are improved.
4054 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
4056         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
4058 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4060         * sem_res.adb (Resolve_Type_Conversion): Do not
4061         install a predicate check here since this is already done during
4062         the expansion phase. Verify whether the operand satisfies the
4063         static predicate (if any) of the target type.
4064         * sem_ch3.adb (Analyze_Object_Declaration): Do
4065         not install a predicate check if the object is initialized by
4066         means of a type conversion because the conversion is subjected
4067         to the same check.
4069 2017-04-27  Tristan Gingold  <gingold@adacore.com>
4071         * raise.c (__gnat_builtin_longjmp): Remove.
4072         (__gnat_bracktrace):
4073         Add a dummy definition for the compiler (__gnat_eh_personality,
4074         __gnat_rcheck_04, __gnat_rcheck_10) (__gnat_rcheck_19,
4075         __gnat_rcheck_20, __gnat_rcheck_21) (__gnat_rcheck_30,
4076         __gnat_rcheck_31, __gnat_rcheck_32): Likewise.
4077         * a-exexpr.adb: Renamed from a-exexpr-gcc.adb
4078         * a-except.ads, a-except.adb: Renamed from a-except-2005.ads
4079         and a-except-2005.adb.
4080         * raise-gcc.c: Allow build in compiler, compiled as a C++
4081         file.
4082         (__gnat_Unwind_ForcedUnwind): Adjust prototype.
4083         (db): Constify msg_format.
4084         (get_call_site_action_for): Don't use void arithmetic.
4085         * system.ads (Frontend_Exceptions): Set to False.
4086         (ZCX_By_Default): Set to True.
4087         (GCC_ZC_Support): Set to True.
4088         * gcc-interface/Makefile.in: No more variants for a-exexpr.adb and
4089         a-except.ad[sb].
4090         * gcc-interface/Make-lang.in: Add support for backend zcx exceptions
4091         in gnat1 and gnatbind.
4092         * gnat1, gnatbind: link with raise-gcc.o, a-exctra.o, s-addima.o,
4093         s-excmac.o, s-imgint.o, s-traceb.o, s-trasym.o, s-wchstw.o
4094         * s-excmac.ads, s-excmac.adb: Copy of variants.
4095         * a-except.o: Adjust preequisites.
4096         Add handling of s-excmac-arm.adb and s-excmac-gcc.adb.
4098 2017-04-27  Claire Dross  <dross@adacore.com>
4100         * a-cfdlli.adb, a-cfdlli.ads (Formal_Model): Adapt to
4101         modifications in functional containers.
4102         * a-cofuba.ads, a-cofuma.ads, a-cofuse.ads, a-cofuve.ads Reformat
4103         to improve readablity. Subprograms are separated between basic
4104         operations, constructors and properties. Universally quantified
4105         formulas in contracts are factorized in independant functions
4106         with a name and a comment.  Names of parameters are improved.
4108 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
4110         * exp_spark.adb, sem_elab.adb: Minor reformatting and typo fix.
4112 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4114         * sem_res.adb (Resolve_Type_Conversion): Do not
4115         install a predicate check here since this is already done during
4116         the expansion phase. Verify whether the operand satisfies the
4117         static predicate (if any) of the target type.
4118         * sem_ch3.adb (Analyze_Object_Declaration): Do
4119         not install a predicate check if the object is initialized by
4120         means of a type conversion because the conversion is subjected
4121         to the same check.
4123 2017-04-27  Tristan Gingold  <gingold@adacore.com>
4125         * a-except.ads, a-except.adb, a-exexpr.adb: Removed (will be
4126         replaced by their variants).
4128 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4130         * exp_prag.adb, a-cofuse.adb, a-cofuse.ads, einfo.adb, sem_prag.adb,
4131         cstand.adb, par-prag.adb, a-cofuve.adb, a-cofuve.ads, a-cofuma.adb,
4132         a-cofuma.ads, a-cofuba.adb, a-cofuba.ads: Minor reformatting.
4134 2017-04-27  Tristan Gingold  <gingold@adacore.com>
4136         * s-excmac-gcc.ads, s-excmac-gcc.adb,
4137         s-excmac-arm.ads, s-excmac-arm.adb (New_Occurrence): Rewrite it in
4138         Ada95.
4140 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4142         * exp_ch7.adb (Establish_Transient_Scope): Rewrite
4143         the loop which detects potential enclosing transient scopes. The
4144         loop now terminates much earlier as transient scopes are bounded
4145         by packages and subprograms.
4147 2017-04-27  Claire Dross  <dross@adacore.com>
4149         * a-cfdlli.adb, a-cfdlli.ads (=): Generic parameter removed to
4150         allow the use of regular equality over elements in contracts.
4151         (Cursor): Type is now public so that it can be used in
4152         model functions.
4153         (Formal_Model): Ghost package containing
4154         model functions that are used in subprogram contracts.
4155         (Current_To_Last): Removed, model functions should be used
4156         instead.
4157         (First_To_Previous): Removed, model functions should
4158         be used instead.
4159         (Strict_Equal): Removed, model functions
4160         should be used instead.
4161         (Append): Default parameter value
4162         replaced by new wrapper to allow more precise contracts.
4163         (Insert): Default parameter value replaced by new wrapper to
4164         allow more precise contracts.
4165         (Delete): Default parameter
4166         value replaced by new wrapper to allow more precise contracts.
4167         (Prepend): Default parameter value replaced by new wrapper to
4168         allow more precise contracts.
4169         (Delete_First): Default parameter
4170         value replaced by new wrapper to allow more precise contracts.
4171         (Delete_Last): Default parameter value replaced by new wrapper
4172         to allow more precise contracts.
4174 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4176         * exp_spark.adb (Expand_SPARK): Perform specialized expansion
4177         for object declarations.
4178         (Expand_SPARK_N_Object_Declaration): New routine.
4179         * sem_elab.adb (Check_A_Call): Include calls to the
4180         Default_Initial_Condition procedure of a type under the SPARK
4181         elaboration checks umbrella.
4183 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4185         * sem.adb (Analyze): Diagnose an illegal iterated component
4186         association.
4187         * sem_util.ads, sem_util.adb
4188         (Diagnose_Iterated_Component_Association): New routine.
4190 2017-04-27  Bob Duff  <duff@adacore.com>
4192         * adaint.c (__gnat_get_current_dir): Return 0 in length if
4193         getcwd fails.
4194         * a-direct.adb, g-dirope.adb, osint.adb, s-os_lib.adb: Raise
4195         exception if getcwd failed.
4197 2017-04-27  Yannick Moy  <moy@adacore.com>
4199         * exp_dbug.adb, exp_dbug.ads (Get_External_Name): Prefix ghost
4200         entities with special prefix.
4202 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4204         * debug.adb Change the documentation of switch -gnatd.s.
4205         * exp_ch7.adb (Make_Transient_Block): Transient blocks do not need
4206         to manage the secondary stack when an enclosing scope already
4207         performs this functionality (aka relaxed management). Switch
4208         -gnatd.s may be used to force strict management in which case
4209         the block will manage the secondary stack unconditionally. Add
4210         a guard to stop the traversal when encountering a package or a
4211         subprogram scope.
4213 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4215         * sem_res.adb (Resolve_Call): Refine further the handling of
4216         limited views of return types in function calls. If the function
4217         that returns a limited view appears in the current unit,
4218         we do not replace its type by the non-limited view because
4219         this transformation is performed int the back-end. However,
4220         the type of the call itself must be the non-limited view, to
4221         prevent spurious resolution errors.
4223 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4225         * einfo,ads, einfo.adb (Class_Wide_Preconds, Class_Wide_Postconds):
4226         Removed, proposed implementation using generics for class-wide
4227         preconditions proved impractical.
4228         (Class_Wide_Clone): New attribute of subprogram. Designates
4229         subprogram created for primitive operations with class-wide
4230         pre/postconditions that contain calls to other primitives. The
4231         clone holds the body of the original primitive, but the
4232         pre/postonditions do not apply to it. The original body is
4233         rewritten as a wrapper for a call to the clone.
4234         (Is_Class_Wide_Clone): New flag to identify a Class_Wide_Clone. If
4235         the flag is set, no code for the corresponding pre/postconditions
4236         is inserted into its body.
4238 2017-04-27  Bob Duff  <duff@adacore.com>
4240         * exp_prag.adb, par-prag.adb, sem_ch13.adb: Ignore
4241         Scalar_Storage_Order if -gnatI is given.
4242         * sem_prag.adb (Analyze_Pragma): Ignore
4243         Default_Scalar_Storage_Order if -gnatI is given.
4245 2017-04-27  Claire Dross  <dross@adacore.com>
4247         * a-cofuba.ads (Add): Take as an additional input parameter
4248         the position where the element should be inserted.
4249         (Remove): New function that removes an element from the container.
4250         * a-cofuma.ads (Add): Adapt to the new API of Base.Add.
4251         * a-cofuse.ads (Add): Adapt to the new API of Base.Add.
4252         (Remove): New function that removes an element from a set.
4253         * a-cofuve.ads (Add): Adapt to the new API of Base.Add.
4254         (Remove): New function that removes an element from a sequence.
4255         (Insert): New function that adds anywhere in a sequence.
4257 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4259         * checks.adb (Generate_Range_Check): Revert previous change.
4261 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
4263         * sem_util.adb: Minor reformatting/rewording.
4265 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4267         * lib-xref.adb (Generate_Reference): The use
4268         of attribute 'Result is not considered a violation of pragma
4269         Unreferenced.
4271 2017-04-27  Justin Squirek  <squirek@adacore.com>
4273         * cstand.adb (Create_Standard): Correctly set
4274         Directly_Designated_Type for Any_Access.
4275         * sem_type.adb (Covers): Minor grammar fixes.
4277 2017-04-27  Bob Duff  <duff@adacore.com>
4279         * sem_attr.adb: Minor cleanup.
4281 2017-04-27  Claire Dross  <dross@adacore.com>
4283         * a-cofuba.ads, a-cofuba.adb (Ada.Containers.Functional_Base): New
4284         private child of Ada.Containers used to implement all functional
4285         containers.
4286         * a-cofuma.ads, a-cofuma.adb (Ada.Containers.Functional_Maps): New
4287         child of Ada.Containers. It provides functional indefinite unbounded
4288         maps which can be used as high level models for specification
4289         of data structures.
4290         * a-cofuse.ads, a-cofuse.adb (Ada.Containers.Functional_Sets): New
4291         child of Ada.Containers. It provides functional indefinite unbounded
4292         sets which can be used as high level models for specification
4293         of data structures.
4294         * a-cofuve.ads, a-cofuve.adb (Ada.Containers.Functional_Vectors): New
4295         child of Ada.Containers.  It provides functional indefinite unbounded
4296         vectors which can be used as high level models for specification
4297         of data structures.
4298         * Makefile.rtl: Add new packages.
4299         * impunit.adb: Add new packages.
4301 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
4303         * sem_ch4.adb: Minor reformatting.
4305 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4307         * sem_ch12.adb (Analyze_Associations): minor reformatting.
4308         (Check_Fixed_Point_Actual): Do not emit a warning on a fixed
4309         point type actual that has user-defined arithmetic primitives,
4310         when there is a previous actual for a formal package that defines
4311         a fixed-point type with the parent user-defined operator.
4313 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4315         * checks.adb (Generate_Range_Check): Reinstate part of previous change.
4316         * sem_attr.adb (Resolve_Attribute): Generate a range check when
4317         the component type allows range checks.
4319 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4321         * sem_aux.adb (Is_Generic_Formal): Use original node to locate
4322         corresponding declaration, because formal derived types are
4323         rewritten as private extensions.
4325 2017-04-27  Ed Schonberg  <schonberg@adacore.com>
4327         * sem_dim.adb (Analyze_Dimension_Binary_Op): Do not check
4328         dimensions of operands if node has been analyzed already, because
4329         previous analysis and dimension checking will have removed the
4330         dimension information from the operands.
4332 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4334         * debug.adb: Document the use of switch -gnatd.s.
4335         * einfo.ads Update the documentation on attribute
4336         Sec_Stack_Needed_For_Return and attribute Uses_Sec_Stack. Remove
4337         the uses of these attributes from certain entities.
4338         * exp_ch7.adb (Make_Transient_Block): Reimplement the circuitry
4339         which determines whether the block should continue to manage
4340         the secondary stack.
4341         (Manages_Sec_Stack): New routine.
4343 2017-04-27  Bob Duff  <duff@adacore.com>
4345         * atree.ads: Minor edit.
4347 2017-04-27  Hristian Kirtchev  <kirtchev@adacore.com>
4349         * sinfo.ads: Update the section on Ghost mode. Add
4350         a section on SPARK mode. Update the placement of section on
4351         expression functions.
4353 2017-04-27  Bob Duff  <duff@adacore.com>
4355         * sinput.adb (Get_Source_File_Index): Don't
4356         assert that S is in the right range in the case where this is
4357         a .dg file under construction.
4359 2017-04-27  Yannick Moy  <moy@adacore.com>
4361         * sem_util.adb (Check_Result_And_Post_State):
4362         Handle more precisely each conjunct in expressions formed by
4363         and'ing sub-expressions.
4365 2017-04-27  Gary Dismukes  <dismukes@adacore.com>
4367         * exp_ch4.adb, sem_ch4.adb: Minor typo fix and reformatting.
4369 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4371         * gnat_rm.texi, gnat_ugn.texi,
4372         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
4373         doc/gnat_ugn/platform_specific_information.rst,
4374         doc/gnat_ugn/gnat_and_program_execution.rst,
4375         doc/gnat_ugn/gnat_utility_programs.rst,
4376         doc/gnat_ugn/the_gnat_compilation_model.rst,
4377         doc/gnat_rm/implementation_defined_attributes.rst,
4378         doc/gnat_rm/the_gnat_library.rst,
4379         doc/gnat_rm/implementation_defined_pragmas.rst,
4380         doc/gnat_rm/representation_clauses_and_pragmas.rst,
4381         doc/gnat_rm/implementation_of_specific_ada_features.rst,
4382         doc/gnat_rm/implementation_defined_aspects.rst,
4383         doc/gnat_rm/implementation_defined_characteristics.rst: Update
4384         documentation.
4386 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4388         * exp_ch4.adb (Expand_N_Case_Expression): Emit error message when
4389         generating C code on complex case expressions.
4391 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4393         * sem_prag.adb (Analyze_Pragma): Generate a warning instead
4394         of silently ignoring pragma Ada_xxx in Latest_Ada_Only mode.
4395         * directio.ads, ioexcept.ads, sequenio.ads, text_io.ads: Use
4396         Ada_2012 instead of Ada_2005 to be compatible with the above
4397         change.
4398         * bindgen.adb: Silence new warning on pragma Ada_95.
4400 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4402         * checks.adb (Generate_Range_Check): Revert part of previous change.
4404 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4406         * sem_ch4.adb (Try_Container_Indexing): Handle properly a
4407         container indexing operation that appears as a an actual in a
4408         parameter association in a procedure call.
4410 2017-04-25  Olivier Ramonat  <ramonat@adacore.com>
4412         * prj-proc.adb, sem_util.adb, s-stposu.adb, sem_attr.adb, prj-conf.ads:
4413         Fix spelling mistakes.
4415 2017-04-25  Bob Duff  <duff@adacore.com>
4417         * types.ads, osint.adb, sinput-c.adb, sinput-d.adb, sinput-l.adb,
4418         * sinput-p.adb: Use regular fat pointers, with bounds checking,
4419         for source buffers.  Fix misc obscure bugs.
4420         * sinput.ads, sinput.adb: Use regular fat pointers, with bounds
4421         checking, for source buffers.  Modify representation clause for
4422         Source_File_Record as appropriate.  Move Source_File_Index_Table
4423         from spec to body, because it is not used outside the body.
4424         Move Set_Source_File_Index_Table into the private part, because
4425         it is used only in the body and in children.  Use trickery to
4426         modify the dope in the generic instantiation case.  It's ugly,
4427         but not as ugly as the previous method.  Fix documentation.
4428         Remove obsolete code.
4429         * fname-sf.adb, targparm.adb: Fix misc out-of-bounds
4430         indexing in source buffers.
4431         * fmap.adb: Avoid conversions from one string type to another.
4432         Remove a use of global name buffer.
4433         * osint.ads, sfn_scan.ads, sfn_scan.adb, sinput-c.ads: Comment
4434         fixes.
4436 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4438         * exp_util.adb, exp_ch4.adb: Minor reformatting.
4440 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4442         * checks.adb: Code clean up in various routines.
4443         (Generate_Range_Check): Do not generate a range check when the
4444         expander is not active or when index/range checks are suppressed
4445         on the target type.
4446         (Insert_List_After_And_Analyze, Insert_List_Before_And_Analyze):
4447         Remove variants that include a Supress parameter. These routines
4448         are never used, and were introduced before the current scope-based
4449         check suppression method.
4451 2017-04-25  Vasiliy Fofanov  <fofanov@adacore.com>
4453         * prj-part.adb, cstreams.c, osint.adb, osint.ads: Remove VMS specific
4454         code and some subprogram calls that are now noop.
4456 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4458         * exp_ch4.adb (Expand_N_Case_Expression): Take
4459         Minimize_Expression_With_Actions into account when possible.
4461 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4463         * exp_util.adb (Known_Non_Null): Moved to Sem_Util.
4464         (Known_Null): Moved to Sem_Util.
4465         * exp_util.ads (Known_Non_Null): Moved to Sem_Util.
4466         (Known_Null): Moved to Sem_Util.
4467         * sem_util.adb Add new enumeration type Null_Status_Kind.
4468         (Known_Non_Null): Moved from Exp_Util. Most of the logic in
4469         this routine is now carried out by Null_Status.
4470         (Known_Null): Moved from Exp_Util. Most of the logic in this routine
4471         is now carried out by Null_Status.
4472         (Null_Status): New routine.
4473         * sem_util.ads (Known_Non_Null): Moved from Exp_Util.
4474         (Known_Null): Moved from Exp_Util.
4476 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4478         * sem_ch6.adb (Analyze_Expression_Function): Do not report an
4479         error on the return type of an expression function that is a
4480         completion, if the type is derived from a generic formal type.
4482 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4484         * sem_dim.adb (Dimensions_Of_Operand): The dimensions of a type
4485         conversion are those of the target type.
4487 2017-04-25  Bob Duff  <duff@adacore.com>
4489         * a-clrefi.adb: Minor cleanup.
4491 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4493         * exp_util.adb, exp_util.ads, types.ads: Minor reformatting.
4495 2017-04-25  Bob Duff  <duff@adacore.com>
4497         * err_vars.ads, fmap.adb, fmap.ads, comperr.adb, fname-sf.adb,
4498         types.adb, types.ads, types.h, sinput-l.adb, targparm.adb,
4499         errout.adb, sinput.adb, sinput.ads, cstand.adb, scn.adb,
4500         scn.ads, gnatls.adb: Eliminate the vestigial Internal_Source_File and
4501         the Internal_Source buffer. This removes the incorrect call to "="
4502         the customer noticed.
4503         Wrap remaining calls to "=" in Null_Source_Buffer_Ptr. We
4504         eventually need to eliminate them altogether. Or else get rid
4505         of zero-origin addressing.
4507 2017-04-25  Claire Dross  <dross@adacore.com>
4509         * exp_util.ads (Expression_Contains_Primitives_Calls_Of): New
4510         function used in GNATprove to know if an expression contains
4511         non-dispatching calls on primitives of a tagged type.
4513 2017-04-25  Bob Duff  <duff@adacore.com>
4515         * rtsfind.adb (Initialize): Initialize
4516         First_Implicit_With. Building the compiler with Normalize_Scalars
4517         and validity checking finds this being used as an uninitialized
4518         variable.
4520 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4522         * contracts.adb (Analyze_Entry_Or_Subprogram_Body_Contract):
4523         Add a warning about SPARK mode management. The routine now
4524         saves and restores both the mode and associated pragma.
4525         (Analyze_Entry_Or_Subprogram_Contract): Add a warning about
4526         SPARK mode management. The routine now saves and restores both
4527         the mode and associated pragma.
4528         (Analyze_Object_Contract):
4529         Add a warning about SPARK mode management. The routine
4530         now saves and restores both the mode and associated pragma.
4531         (Analyze_Package_Body_Contract): Add a warning about SPARK mode
4532         management.  The routine now saves and restores both the mode
4533         and associated pragma.  (Analyze_Package_Contract): Add a warning
4534         about SPARK mode management. The routine now saves and restores
4535         both the mode and associated pragma.
4536         (Analyze_Task_Contract):
4537         Add a warning about SPARK mode management. The routine now saves
4538         and restores both the mode and associated pragma.
4539         * expander.adb (Expand): Change the way the Ghost mode is saved
4540         and restored.
4541         * exp_ch3.adb (Freeze_Type): Change the way the Ghost mode is
4542         saved and restored.
4543         * exp_disp.adb (Make_DT): Change the way the Ghost mode is saved
4544         and restored.
4545         * exp_util.adb (Build_DIC_Procedure_Body):
4546         Change the way the Ghost mode is saved and restored.
4547         (Build_DIC_Procedure_Declaration): Change the way the Ghost
4548         mode is saved and restored.
4549         (Build_Invariant_Procedure_Body):
4550         Change the way the Ghost mode is saved and restored.
4551         (Build_Invariant_Procedure_Declaration): Change the way the Ghost
4552         mode is saved and restored.
4553         (Make_Predicate_Call): Change the
4554         way the Ghost mode is saved and restored.
4555         * freeze.adb (Freeze_Entity): Change the way the Ghost mode is
4556         saved and restored.
4557         * ghost.adb (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4558         and its assignment.
4559         (Mark_And_Set_Ghost_Body): Remove parameter
4560         Mode and its assignment.
4561         (Mark_And_Set_Ghost_Completion):
4562         Remove parameter Mode and its assignment.
4563         (Mark_And_Set_Ghost_Declaration): Remove parameter Mode and its
4564         assignment.
4565         (Mark_And_Set_Ghost_Instantiation): Remove parameter
4566         Mode and its assignment.
4567         (Mark_And_Set_Ghost_Procedure_Call):
4568         Remove parameter Mode and its assignment.
4569         (Set_Ghost_Mode):
4570         Remove parameter Mode and its assignment.
4571         * ghost.ads (Mark_And_Set_Ghost_Assignment): Remove parameter Mode
4572         and update the comment on usage.
4573         (Mark_And_Set_Ghost_Body):
4574         Remove parameter Mode and update the comment on usage.
4575         (Mark_And_Set_Ghost_Completion): Remove parameter Mode and
4576         update the comment on usage.
4577         (Mark_And_Set_Ghost_Declaration):
4578         Remove parameter Mode and update the comment on usage.
4579         (Mark_And_Set_Ghost_Instantiation): Remove parameter Mode and
4580         update the comment on usage.
4581         (Mark_And_Set_Ghost_Procedure_Call):
4582         Remove parameter Mode and update the comment on usage.
4583         (Set_Ghost_Mode): Remove parameter Mode and update the comment
4584         on usage.
4585         * lib.ads Remove obsolete fields SPARK_Mode_Pragma from various
4586         types.
4587         * lib-load.adb (Create_Dummy_Package_Unit): Remove the assignment
4588         of obsolete field SPARK_Mode_Pragma.
4589         (Load_Main_Source): Remove
4590         the assignment of obsolete field SPARK_Mode_Pragma.
4591         (Load_Unit): Remove the assignment of obsolete field SPARK_Mode_Pragma.
4592         * lib-writ.adb (Add_Preprocessing_Dependency): Remove
4593         the assignment of obsolete field SPARK_Mode_Pragma.
4594         (Ensure_System_Dependency): Remove the assignment of obsolete
4595         field SPARK_Mode_Pragma.
4596         * rtsfind.adb (Load_RTU): Add a warning about Ghost and SPARK
4597         mode management. Change the way Ghost and SPARK modes are saved
4598         and restored.
4599         * sem.adb (Analyze): Change the way the Ghost mode is saved
4600         and restored.
4601         * sem_ch3.adb (Analyze_Object_Declaration): Change the way the
4602         Ghost mode is saved and restored.
4603         (Process_Full_View): Change
4604         the way the Ghost mode is saved and restored.
4605         * sem_ch5.adb (Analyze_Assignment): Change the way the Ghost
4606         mode is saved and restored.
4607         * sem_ch6.adb (Analyze_Procedure_Call): Change the way the Ghost
4608         mode is saved and restored.
4609         (Analyze_Subprogram_Body_Helper):
4610         Change the way the Ghost mode is saved and restored.
4611         * sem_ch7.adb (Analyze_Package_Body_Helper): Change the way the
4612         Ghost mode is saved and restored.
4613         * sem_ch10.adb (Analyze_Subunit): Add a warning about SPARK mode
4614         management. Save the SPARK mode-related data prior to any changes
4615         to the scope stack and contexts. The mode is then reinstalled
4616         before the subunit is analyzed in order to restore the original
4617         view of the subunit.
4618         * sem_ch12.adb (Analyze_Package_Instantiation): Update the
4619         warning on region management.  Change the way the Ghost and
4620         SPARK modes are saved and restored.
4621         (Inline_Instance_Body):
4622         Add a warning about SPARK mode management. Code clean up.
4623         (Analyze_Subprogram_Instantiation): Update the warning on region
4624         management.  Change the way the Ghost and SPARK modes are saved
4625         and restored.
4626         (Instantiate_Package_Body): Update the warning
4627         on region management. Change the way the Ghost and SPARK modes
4628         are saved and restored.
4629         (Instantiate_Subprogram_Body): Update
4630         the warning on region management. Change the way the Ghost and
4631         SPARK modes are saved and restored.
4632         (Set_Instance_Env): Add a
4633         warning about SPARK mode management. Change the way SPARK mode
4634         is saved and restored.
4635         * sem_ch13.adb (Build_Predicate_Functions):
4636         Change the way the Ghost mode is saved and restored.
4637         (Build_Predicate_Function_Declaration): Change the way the Ghost
4638         mode is saved and restored.
4639         * sem_elab.adb (Check_Elab_Calls): Add a warning about SPARK
4640         mode management. Change the way SPARK mode is saved and restored.
4641         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
4642         Change the way the Ghost mode is saved and restored.
4643         (Analyze_Initial_Condition_In_Decl_Part): Change the way
4644         the Ghost mode is saved and restored.
4645         (Analyze_Pragma):
4646         Change the way the Ghost mode is saved and restored.
4647         (Analyze_Pre_Post_Condition_In_Decl_Part): Change the way the
4648         Ghost mode is saved and restored.
4649         * sem_util.adb (Install_SPARK_Mode): New routine.
4650         (Restore_SPARK_Mode): New routine.
4651         (Save_SPARK_Mode_And_Set): Removed.
4652         (Set_SPARK_Mode): New routine.
4653         * sem_util.ads (Install_SPARK_Mode): New routine.
4654         (Restore_SPARK_Mode): New routine.
4655         (Save_SPARK_Mode_And_Set): Removed.
4656         (Set_SPARK_Mode): New routine.
4658 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4660         * sem_util.adb, sem_util.ads (From_Nested_Package): New predicate
4661         to determine whether a type is declared in a local package that
4662         has not yet been frozen.
4663         * freeze.adb (Freeze_Before): Use new predicate to determine
4664         whether a local package must be installed on the scope stack
4665         in order to evaluate in the proper scope actions generated by
4666         aspect specifications, such as Predicate
4667         * sem_ch13.adb: Simplify code in Analyze_Aspects_At_Freeze_Point
4668         using new predicate.
4670 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4672         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not consider
4673         comparisons between non- scalar expressions expressions because
4674         their values cannot be invalidated.
4675         * sem_warn.ads (Warn_On_Constant_Valid_Condition): Update the
4676         comment on usage.
4678 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4680         * par_sco.adb: Minor reformatting.
4682 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4684         * sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): If entity
4685         is a type from an unfrozen local package, install package to
4686         complete the analysis of delayed aspects of the type.
4688 2017-04-25  Tristan Gingold  <gingold@adacore.com>
4690         * bingen.adb (System_Version_Control_Used): New variable.
4691         (Resolve_Binder_Options): Set the above variable.
4692         (Gen_Output_File_Ada): Conditionally call Gen_Versions.
4693         (Gen_Elab_Order): Emit blank line before.
4695 2017-04-25  Justin Squirek  <squirek@adacore.com>
4697         * sem_cat.adb (Validate_RT_RAT_Component): Added
4698         an extra check to ignore incomplete types.
4700 2017-04-25  Thomas Quinot  <quinot@adacore.com>
4702         * sem_prag.adb (Analyze_Pragma, case Pragma_Check): Remove
4703         bogus circuitry for the case where Name is Predicate.
4705 2017-04-25  Thomas Quinot  <quinot@adacore.com>
4707         * par_sco.adb(Traverse_Declarations_Or_Statements.Traverse_Aspects):
4708         Create SCOs for Predicate aspects in disabled
4709         state initially, to be enabled later on by...
4710         * sem_ch13.adb (Build_Predicate_Functions.Add_Predicates): Mark
4711         SCO for predicate as enabled.
4713 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4715         * comperr.adb (Compiler_Abort): Remove now obsolete pair of
4716         pragmas Warnings Off / On.
4717         * namet.adb (Finalize): Remove now obsolete pair of pragmas
4718         Warnings Off / On.
4719         * output.adb: Remove now obsolete pair of pragmas Warnings Off / On.
4720         * sem_warn.adb (Warn_On_Constant_Valid_Condition): Do not
4721         consider comparisons between static expressions because their
4722         values cannot be invalidated.
4723         * urealp.adb (Tree_Read): Remove now obsolete pair of pragmas
4724         Warnings Off / On.
4725         (Tree_Write): Remove now obsolete pair of pragmas Warnings Off / On.
4726         * usage.adb Remove now obsolete pair of pragmas Warnings Off / On.
4728 2017-04-25  Bob Duff  <duff@adacore.com>
4730         * sem_elab.adb (In_Task_Activation): Trace internal calls in
4731         task bodies.
4733 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4735         * sem_prag.adb, sem_warn.adb, sem_eval.adb: Minor reformatting and
4736         typo fixes.
4738 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4740         * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings
4741         On/Off to defend against a spurious warning in conditional
4742         compilation.
4743         * exp_ch4.adb (Rewrite_Comparison): Reimplemented.
4744         * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to
4745         defend against a spurious warning in conditional compilation.
4746         * output.adb Add a pair of pragma Warnings On/Off to defend
4747         against a spurious warning in conditional compilation.
4748         * sem_eval.adb (Eval_Relational_Op): Major code clean up.
4749         (Fold_General_Op): New routine.
4750         (Fold_Static_Real_Op): New routine.
4751         (Test_Comparison): New routine.
4752         * sem_eval.ads (Test_Comparison): New routine.
4753         * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine.
4754         (Warn_On_Constant_Valid_Condition): New routine.
4755         (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison
4756         to detect a specific case.
4757         * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine.
4758         * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off
4759         to defend against a spurious warning in conditional compilation.
4760         (Tree_Write): Add a pair of pragma Warnings On/Off to defend
4761         against a spurious warning in conditional compilation.
4762         * usage.adb Add a pair of pragma Warnings On/Off to defend
4763         against a spurious warning in conditional compilation.
4765 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
4767         * sinfo.ads, sem_ch13.adb: Update comment.
4769 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4771         * sem_util.adb (Is_Post_State): A reference to a
4772         generic in out parameter is considered a change in the post-state
4773         of a subprogram.
4775 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4777         * sem_ch12.adb (Load_Parent_Of_Generic); When retrieving the
4778         declaration of a subprogram instance within its wrapper package,
4779         skip over null statements that may result from the rewriting of
4780         ignored pragmas.
4782 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4784         * exp_attr.adb (Expand_Attribute_Reference, case 'Read):
4785         If the type is an unchecked_union, replace the attribute with
4786         a Raise_Program_Error (rather than inserting such before the
4787         attribute reference) to handle properly the case where we are
4788         processing a component of a larger record, and we need to prevent
4789         further expansion for the unchecked union.
4790         (Expand_Attribute_Reference, case 'Write): If the type is
4791         an unchecked_union, check whether enclosing scope is a Write
4792         subprogram. Replace attribute with a Raise_Program_Error if the
4793         discriminants of the unchecked_union type have not default values
4794         because such a use is erroneous..
4796 2017-04-25  Tristan Gingold  <gingold@adacore.com>
4798         * exp_ch9.adb (Expand_N_Task_Type_Declaration):
4799         Add relative_deadline to task record on edf profile.
4800         (Make_Initialize_Protection): Pass deadline_floor value on edf profile.
4801         (Make_Task_Create_Call): Pass relative_deadline value.
4802         * par-prag.adb (Prag): Handle Pragma_Deadline_Floor.
4803         * s-rident.ads (Profile_Name): Add GNAT_Ravenscar_EDF.
4804         (Profile_Info): Add info for GNAT_Ravenscar_EDF.
4805         * sem_prag.adb (Set_Ravenscar_Profile): Handle
4806         GNAT_Ravenscar_EDF (set scheduling policy).
4807         (Analyze_Pragma): Handle GNAT_Ravenscar_EDF profile and Deadline_Floor
4808         pragma.
4809         (Sig_Flags): Add choice for Pragma_Deadline_Floor.
4810         * snames.ads-tmpl (Name_Deadline_Floor, Name_Gnat_Ravenscar_EDF):
4811         New names.
4812         (Pragma_Deadline_Floor): New pragma.
4813         * targparm.adb (Get_Target_Parameters): Recognize
4814         GNAT_Ravenscar_EDF profile.
4816 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4818         * gnatvsn.ads (Library_Version): Bump to 8. Update comment.
4820 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4822         * sem_aux.adb (Nearest_Ancestor): Use original node of type
4823         declaration to locate nearest ancestor, because derived
4824         type declarations for record types are rewritten as record
4825         declarations.
4826         * sem_ch13.adb (Add_Call): Use an unchecked conversion to handle
4827         properly derivations that are completions of private types.
4828         (Add_Predicates): If type is private, examine rep. items of full
4829         view, which may include inherited predicates.
4830         (Build_Predicate_Functions): Ditto.
4832 2017-04-25  Javier Miranda  <miranda@adacore.com>
4834         * sem_util.adb (New_Copy_Tree.Visit_Entity): Extend previous change
4835         to generate new entities for subtype declarations located in
4836         Expression_With_Action nodes.
4838 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4840         * sem_elab.adb (Check_A_Call): Remove
4841         local variables Is_DIC_Proc and Issue_In_SPARK. Verify the
4842         need for Elaborate_All when SPARK elaboration checks are
4843         required. Update the checks for instances, variables, and calls
4844         to Default_Initial_Condition procedures.
4846 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4848         * aspects.ads, aspects.adb: Make the GNAT-specific pragma No_Inline
4849         into a boolean aspect, in analogy with the Ada aspect No_Return.
4851 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4853         * exp_ch6.adb, sem_ch13.adb, sem_ch6.adb: Minor reformatting.
4855 2017-04-25  Bob Duff  <duff@adacore.com>
4857         * sem_res.adb (Resolve_Actuals): Under -gnatd.q, reset
4858         Is_True_Constant for an array variable that is passed to a
4859         foreign function as an 'in' parameter.
4860         * debug.adb: Document -gnatd.q.
4862 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4864         * sem_ch6.adb (Analyze_Expression_Function): If expression function
4865         is completion and return type is an access type do not freeze
4866         designated type: this will be done in the process of freezing
4867         the expression if needed.
4868         (Freeze_Expr_Types): Check whether type is complete before
4869         creating freeze node, to provide a better error message if
4870         reference is premature.
4871         * sem_ch13.adb (Check_Indexing_Functions): Ignore inherited
4872         functions created by type derivations.
4874 2017-04-25  Pascal Obry  <obry@adacore.com>
4876         * g-sercom.ads: Add simple usage of GNAT.Serial_Communication.
4878 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4880         * sem_res.adb (Resolve_Type_Conversion):
4881         When resolving against any fixed type, set the type of the
4882         operand as universal real when the operand is a multiplication
4883         or a division where both operands are of any fixed type.
4884         (Unique_Fixed_Point_Type): Add local variable ErrN. Improve the
4885         placement of an error message by pointing to the operand of a
4886         type conversion rather than the conversion itself.
4888 2017-04-25  Thomas Quinot  <quinot@adacore.com>
4890         * sem_ch13.adb (Build_Predicate_Function_Declaration): Set
4891         Needs_Debug_Info when producing SCOs.
4893 2017-04-25  Thomas Quinot  <quinot@adacore.com>
4895         * exp_ch6.adb (Add_Finalization_Master_Actual_To_Build_In_Place_Call):
4896         Always pass a null finalization master for a library level named access
4897         type to which a pragme No_Heap_Finalization applies.
4899 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4901         PR ada/78845
4903         * a-ngcoar.adb, a-ngrear.adb (Inverse): call Unit_Matrix with First_1
4904         set to A'First(2) and vice versa.
4906 2017-04-25  Yannick Moy  <moy@adacore.com>
4908         * freeze.adb (Freeze_Record_Type): Remove obsolete
4909         rule on volatile tagged record restriction on SPARK code.
4911 2017-04-25  Yannick Moy  <moy@adacore.com>
4913         * sem_prag.adb (minor) Fix SPARK RM reference.
4915 2017-04-25  Yannick Moy  <moy@adacore.com>
4917         * sem_util.adb, sem_util.ads (Unique_Defining_Entity): Update
4918         comment to reflect which entity is chosen as unique entity.
4919         (Unique_Entity): Return full view instead of private spec for
4920         protected type or task type. Fix possible incorrect access when
4921         called on entry.
4923 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
4925         * sem_res.adb (Set_Slice_Subtype): Treat specially bit-packed
4926         array types only instead of all packed array types.
4928 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4930         * sem_ch6.adb (Conforming_Types): If type of formal as a specified
4931         dimension system, verify that dimensions of both match.
4932         (Check_Conformance): Add error message in case of dimension
4933         mismatch.
4934         * sem_dim.ads, sem_dim.adb (Dimensions_Match): New utility
4935         predicate.
4937 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
4939         * gnatxref.adb, gnatfind.adb: Avoid using the term project file,
4940         confusing.
4942 2017-04-25  Yannick Moy  <moy@adacore.com>
4944         * sem_util.adb: Minor refactoring.
4945         * freeze.adb (Freeze_Record_Type): Fix checking of SPARK RM 7.1.3(5).
4947 2017-04-25  Claire Dross  <dross@adacore.com>
4949         * sem_prag.adb (Collect_Inherited_Class_Wide_Conditions): Go to
4950         ultimate alias when accessing overridden operation. Indeed, if the
4951         overridden operation is itself inherited, it won't have any explicit
4952         contract.
4954 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4956         * sem_warn.adb (Warn_On_Overlapping_Actuals): There can be no
4957         overlap if the two formals have different types, because formally
4958         the corresponding actuals cannot designate the same objects.
4960 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4962         * sem_dim.adb (Dimensions_Of_Operand): minot cleanups: a) If
4963         dimensions are present from context, use them.  b) If operand is
4964         a static constant rewritten as a literal, obtain the dimensions
4965         from the original declaration, otherwise use dimensions of type
4966         established from context.
4968 2017-04-25  Yannick Moy  <moy@adacore.com>
4970         * sem_util.adb (Is_Effectively_Volatile): Protect against base type
4971         of array that is private.
4973 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
4975         * sem_ch3.adb, exp_util.adb, sem_prag.adb, exp_ch4.adb: Minor
4976         reformatting.
4978 2017-04-25  Yannick Moy  <moy@adacore.com>
4980         * a-ngelfu.adb, a-ngelfu.ads: Add SPARK_Mode On on spec, Off
4981         on body.
4983 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
4985         * sem_disp.adb (Check_Dispatching_Context): Add guard to refine
4986         the check that recognizes a call to a private overridding and
4987         replaces the called subprogram with its alias.
4989 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
4991         * exp_util.adb: Minor reformatting.
4993 2017-04-25  Justin Squirek  <squirek@adacore.com>
4995         * exp_ch3.adb (Freeze_Type): Add condition to always treat
4996         interface types as a partial view of a private type for the
4997         generation of invariant procedure bodies.
4998         * exp_util.adb, exp_util.ads (Add_Inherited_Invariants):
4999         Add a condition to get the Corresponding_Record_Type for
5000         concurrent types, add condition to return in the absence of a
5001         class in the pragma, remove call to Replace_Type_References,
5002         and add call to Replace_References.
5003         (Add_Interface_Invariatns),
5004         (Add_Parent_Invariants): Modify call to Add_Inherited_Invariants
5005         to including the working type T.
5006         (Add_Own_Invariants): Remove
5007         legacy condition for separate units, remove dispatching for ASIS
5008         and save a copy of the expression in the pragma expression.
5009         (Build_Invariant_Procedure_Body): Default initalize vars,
5010         remove return condition on interfaces, always use the
5011         private type for interfaces, and move the processing of types
5012         until after the processing of invariants for the full view.
5013         (Build_Invariant_Procedure_Declaration): Remove condition
5014         to return if an interface type is encountered and add
5015         condition to convert the formal parameter to its class-wide
5016         counterpart if Work_Typ is abstract.
5017         (Replace_Type): Add call to Remove_Controlling_Arguments.
5018         (Replace_Type_Ref): Remove class-wide dispatching for the current
5019         instance of the type.
5020         (Replace_Type_References): Remove parameter "Derived"
5021         (Remove_Controlling_Arguments): Created in order to removing
5022         the controlliong argument from calls to primitives in the case
5023         of the formal parameter being an class-wide abstract type.
5024         * sem_ch3.adb (Build_Assertion_Bodies_For_Type): Almost identical
5025         to the change made to Freeze_Type in exp_ch3. Add a condition
5026         to treat interface types as a partial view.
5027         * sem_prag.adb (Analyze_Pragma): Modify parameters in the call
5028         to Build_Invariant_Procedure_Declaration to properly generate a
5029         "partial" invariant procedure when Typ is an interface.
5031 2017-04-25  Bob Duff  <duff@adacore.com>
5033         * a-numeri.ads: Go back to using brackets encoding for the Greek
5034         letter pi.
5036 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5038         * sem_ch3.adb (Derive_Subprogram): Implement rule in RM 6.1.1
5039         (10-15): if derived type T with progenitors is abstract,
5040         and primitive P of this type inherits non-trivial classwide
5041         preconditions from both a parent operation and from an interface
5042         operation, then the inherited operation is abstract if the parent
5043         operation is not null.
5044         * sem_disp.ads, sem_disp.adb: replace function Covers_Some_Interface
5045         with Covered_Interface_Op to yield the actual interface operation
5046         that is implemented by a given inherited operation.
5048 2017-04-25  Javier Miranda  <miranda@adacore.com>
5050         * exp_ch4.adb (Expand_N_Op_Expon): Relocate left
5051         and right operands after performing the validity checks. Required
5052         because validity checks may remove side effects from the operands.
5054 2017-04-25  Javier Miranda  <miranda@adacore.com>
5056         * exp_attr.adb (Attribute_Unrestricted_Access):
5057         Do not disable implicit type conversion.  Required to generate
5058         code that displaces the pointer to reference the secondary
5059         dispatch table.
5061 2017-04-25  Pascal Obry  <obry@adacore.com>
5063         * prj-attr.adb, snames.ads-tmpl: Add package Install's
5064         Required_Artifacts attribute.
5066 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5068         * sem_util.adb (Same_Value): String literals are compile-time
5069         values, and comparing them must use Expr_Value_S.
5071 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5073         * sem_ch4.adb (Complete_Object_Interpretation): If an explicit
5074         dereference is introduced for the object, and the object is
5075         overloaded, do not check whether it is aliased, because it may
5076         include an implicit dereference.
5077         * sem_type.adb (Disambiguate): If two interpretations are access
5078         attribute types with the same designated type keep either of
5079         them and do not report an ambiguity.  A true ambiguity will be
5080         reported elsewhere.
5082 2017-04-25  Bob Duff  <duff@adacore.com>
5084         * a-numeri.ads: Change the encoding of Greek letter Pi from
5085         brackets encoding to UTF-8.  Use pragma Wide_Character_Encoding
5086         to indicate the encoding. We considered using a byte order mark
5087         (BOM), but that causes various trouble (misc software eats the
5088         BOM, if you have a patch with a BOM, then it's not at the start
5089         of the patch, so it's not a BOM, the BOM affects with-ing files,
5090         etc.).
5091         * scng.adb, s-wchcnv.adb: Minor.
5093 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5095         * sem_ch3.adb, sem_ch8.adb, sem_disp.adb: Minor reformatting.
5096 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5098         * sem_ch3.adb (Add_Internal_Interface_Entities): Move
5099         Has_Non_Trivial_Precondition to sem_util. for use elsewhere.
5100         Improve error message on operations that inherit non-conforming
5101         classwide preconditions from ancestor and progenitor.
5102         * sem_util.ads, sem_util.adb (Has_Non_Trivial_Precondition):
5103         moved here from sem_ch3.
5104         * sem_ch8.adb (Analyze_Subprogram_Renaming): Implement legality
5105         check given in RM 6.1.1 (17) concerning renamings of overriding
5106         operations that inherits class-wide preconditions from ancestor
5107         or progenitor.
5109 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5111         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Code cleanup.
5112         (Build_Adjust_Statements): Code cleanup.
5113         (Build_Finalizer): Update the initialization of
5114         Exceptions_OK.
5115         (Build_Finalize_Statements): Code cleanup.
5116         (Build_Initialize_Statements): Code cleanup.
5117         (Make_Deep_Array_Body): Update the initialization of
5118         Exceptions_OK.
5119         (Make_Deep_Record_Body): Update the initialization of Exceptions_OK.
5120         (Process_Object_Declaration): Generate a null exception handler only
5121         when exceptions are allowed.
5122         (Process_Transients_In_Scope): Update the initialization of
5123         Exceptions_OK.
5124         * exp_util.ads, exp_util.adb (Exceptions_In_Finalization_OK): New
5125         routine.
5126         * sem_ch11.adb (Analyze_Exception_Handlers): Do not check any
5127         restrictions when the handler is internally generated and the
5128         mode is warnings.
5130 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5132         * sem_ch3.adb (Has_Non_Trivial_Precondition): New predicate to
5133         enforce legality rule on classwide preconditions inherited from
5134         both an ancestor and a progenitor (RM 6.1.1 (10-13).
5135         * sem_disp.adb (Check_Dispatching_Context): A call to an abstract
5136         subprogram need not be dispatching if it appears in a precondition
5137         for an abstract or null subprogram.
5139 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
5141         * sem_ch10.adb: Minor typo fix.
5143 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
5145         * gcc-interface/Makefile.in: Cleanup VxWorks targets.
5147 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5149         * fname.adb (Is_Internal_File_Name): Arrange for the slices to
5150         have a length which is a power of 2.
5151         (Is_Predefined_File_Name): Likewise. Adjust comment.
5153 2017-04-25  Bob Duff  <duff@adacore.com>
5155         * exp_aggr.adb (Component_Count): Protect the
5156         arithmetic from attempting to convert a value >= 2**31 to Int,
5157         which would otherwise raise Constraint_Error.
5159 2017-04-25  Bob Duff  <duff@adacore.com>
5161         * opt.ads (Locking_Policy): Fix incorrect documentation. The
5162         first character of the policy name is not unique.
5164 2017-04-25  Bob Duff  <duff@adacore.com>
5166         * s-fileio.adb (Name): Raise Use_Error if the file is a temp file.
5167         * s-ficobl.ads (Is_Temporary_File): Remove incorrect comment
5168         about this flag not being used. It was already used, and it is
5169         now used more.
5171 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5173         * einfo.adb Flag301 is now known as Ignore_SPARK_Mode_Pragmas.
5174         (Ignore_SPARK_Mode_Pragmas): New routine.
5175         (Set_Ignore_SPARK_Mode_Pragmas): New routine.
5176         (Write_Entity_Flags): Add an entry for Ignore_SPARK_Mode_Pragmas.
5177         * einfo.ads Add new attribute Ignore_SPARK_Mode_Pragmas and update
5178         related entities.
5179         (Ignore_SPARK_Mode_Pragmas): New routine
5180         along with pragma Inline.
5181         (Set_Ignore_SPARK_Mode_Pragmas): New routine along with pragma Inline.
5182         * opt.ads Rename flag Ignore_Pragma_SPARK_Mode to
5183         Ignore_SPARK_Mode_Pragmas_In_Instance.
5184         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
5185         Save and restore the value of global flag
5186         Ignore_SPARK_Mode_Pragmas_In_Instance. Set or reinstate the value
5187         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance when either
5188         the corresponding spec or the body must ignore all SPARK_Mode
5189         pragmas found within.
5190         (Analyze_Subprogram_Declaration): Mark
5191         the spec when it needs to ignore all SPARK_Mode pragmas found
5192         within to allow the body to infer this property in case it is
5193         instantiated or inlined later.
5194         * sem_ch7.adb (Analyze_Package_Body_Helper): Save and restore the
5195         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
5196         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
5197         when the corresponding spec also ignored all SPARK_Mode pragmas
5198         found within.
5199         (Analyze_Package_Declaration): Mark the spec when
5200         it needs to ignore all SPARK_Mode pragmas found within to allow
5201         the body to infer this property in case it is instantiated or
5202         inlined later.
5203         * sem_ch12.adb (Analyze_Formal_Package_Declaration):
5204         Save and restore the value of flag
5205         Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
5206         formal spec when it needs to ignore all SPARK_Mode
5207         pragmas found within to allow the body to infer this
5208         property in case it is instantiated or inlined later.
5209         (Analyze_Package_Instantiation): Save and restore the value
5210         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark
5211         the instance spec when it needs to ignore all SPARK_Mode
5212         pragmas found within to allow the body to infer this
5213         property in case it is instantiated or inlined later.
5214         (Analyze_Subprogram_Instantiation): Save and restore the value
5215         of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Mark the
5216         instance spec and anonymous package when they need to ignore
5217         all SPARK_Mode pragmas found within to allow the body to infer
5218         this property in case it is instantiated or inlined later.
5219         (Instantiate_Package_Body): Save and restore the value of global
5220         flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set the value of
5221         global flag Ignore_SPARK_Mode_Pragmas_In_Instance when the
5222         corresponding instance spec also ignored all SPARK_Mode pragmas
5223         found within.
5224         (Instantiate_Subprogram_Body): Save and restore the
5225         value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance. Set
5226         the value of global flag Ignore_SPARK_Mode_Pragmas_In_Instance
5227         when the corresponding instance spec also ignored all SPARK_Mode
5228         pragmas found within.
5229         * sem_prag.adb (Analyze_Pragma): Update the reference to
5230         Ignore_Pragma_SPARK_Mode.
5231         * sem_util.adb (SPARK_Mode_Is_Off): A construct which ignored
5232         all SPARK_Mode pragmas defined within yields mode "off".
5234 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5236         * bindgen.adb, exp_dbug.adb, errout.adb, fname.adb: Minor reformatting.
5238 2017-04-25  Bob Duff  <duff@adacore.com>
5240         * exp_atag.adb (Build_CW_Membership): Add "Suppress =>
5241         All_Checks" to avoid generating unnecessary checks.
5242         * exp_ch4.adb (Expand_N_In, Make_Tag_Check): Add "Suppress =>
5243         All_Checks".
5244         * sem.ads: Fix comment.
5245         * expander.ads: Fix comment.
5246         * exp_atag.ads: Fix comment: "Index = 0" should be
5247         "Index >= 0".
5249 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
5251         * s-taprop-linux.adb: Minor editorial fixes.
5253 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5255         * sem_util.adb (New_Copy_Tree): Put back the declarations of the
5256         hash tables at library level.  Reinstate the NCT_Hash_Tables_Used
5257         variable and set it to True whenever the main hash table is
5258         populated.  Short- circuit the Assoc function if it is false
5259         and add associated guards.
5261 2017-04-25  Olivier Hainque  <hainque@adacore.com>
5263         * bindgen.adb (Gen_Elab_Calls): Also update counter of lone
5264         specs without elaboration code that have an elaboration counter
5265         nevertheless, e.g.  when compiled with -fpreserve-control-flow.
5266         * sem_ch10.adb (Analyze_Compilation_Unit):
5267         Set_Elaboration_Entity_Required when requested to preserve
5268         control flow, to ensure the unit elaboration is materialized at
5269         bind time, resulting in the inclusion of the unit object file
5270         in the executable closure at link time.
5272 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
5274         * exp_dbug.adb: In Debug_Renaming_Declaration,
5275         when dealing with indexed component, accept to produce a renaming
5276         symbol when the index is an IN parameter or when it is a name
5277         defined in an outer scope.
5279 2017-04-25  Yannick Moy  <moy@adacore.com>
5281         * errout.adb (Error_Msg): Adapt continuation
5282         message in instantiations and inlined bodies for info messages.
5284 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5286         * fname.adb (Has_Internal_Extension): Add pragma Inline.
5287         Use direct 4-character slice comparisons.
5288         (Has_Prefix): Add
5289         pragma Inline.  (Has_Suffix): Delete.
5290         (Is_Internal_File_Name):
5291         Test Is_Predefined_File_Name first.
5292         (Is_Predefined_File_Name):
5293         Use direct slice comparisons as much as possible and limit all
5294         comparisons to at most 8 characters.
5296 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5298         * checks.adb (Insert_Valid_Check): Code cleanup.
5299         * exp_ch6.adb (Add_Validation_Call_By_Copy_Code): New routine.
5300         (Expand_Actuals): Generate proper copy-back for a validation
5301         variable when it acts as the argument of a type conversion.
5302         * sem_util.adb (Is_Validation_Variable_Reference): Augment the
5303         predicate to operate on type qualifications.
5305 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5307         * sem_prag.adb, exp_ch6.adb, binde.adb, sem_disp.adb, s-fileio.adb:
5308         Minor reformatting.
5310 2017-04-25  Bob Duff  <duff@adacore.com>
5312         * sem_prag.adb (No_Return): Give an error if the pragma applies
5313         to a body. Specialize the error for the specless body case,
5314         as is done for (e.g.) pragma Convention.
5315         * debug.adb: Add switch -gnatd.J to disable the above legality
5316         checks. This is mainly for use in our test suite, to avoid
5317         rewriting a lot of illegal (but working) code.  It might also
5318         be useful to customers. Under this switch, if a pragma No_Return
5319         applies to a body, and the procedure raises an exception (as it
5320         should), the pragma has no effect. If the procedure does return,
5321         execution is erroneous.
5323 2017-04-25  Bob Duff  <duff@adacore.com>
5325         * exp_ch6.adb (Expand_Actuals): This is the
5326         root of the problem. It took N as an 'in out' parameter, and in
5327         some cases, rewrote N, but then set N to Original_Node(N). So
5328         the node returned in N had no Parent. The caller continued
5329         processing of this orphaned node. In some cases that caused a
5330         crash (e.g. Remove_Side_Effects climbs up Parents in a loop,
5331         and trips over the Empty Parent). The solution is to make N an
5332         'in' parameter.  Instead of rewriting it, return the list of
5333         post-call actions, so the caller can do the rewriting later,
5334         after N has been fully processed.
5335         (Expand_Call_Helper): Move most of Expand_Call here. It has
5336         too many premature 'return' statements, and we want to do the
5337         rewriting on return.
5338         (Insert_Post_Call_Actions): New procedure to insert the post-call
5339         actions in the appropriate place. In the problematic case,
5340         that involves rewriting N as an Expression_With_Actions.
5341         (Expand_Call): Call the new procedures Expand_Call_Helper and
5342         Insert_Post_Call_Actions.
5344 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5346         * sem_prag.adb (Inherits_Class_Wide_Pre): Cleanup code, handle
5347         properly type derived from generic formal types, to handle
5348         properly modified version of ACATS 4.1B B611017.
5350 2017-04-25  Javier Miranda  <miranda@adacore.com>
5352         * exp_unst.adb (Subp_Index): Adding missing
5353         support for renamings and functions that return a constrained
5354         array type (i.e. functions for which the frontend built a
5355         procedure with an extra out parameter).
5357 2017-04-25  Pascal Obry  <obry@adacore.com>
5359         * s-string.adb: Minor code clean-up.
5361 2017-04-25  Bob Duff  <duff@adacore.com>
5363         * s-os_lib.ads, s-os_lib.adb (Non_Blocking_Wait_Process): New
5364         procedure.
5365         * adaint.h, adaint.c (__gnat_portable_no_block_wait): C support
5366         function for Non_Blocking_Wait_Process.
5368 2017-04-25  Bob Duff  <duff@adacore.com>
5370         * prep.adb (Preprocess): Remove incorrect
5371         Assert. Current character can be ASCII.CR.
5373 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5375         * sem_prag.adb (Set_Convention_From_Pragma): Cleanup code for
5376         convention Stdcall, which has a number of exceptions. Convention
5377         is legal on a component declaration whose type is an anonymous
5378         access to subprogram.
5380 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5382         * sem_ch4.adb: sem_ch4.adb Various reformattings.
5383         (Try_One_Prefix_Interpretation): Use the base type when dealing
5384         with a subtype created for purposes of constraining a private
5385         type with discriminants.
5387 2017-04-25  Javier Miranda  <miranda@adacore.com>
5389         * einfo.ads, einfo.adb (Has_Private_Extension): new attribute.
5390         * warnsw.ads, warnsw.adb (All_Warnings): Set warning on late
5391         dispatching primitives (Restore_Warnings): Restore warning on
5392         late dispatching primitives (Save_Warnings): Save warning on late
5393         dispatching primitives (Do_Warning_Switch): Use -gnatw.j/-gnatw.J
5394         to enable/disable this warning.
5395         (WA_Warnings): Set warning on late dispatching primitives.
5396         * sem_ch3.adb (Analyze_Private_Extension_Declaration): Remember
5397         that its parent type has a private extension.
5398         * sem_disp.adb (Warn_On_Late_Primitive_After_Private_Extension):
5399         New subprogram.
5400         * usage.adb: Document -gnatw.j and -gnatw.J.
5402 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5404         * exp_ch7.adb, checks.adb, sem_prag.adb, eval_fat.adb: Minor
5405         reformatting.
5407 2017-04-25  Bob Duff  <duff@adacore.com>
5409         * binde.adb (Validate): Do not pass dynamic strings
5410         to pragma Assert, because older compilers do not support that.
5412 2017-04-25  Bob Duff  <duff@adacore.com>
5414         * s-fileio.adb (Close): When a temp file is
5415         closed, delete it and clean up its Temp_File_Record immediately,
5416         rather than waiting until later.
5417         (Temp_File_Record): Add File
5418         component, so Close can know which Temp_File_Record corresponds
5419         to the file being closed.
5420         (Delete): Don't delete temp files,
5421         because they are deleted by Close.
5422         (Open): Set the File component
5423         of Temp_File_Record. This requires moving the creation of the
5424         Temp_File_Record to the end, after the AFCB has been created.
5426 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5428         * checks.adb (Insert_Valid_Check): Do not generate
5429         a validity check when inside a generic.
5431 2017-04-25  Yannick Moy  <moy@adacore.com>
5433         * sem_res.adb (Resolve_Type_Conversion): Fix bad logic.
5435 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
5437         * snames.ads-tmpl (Snames): More names for detecting predefined
5438         potentially blocking subprograms.
5440 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5442         * sem_prag.adb (Analyze_Pre_Post_Condition): The rules
5443         concerning inheritance of class-wide preconditions do not apply
5444         to postconditions.
5446 2017-04-25  Bob Duff  <duff@adacore.com>
5448         * s-ficobl.ads: Minor comment fix.
5450 2017-04-25  Yannick Moy  <moy@adacore.com>
5452         * checks.adb (Apply_Scalar_Range_Check): Analyze precisely
5453         conversions from float to integer in GNATprove mode.
5454         (Apply_Type_Conversion_Checks): Make sure in GNATprove mode
5455         to call Apply_Type_Conversion_Checks, so that range checks
5456         are properly positioned when needed on conversions, including
5457         when converting from float to integer.  (Determine_Range): In
5458         GNATprove mode, take into account the possibility of conversion
5459         from float to integer.
5460         * sem_res.adb (Resolve_Type_Conversion): Only enforce range
5461         check on conversions from fixed-point to integer, not anymore
5462         on conversions from floating-point to integer, when in GNATprove
5463         mode.
5465 2017-04-25  Yannick Moy  <moy@adacore.com>
5467         * checks.adb (Determine_Range_R): Special case type conversions
5468         from integer to float in order to get bounds in that case too.
5469         * eval_fat.adb (Machine): Avoid issuing warnings in GNATprove
5470         mode, for computations involved in interval checking.
5472 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5474         * checks.adb (Insert_Valid_Check): Partially reimplement validity
5475         checks.
5476         * einfo.adb Node36 is now used as Validated_Object.
5477         (Validated_Object): New routine.
5478         (Set_Validated_Object): New routine.
5479         (Write_Field36_Name): Add an entry for Validated_Object.
5480         * einfo.ads Add new attribute Validated_Object along with
5481         usage in entities.
5482         (Validated_Object): New routine along with pragma Inline.
5483         (Set_Validated_Object): New routine along with pragma Inline.
5484         * exp_attr.adb (Make_Range_Test): Add processing for validation
5485         variables to avoid extra reads and copies of the prefix.
5486         * exp_ch6.adb (Expand_Actuals): Add copy-back for validation
5487         variables in order to reflect any changes done in the variable
5488         back into the original object.
5489         * sem_util.adb (Is_Validation_Variable_Reference): New routine.
5490         * sem_util.ads (Is_Validation_Variable_Reference): New routine.
5492 2017-04-25  Steve Baird  <baird@adacore.com>
5494         * exp_ch7.adb (Build_Array_Deep_Procs,
5495         Build_Record_Deep_Procs, Make_Finalize_Address_Body): Don't
5496         generate Finalize_Address routines for CodePeer.
5498 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5500         * sem_prag.adb (Inherits_Class_Wide_Pre): subsidiary of
5501         Analyze_Pre_Post_Condition, to implement the legality checks
5502         mandated by AI12-0131: Pre'Class shall not be specified for an
5503         overriding primitive subprogram of a tagged type T unless the
5504         Pre'Class aspect is specified for the corresponding primitive
5505         subprogram of some ancestor of T.
5507 2017-04-25  Bob Duff  <duff@adacore.com>
5509         * sem_ch8.adb (Use_One_Type): If a use_type_clause
5510         is redundant, set its Used_Operations to empty. This is only
5511         necessary for use clauses that appear in the parent of a generic
5512         child unit, because those use clauses get reanalyzed when we
5513         instantiate the generic, and we don't want the Used_Operations
5514         carried over from the original context (where it was probably
5515         not redundant).
5517 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5519         * exp_ch6.adb: Minor reformatting.
5521 2017-04-25  Bob Duff  <duff@adacore.com>
5523         * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings):
5524         Use Source_Index (Current_Sem_Unit) to find the correct casing.
5525         * exp_prag.adb (Expand_Pragma_Check): Use Source_Index
5526         (Current_Sem_Unit) to find the correct casing.
5527         * par.adb (Par): Null out Current_Source_File, to ensure that
5528         the above bugs won't rear their ugly heads again.
5530 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5532         * sem_ch8.adb (Find_Type): For an attribute reference
5533         'Class, if prefix type is synchronized and previous errors
5534         have suppressed the creation of the corresponding record type,
5535         create a spurious class-wide for the synchonized type itself,
5536         to catch other misuses of the attribute
5538 2017-04-25  Steve Baird  <baird@adacore.com>
5540         * exp_ch6.adb (Expand_Simple_Function_Return): if CodePeer_Mode
5541         is True, then don't generate the accessibility check for the
5542         tag of a tagged result.
5543         * exp_intr.adb (Expand_Dispatching_Constructor_Call):
5544         if CodePeer_Mode is True, then don't generate the
5545         tag checks for the result of call to an instance of
5546         Ada.Tags.Generic_Dispatching_Constructor (i.e., both the "is a
5547         descendant of" check and the accessibility check).
5549 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5551         * sem_ch13.adb: Code cleanups.
5552         * a-strbou.ads: minor whitespace fix in Trim for bounded strings.
5553         * sem_ch8.ads: Minor comment fix.
5555 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5557         * exp_ch4.adb (Library_Level_Target): New function.
5558         (Expand_Concatenate): When optimization is enabled, also expand
5559         the operation out-of-line if the concatenation is present within
5560         the expression of the declaration of a library-level object and
5561         not only if it is the expression of the declaration.
5563 2017-04-25  Bob Duff  <duff@adacore.com>
5565         * freeze.adb (Freeze_Object_Declaration): Do
5566         not Remove_Side_Effects if there is a pragma Linker_Section,
5567         because in that case we want static initialization in the
5568         appropriate section.
5570 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
5572         * exp_dbug.adb: Minor rewording and reformatting.
5574 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5576         * sem_attr.adb (Statically_Denotes_Object): New predicate, to
5577         handle the proposed changes to rules concerning potentially
5578         unevaluated expressions, to include selected components that
5579         do not depend on discriminants, and indexed components with
5580         static indices.
5581         * sem_util.adb (Is_Potentially_Unevaluated): Add check for
5582         predicate in quantified expression, and fix bugs in the handling
5583         of case expressions and membership test.
5584         (Analyze_Attribute_Old_Result): use new predicate.
5585         (Analyze_Attribute, case Loop_Entry): ditto.
5587 2017-04-25  Bob Duff  <duff@adacore.com>
5589         * s-secsta.adb (SS_Info): Add a comment
5590         explaining why we don't need to walk all the chunks in order to
5591         compute the total size.
5593 2017-04-25  Bob Duff  <duff@adacore.com>
5595         * namet.ads, namet.adb (Global_Name_Buffer): Increase the length
5596         of the global name buffer to 4*Max_Line_Length.
5598 2017-04-25  Javier Miranda  <miranda@adacore.com>
5600         * exp_ch8.adb (Expand_N_Object_Renaming_Declaration): When creating a
5601         renaming entity for debug information, mark the entity as needing debug
5602         info if it comes from sources.
5604 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5606         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove the
5607         restriction converning the use of 'Address where the prefix is
5608         of a controlled type.
5610 2017-04-25  Pierre-Marie de Rodat  <derodat@adacore.com>
5612         * exp_dbug.adb: In Debug_Renaming_Declaration,
5613         skip slices that are made redundant by an indexed component
5614         access.
5615         * atree.h: New definition for Original_Node.
5617 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5619         * sem_prag.adb, sem_prag.ads: Minor reformatting.
5621 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5623         * sem_ch3.adb (Check_Entry_Contract): Call
5624         Preanalyze_Spec_Expression so that resolution takes place as well.
5625         * sem_util.adb (Check_Internal_Protected_Use): Reject properly
5626         internal calls that appear in preconditions of protected
5627         operations, in default values for same, and in contract guards
5628         for contract cases in SPARK.
5630 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5632         * a-numaux.ads: Fix description of a-numaux-darwin
5633         and a-numaux-x86.
5634         (Double): Define to Long_Float.
5635         * a-numaux-vxworks.ads (Double): Likewise.
5636         * a-numaux-darwin.ads
5637         (Double): Likewise.
5638         * a-numaux-libc-x86.ads (Double): Define to Long_Long_Float.
5639         * a-numaux-x86.ads: Fix package description.
5640         * a-numaux-x86.adb (Is_Nan): Minor tweak.
5641         (Reduce): Adjust and complete description. Call Is_Nan instead of
5642         testing manually. Use an integer temporary to hold rounded value.
5643         * a-numaux-darwin.adb (Reduce): Likewise.
5644         (Is_Nan): New function.
5646 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5648         * sem_ch4.adb (Analyze_Selected_Component): Additional refinement
5649         on analysis of prefix whose type is a current instance of a
5650         synchronized type, but where the prefix itself is an entity that
5651         is an object.
5653 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5655         * exp_ch5.adb (Replace_Target): When rewriting the RHS, preserve
5656         the identity of callable entities therein, because they have been
5657         properly resolved, and prefixed calls may have been rewritten
5658         as normal calls.
5660 2017-04-25  Patrick Bernardi  <bernardi@adacore.com>
5662         * exp_ch3.adb (Build_Init_Statements): Convert
5663         the expression of the pragma/aspect Secondary_Stack_Size to
5664         internal type System.Parameters.Size_Type before assigning
5665         it to the Secondary_Stack_Size component of the task type's
5666         corresponding record.
5668 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5670         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal
5671         (etc) optimizations when the type is modular and the offsets
5672         are equal.
5674 2017-04-25  Eric Botcazou  <ebotcazou@adacore.com>
5676         * s-osinte-freebsd.ads: Minor comment tweaks
5678 2017-04-25  Javier Miranda  <miranda@adacore.com>
5680         * urealp.adb (UR_Write): Reverse previous patch
5681         adding documentation on why we generate multiplications instead
5682         of divisions (needed to avoid expressions whose computation with
5683         large numbers may cause division by 0).
5685 2017-04-25  Bob Duff  <duff@adacore.com>
5687         * erroutc.adb (Set_Specific_Warning_Off,
5688         Set_Warnings_Mode_Off): Use the correct source file for
5689         Stop. Was using Current_Source_File, which is only valid during
5690         parsing. Current_Source_File will have a leftover value from
5691         whatever file happened to be parsed last, because of a with_clause
5692         or something.
5694 2017-04-25  Bob Duff  <duff@adacore.com>
5696         * lib.ads, lib.adb (In_Internal_Unit): New functions similar
5697         to In_Predefined_Unit, but including GNAT units.
5698         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): Replace
5699         with Should_Ignore_Pragma_Par and Should_Ignore_Pragma_Sem,
5700         because Should_Ignore_Pragma was not working reliably outside
5701         the parser, because Current_Source_File is not valid.
5702         * sem_prag.adb, exp_prag.adb: Call Should_Ignore_Pragma_Sem.
5703         * par-prag.adb: Call Should_Ignore_Pragma_Par.
5705 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
5707         * gnat1drv.adb (Gnat1Drv): Disable Generate_Processed_File in
5708         codepeer mode.
5710 2017-04-25  Javier Miranda  <miranda@adacore.com>
5712         * urealp.adb (UR_Write): Fix output of constants with a base other
5713         that 10.
5715 2017-04-25  Justin Squirek  <squirek@adacore.com>
5717         * sem_ch13.adb (Get_Interfacing_Aspects): Moved to sem_util.adb.
5718         * sem_prag.adb (Analyze_Pragma, Process_Import_Or_Interface):
5719         Add extra parameter for Process_Interface_Name.
5720         (Process_Interface_Name): Add parameter for pragma to analyze
5721         corresponding aspect.
5722         * sem_util.ads, sem_util.adb (Get_Interfacing_Aspects): Added
5723         from sem_ch13.adb
5725 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
5727         * exp_ch7.adb, einfo.ads, sem_prag.adb: Minor reformatting and typo
5728         correction.
5730 2017-04-25  Yannick Moy  <moy@adacore.com>
5732         * sem_res.adb (Resolve_Comparison_Op): Do not
5733         attempt evaluation of relational operations inside assertions.
5735 2017-04-25  Justin Squirek  <squirek@adacore.com>
5737         * exp_util.adb (Add_Interface_Invariants):
5738         Restored, code moved back from Build_Invariant_Procedure_Body.
5739         (Add_Parent_Invariants): Restored, code moved back from
5740         Build_Invariant_Procedure_Body.
5741         (Build_Invariant_Procedure_Body):
5742         Remove refactored calls and integrated code from
5743         Add_Parent_Invariants and Add_Interface_Invariants.
5745 2017-04-25  Johannes Kanig  <kanig@adacore.com>
5747         * errout.adb (Output_Messages): Adjust computation of total
5748         errors
5749         * erroutc.adb (Error_Msg): In statistics counts, deal
5750         correctly with informational messages that are not warnings.
5751         * errutil.adb (Finalize): adjust computation of total errors.
5753 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
5755         * terminals.c (__gnat_terminate_pid): New.
5756         * g-exptty.ads (Terminate_Process): New. Update comments.
5758 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
5760         * a-cfinve.ads, a-cofove.ads (Empty_Vector): add Global contract.
5762 2017-04-25  Justin Squirek  <squirek@adacore.com>
5764         * sem_ch3.adb (Analyze_Declarations): Minor
5765         correction to comments, move out large conditional and scope
5766         traversal into a predicate.
5767         (Uses_Unseen_Lib_Unit_Priv): Predicate function made from extracted
5768         logic.
5770 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5772         * sem_ch4.adb (Analyze_Selected_Component): Refine analysis
5773         of prefix whose type is a current instance of a synchronized
5774         type. If the prefix is an object this is an external call (or
5775         requeue) that can only access public operations of the object. The
5776         previous predicate was too restrictive, and did not allow public
5777         protected operations, only task entries.
5779 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5781         * sem_ch5.adb, fname.adb: Minor reformatting.
5783 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5785         * einfo.adb (Is_Anonymous_Access_Type): New routine.
5786         * einfo.ads Update the placement of
5787         E_Anonymous_Access_Subprogram_Type along with all subtypes that
5788         mention the ekind.
5789         (Is_Anonymous_Access_Type): New routine.
5790         * exp_ch7.adb (Allows_Finalization_Master): Do not generate a
5791         master for an access type subject to pragma No_Heap_Finalization.
5792         * exp_util.adb (Build_Allocate_Deallocate_Proc): An object being
5793         allocated or deallocated does not finalization actions if the
5794         associated access type is subject to pragma No_Heap_Finalization.
5795         * opt.ads Add new global variable No_Heap_Finalization_Pragma.
5796         * par-prag.adb Pragma No_Heap_Finalization does not need special
5797         processing from the parser.
5798         * sem_ch6.adb (Check_Return_Subtype_Indication): Remove ancient
5799         ??? comments. Use the new predicate Is_Anonymous_Access_Type.
5800         * sem_prag.adb Add an entry in table Sig_Flags for pragma
5801         No_Heap_Finalization.
5802         (Analyze_Pragma): Add processing for
5803         pragma No_Heap_Finalization. Update various error messages to
5804         use Duplication_Error.
5805         * sem_util.ads, sem_util.adb (No_Heap_Finalization): New routine.
5806         * snames.ads-tmpl: Add new predefined name No_Heap_Finalization
5807         and corresponding pragma id.
5809 2017-04-25  Bob Duff  <duff@adacore.com>
5811         * freeze.adb (Freeze_Record_Type): Use the
5812         underlying type of the component type to determine whether it's
5813         elementary. For representation clause purposes, a private type
5814         should behave the same as its full type.
5815         * fname.ads, fname.adb (Is_Predefined_File_Name):
5816         Make sure things like "system.ali" are recognized as predefined.
5818 2017-04-25  Javier Miranda  <miranda@adacore.com>
5820         * debug.adb: Update documentation of -gnatd.6.
5822 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5824         * sem_ch5.adb (Preanalyze_Range): Handle properly an Ada2012
5825         element iterator when the name is an overloaded function call,
5826         one of whose interpretations yields an array.
5828 2017-04-25  Bob Duff  <duff@adacore.com>
5830         * uname.ads, uname.adb (Is_Predefined_Unit_Name,
5831         Is_Internal_Unit_Name): New functions for operating on unit
5832         names, as opposed to file names. There's some duplicated code
5833         with fname.adb, which is unfortunate, but it seems like we don't
5834         want to add dependencies here.
5835         * fname-uf.adb (Get_File_Name): Change Is_Predefined_File_Name
5836         to Is_Predefined_Unit_Name; the former was wrong, because Uname
5837         is not a file name at all.
5838         * fname.ads, fname.adb: Document the fact that
5839         Is_Predefined_File_Name and Is_Internal_File_Name can be called
5840         for ALI files, and fix the code so it works properly for ALI
5841         files. E.g. these should return True for "system.ali".
5843 2017-04-25  Justin Squirek  <squirek@adacore.com>
5845         * exp_util.adb (Add_Invariant): Removed,
5846         code moved to Add_Invariant_Check, Add_Inherited_Invariant,
5847         and Add_Own_Invariant.  (Add_Invariant_Check): Used
5848         for adding runtime checks from any kind of invariant.
5849         (Add_Inherited_Invariant): Generates invariant checks for
5850         class-wide invariants (Add_Interface_Invariants): Removed, code
5851         moved to Build_Invariant_Procedure_Body (Add_Own_Invariant):
5852         Create a types own invariant procedure (Add_Parent_Invariants):
5853         Removed, code moved to Build_Invariant_Procedure_Body
5854         (Build_Invariant_Procedure_Body): Add refactored calls
5855         and integrated code from Add_Parent_Invariants and
5856         Add_Interface_Invariants.
5857         (Process_Type): Removed, the
5858         relavant code was inlined into both Add_Own_Invariant and
5859         Add_Inherited_Invariant.
5861 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5863         * make.adb, par-ch2.adb, sem_util.adb, scans.ads, sem_ch8.adb,
5864         scn.adb, osint.adb, fname.adb: Minor reformatting.
5866 2017-04-25  Pascal Obry  <obry@adacore.com>
5868         * s-taprop-mingw.adb: Do not check for CloseHandle in
5869         Finalize_TCB.
5871 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5873         * sem_util.adb (Check_Part_Of_Reference):
5874         Continue to examine the context if the reference appears within
5875         an expression function.
5877 2017-04-25  Justin Squirek  <squirek@adacore.com>
5879         * exp_ch7.adb, exp_ch7.ads Remove Build_Invariant_Procedure_Body
5880         and Build_Invariant_Procedure_Declaration.
5881         * exp_util.ads, exp_util.adb Add Build_Invariant_Procedure_Body
5882         and Build_Invariant_Procedure_Declaration from exp_ch7
5883         and break-out Is_Untagged_Private_Derivation from
5884         Build_Invariant_Procedure_Body.
5885         (Replace_Type_References):
5886         Append an extra parameter to allow for dispatching replacements
5887         and add the corrasponding logic.
5888         (Type_Invariant): Remove
5889         Replace_Typ_Refs and replace its references with calls to
5890         Replace_Type_References.
5891         * sem_ch3.adb, sem_prag.adb: Remove with and use of exp_ch7.
5893 2017-04-25  Bob Duff  <duff@adacore.com>
5895         * sem_util.ads, sem_util.adb (Should_Ignore_Pragma): New function
5896         that returns True when appropriate.
5897         * par-prag.adb, exp_prag.adb, sem_prag.adb: Do not ignore pragmas
5898         when compiling predefined files.
5899         * fname.ads, fname.adb (Is_Predefined_File_Name): Fix bug:
5900         "gnat.adc" should not be considered a predefined file name.
5901         That required (or at least encouraged) a lot of cleanup of global
5902         variable usage. We shouldn't be communicating information via
5903         the global name buffer.
5904         * bindgen.adb, errout.adb, fname-uf.adb, lib-load.adb, make.adb,
5905         * restrict.adb, sem_ch10.adb, sem_ch6.adb, sem_ch8.adb: Changes
5906         required by the above-mentioned cleanup.
5908 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5910         * osint.adb (Find_File): Handle properly a request for a
5911         configuration file whose name is a directory.
5913 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5915         * sem_attr.adb, sem_ch5.adb: Minor reformatting.
5917 2017-04-25  Bob Duff  <duff@adacore.com>
5919         * types.ads: Minor: Fix '???' comment.
5920         * sem_ch8.adb: Minor comment fix.
5922 2017-04-25  Bob Duff  <duff@adacore.com>
5924         * sem_prag.adb: Remove suspicious uses of Name_Buf.
5925         * stringt.ads, stringt.adb, exp_dbug.adb, sem_dim.adb: Remove
5926         Add_String_To_Name_Buffer, to avoid using the global Name_Buf.
5927         Add String_To_Name with no side effects.
5929 2017-04-25  Justin Squirek  <squirek@adacore.com>
5931         * sem_ch3.adb (Analyze_Declarations): Add
5932         additional condition for edge case.
5934 2017-04-25  Bob Duff  <duff@adacore.com>
5936         * par-ch2.adb, scans.ads, scn.adb: Do not give an error for
5937         reserved words inside pragmas. This is necessary to allow the
5938         pragma name Interface to be used in pragma Ignore_Pragma.
5939         * par.adb: Minor comment fix.
5941 2017-04-25  Javier Miranda  <miranda@adacore.com>
5943         * a-tags.ads, a-tags.adb (Type_Is_Abstract): Renamed as Is_Abstract.
5944         * rtsfind.ads (RE_Type_Is_Abstract): Renamed as Is_Abstract.
5945         * exp_disp.adb (Make_DT): Update occurrences of RE_Type_Is_Abstract.
5946         * exp_intr.adb (Expand_Dispatching_Constructor_Call): Update
5947         occurrences of RE_Type_Is_Abstract
5949 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5951         * exp_util.adb (Build_Chain): Account for ancestor
5952         subtypes while traversing the derivation chain.
5954 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5956         * sem_attr.adb: minor reformatting.
5958 2017-04-25  Doug Rupp  <rupp@adacore.com>
5960         * sigtramp-vxworks-target.inc [PPC64]: Add a .localentry pseudo-op.
5962 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
5964         * sem_ch5.adb (Analyze_Assignment): Reset Full_Analysis flag on
5965         the first pass over an assignment statement with target names,
5966         to prevent the generation of subtypes (such as discriminated
5967         record components)that may carry the target name outside of the
5968         tree for the assignment. The subtypes will be generated when
5969         the assignment is reanalyzed in full.
5970         (Analyze_Target_Name): Handle properly class-wide types.
5972 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
5974         * elists.ads, elists.adb (Prepend_Unique_Elmt): New routine.
5975         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
5976         the purposes of freezing.
5977         * exp_util.adb Update the documentation and structure of the
5978         type map used in class-wide semantics of assertion expressions.
5979         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
5980         and resolve the triaged expression because all substitutions
5981         refer to the proper entities.  Update the replacement of
5982         references.
5983         (Build_DIC_Procedure_Body): Add formal parameter
5984         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
5985         are now only processed when freezing occurs.  Build a body only
5986         when one is needed.
5987         (Entity_Hash): Removed.
5988         (Map_Types): New routine.
5989         (Replace_Object_And_Primitive_References): Removed.
5990         (Replace_References): New routine.
5991         (Replace_Type_References): Moved to the library level of Exp_Util.
5992         (Type_Map_Hash): New routine.
5993         (Update_Primitives_Mapping): Update the mapping call.
5994         (Update_Primitives_Mapping_Of_Types): Removed.
5995         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
5996         parameter For_Freeze and update the comment on usage.
5997         (Map_Types): New routine.
5998         (Replace_References): New routine.
5999         (Replace_Type_References): Moved to the library level of Exp_Util.
6000         (Update_Primitives_Mapping_Of_Types): Removed.
6001         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
6002         properties of the private type to the full view in case the full
6003         view derives from a parent type and inherits a DIC pragma.
6004         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
6005         DIC pragma is placed at the top of a declarative region.
6007 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
6009         * a-tasatt.adb: Complete previous change and use an unsigned
6010         int to avoid overflow checks.
6012 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6014         * sem_attr.adb (Analyze_Attribute, case 'Access): Specialize
6015         the error message when the attribute reference is an actual in
6016         a call to a subprogram inherited from a generic formal type with
6017         unknown discriminants, which makes the subprogram and its formal
6018         parameters intrinsic (see RM 6.3.1 (8) and (13)).
6020 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
6022         * sem_aggr.adb, inline.adb, einfo.adb, einfo.ads, scng.adb,
6023         sem_prag.adb: Minor reformatting.
6025 2017-04-25  Bob Duff  <duff@adacore.com>
6027         * sem_attr.adb (Type_Key): Add code in the
6028         recursive Compute_Type_Key to protect against fetching the source
6029         code for Standard, in case a component of the type is declared
6030         in Standard. There was already code to do this for the original
6031         type, but not for its components.
6033 2017-04-25  Javier Miranda  <miranda@adacore.com>
6035         * exp_ch3.adb (Build_Initialization_Call): Handle
6036         subtypes of private types when searching for the underlying full
6037         view of a private type.
6039 2017-04-25  Javier Miranda  <miranda@adacore.com>
6041         * sem_res.adb (Set_Mixed_Mode_Operand): A universal
6042         real conditional expression can appear in a fixed-type context
6043         and must be resolved with that context to facilitate the code
6044         generation to the backend.
6046 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6048         * einfo.adb, einfo.ads (Body_Needed_For_Inlining): New flag,
6049         to indicate whether during inline processing, when some unit U1
6050         appears in the context of a unit U2 compiled for instantiation
6051         or inlining purposes, the body of U1 needs to be compiled as well.
6052         * sem_prag.adb (Process_Inline): Set Body_Needed_For_Inlining if
6053         context is a package declaration.
6054         * sem_ch12.adb (Analyze_Generic_Subprogram_Declaration,
6055         Analyze_Generic_Package_Declaration): ditto.
6056         * inline.adb (Analyze_Inlined_Bodies): Check
6057         Body_Needed_For_Inlining.
6059 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6061         * par.adb (Current_Assign_Node): Global variable use to record
6062         the presence of a target_name in the right hand side of the
6063         assignment being parsed.
6064         * par-ch4.adb (P_Name): If the name is a target_name, mark the
6065         enclosing assignment node accordingly.
6066         * par-ch5.adb (P_Assignment_Statement): Set Current_Assign_Node
6067         appropriately.
6068         * sem_ch5.adb (Analyze_Assignment): Disable expansion before
6069         analyzing RHS if the statement has target_names.
6070         * sem_aggr.adb (Resolve_Iterated_Component_Association): Handle
6071         properly choices that are subtype marks.
6072         * exp_ch5.adb: Code cleanup.
6074 2017-04-25  Bob Duff  <duff@adacore.com>
6076         * s-memory.adb: Add a comment regarding efficiency.
6077         * atree.adb: Fix the assertion, and combine 2 assertions into one,
6078         "the source has an extension if and only if the destination does."
6079         * sem_ch3.adb, sem_ch13.adb: Address ??? comments.
6081 2017-04-25  Arnaud Charlet  <charlet@adacore.com trojanek>
6083         * a-tasatt.adb (Set_Value): Fix handling of 32bits -> 64bits
6084         conversion.
6086 2017-04-25  Doug Rupp  <rupp@adacore.com>
6088         * init.c (__gnat_error_handler) [vxworks]: Turn on sigtramp
6089         handling for ppc64-vx7.
6090         * sigtramp-vxworks-target.inc
6091         [SIGTRAMP_BODY]: Add section for ppc64-vx7.
6093 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
6095         * ada_get_targ.adb: New file.
6097 2017-04-25  Bob Duff  <duff@adacore.com>
6099         * uintp.adb (Most_Sig_2_Digits): In case Direct (Right), fetch
6100         Direct_Val (Right), instead of the incorrect Direct_Val (Left).
6101         (UI_GCD): Remove ??? comment involving possible efficiency
6102         improvements. This just isn't important after all these years.
6103         Also minor cleanup.
6104         * uintp.ads: Minor cleanup.
6106 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
6108         * exp_util.adb, exp_util.ads, sem_ch7.adb, sem_prag.adb, exp_ch3.adb:
6109         Revert previous changes.
6110         * scng.adb: Minor reformatting.
6111         * s-stratt.ads: Fix unbalanced parens in comment.
6113 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
6115         * sem_ch3.adb, exp_util.adb, sem_prag.adb, freeze.adb, sem_util.adb:
6116         Minor reformatting.
6118 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6120         * scng.adb (Scan): Handle '@' appropriately.
6121         * sem_ch5.adb: Code cleanup.
6123 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6125         * freeze.adb (Check_Expression_Function): Do not check for the
6126         use of deferred constants if the freezing of the expression
6127         function is triggered by its generated body, rather than a
6128         premature use.
6130 2017-04-25  Javier Miranda  <miranda@adacore.com>
6132         * exp_attr.adb (Rewrite_Stream_Proc_Call): Handle
6133         subtypes of private types when performing the view conversion.
6135 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
6137         * exp_ch3.adb (Freeze_Type): Signal the DIC body is created for
6138         the purposes of freezing.
6139         * exp_util.adb Update the documentation and structure of the
6140         type map used in class-wide semantics of assertion expressions.
6141         (Add_Inherited_Tagged_DIC): There is really no need to preanalyze
6142         and resolve the triaged expression because all substitutions
6143         refer to the proper entities.  Update the replacement of
6144         references.
6145         (Build_DIC_Procedure_Body): Add formal parameter
6146         For_Freeze. Add local variable Build_Body. Inherited DIC pragmas
6147         are now only processed when freezing occurs.  Build a body only
6148         when one is needed.
6149         (Entity_Hash): Removed.
6150         (Map_Types): New routine.
6151         (Replace_Object_And_Primitive_References): Removed.
6152         (Replace_References): New routine.
6153         (Replace_Type_References): Moved to the library level of Exp_Util.
6154         (Type_Map_Hash): New routine.
6155         (Update_Primitives_Mapping): Update the mapping call.
6156         (Update_Primitives_Mapping_Of_Types): Removed.
6157         * exp_util.ads (Build_DIC_Procedure_Body): Add formal
6158         parameter For_Freeze and update the comment on usage.
6159         (Map_Types): New routine.
6160         (Replace_References): New routine.
6161         (Replace_Type_References): Moved to the library level of Exp_Util.
6162         (Update_Primitives_Mapping_Of_Types): Removed.
6163         * sem_ch7.adb (Preserve_Full_Attributes): Propagate the DIC
6164         properties of the private type to the full view in case the full
6165         view derives from a parent type and inherits a DIC pragma.
6166         * sem_prag.adb (Analyze_Pragma): Guard against a case where a
6167         DIC pragma is placed at the top of a declarative region.
6169 2017-04-25  Tristan Gingold  <gingold@adacore.com>
6171         * s-mmap.ads (Data): Add pragma Inline.
6173 2017-04-25  Hristian Kirtchev  <kirtchev@adacore.com>
6175         * checks.adb (Insert_Valid_Check): Do not use
6176         a renaming to alias a volatile name because this will lead to
6177         multiple evaluations of the volatile name. Use a constant to
6178         capture the value instead.
6180 2017-04-25  Doug Rupp  <rupp@adacore.com>
6182         * init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
6184 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6186         * exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
6187         Add out parameter to indicate to caller that a wrapper must
6188         be constructed for an inherited primitive whose inherited
6189         pre/postcondition has called to overridden primitives.
6190         * freeze.adb (Check_Inherited_Conditions): Build wrapper body
6191         for inherited primitive that requires it.
6192         * sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
6193         legal primitive operations and belong to the list of bodies
6194         generated after the freeze point of a type.
6195         * sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
6196         of Build_Class_Wide_Expression.
6197         * sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
6198         to construct the specification of the wrapper subprogram created
6199         for an inherited operation.
6201 2017-04-25  Bob Duff  <duff@adacore.com>
6203         * s-osinte-linux.ads (pthread_mutexattr_setprotocol,
6204         pthread_mutexattr_setprioceiling): Add new interfaces for these
6205         pthread operations.
6206         * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB): Set
6207         protocols as appropriate for Locking_Policy 'C' and 'I'.
6208         * s-taprop-posix.adb: Minor reformatting to make it more similar
6209         to s-taprop-linux.adb.
6211 2017-04-25  Ed Schonberg  <schonberg@adacore.com>
6213         * sem_ch3.adb (Get_Discriminant_Value, Search_Derivation_Levels):
6214         Handle properly a multi- level derivation involving both renamed
6215         and constrained parent discriminants, when the type to be
6216         constrained has fewer discriminants that the ultimate ancestor.
6218 2017-04-25  Bob Duff  <duff@adacore.com>
6220         * sem_util.adb (Is_Object_Reference): In the
6221         case of N_Explicit_Dereference, return False if it came from a
6222         conditional expression.
6224 2017-04-25  Bob Duff  <duff@adacore.com>
6226         * par-ch4.adb (P_Case_Expression): If a semicolon
6227         is followed by "when", assume that ";" was meant to be ",".
6229 2017-04-25  Gary Dismukes  <dismukes@adacore.com>
6231         * sem_ch9.adb, sem_ch10.adb, sem_util.adb: Minor reformatting and typo
6232         fixes.
6234 2017-04-25  Arnaud Charlet  <charlet@adacore.com>
6236         * rtsfind.ads (SPARK_Implicit_Load): New procedure for forced
6237         loading of an entity.
6238         * rtsfind.adb (SPARK_Implicit_Load): Body with a pattern
6239         previously repeated in the analysis.
6240         * sem_ch9.adb (Analyze_Protected_Type_Declaration): use new
6241         procedure SPARK_Implicit_Load.  (Analyze_Task_Type_Declaration):
6242         use new procedure SPARK_Implicit_Load.
6243         * sem_ch10.adb (Analyze_Compilation_Unit): Use new procedure
6244         SPARK_Implicit_Load.
6246 2017-04-25  Javier Miranda  <miranda@adacore.com>
6248         * sem_util.adb (New_Copy_Tree): By default
6249         copying of defining identifiers is prohibited because
6250         this would introduce an entirely new entity into the
6251         tree. This patch introduces an exception to this general
6252         rule: the declaration of constants and variables located in
6253         Expression_With_Action nodes.
6254         (Copy_Itype_With_Replacement): Renamed as Copy_Entity_With_Replacement.
6255         (In_Map): New subprogram.
6256         (Visit_Entity): New subprogram.
6257         (Visit_Node): Handle EWA_Level,
6258         EWA_Inner_Scope_Level, and take care of defining entities defined
6259         in Expression_With_Action nodes.
6261 2017-04-25  Thomas Quinot  <quinot@adacore.com>
6263         * exp_ch6.adb: minor comment edit.
6264         * sinfo.ads, sinfo.adb: New Null_Statement attribute for null
6265         procedure specifications that come from source.
6266         * par-ch6.adb (P_Subprogram, case of a null procedure): Set new
6267         Null_Statement attribute.
6268         * par_sco.adb (Traverse_Declarations_Or_Statements): For a null
6269         procedure, generate statement SCO for the generated NULL statement.
6270         * sem_ch6.adb (Analyze_Null_Procedure): Use null statement from
6271         parser, if available.
6273 2017-04-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
6275         * system-linux-s390.ads: Use Long_Integer'Size to define
6276         Memory_Size.
6278 2017-04-04  Eric Botcazou  <ebotcazou@adacore.com>
6280         * sem_ch3.adb (Build_Derived_Record_Type): Fix long line.
6282 2017-04-03  Jonathan Wakely  <jwakely@redhat.com>
6284         * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo.
6285         * g-socket.adb (To_Host_Entry): Fix typo in comment.
6286         * gnat_ugn.texi: Fix typo.
6287         * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment.
6288         * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment.
6289         * sem_ch3.adb (Build_Derived_Record_Type): Likewise.
6290         * sem_util.adb (Mark_Coextensions): Likewise.
6291         * sem_util.ads (Available_Full_View_Of_Component): Likewise.
6293 2017-03-28  Andreas Schwab  <schwab@suse.de>
6295         PR ada/80117
6296         * system-linux-aarch64-ilp32.ads: New file.
6297         * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS_COMMON): Rename
6298         from LIBGNAT_TARGET_PAIRS.
6299         (LIBGNAT_TARGET_PAIRS_32, LIBGNAT_TARGET_PAIRS_64): Define.
6300         (LIBGNAT_TARGET_PAIRS): Use LIBGNAT_TARGET_PAIRS_COMMON, and
6301         LIBGNAT_TARGET_PAIRS_64 or LIBGNAT_TARGET_PAIRS_32 for -mabi=lp64
6302         or -mabi=ilp32, resp.
6304 2017-03-14  James Cowgill  <James.Cowgill@imgtec.com>
6306         * s-osinte-linux.ads (struct_sigaction): Use correct type for sa_flags.
6308 2017-03-08  Thanassis Tsiodras  <ttsiodras@gmail.com>
6310         PR ada/79903
6311         * socket.c (__gnat_gethostbyaddr): Add missing test for __rtems__.
6313 2017-03-08  Eric Botcazou  <ebotcazou@adacore.com>
6315         PR ada/79945
6316         * system-linux-ppc.ads (Default_Bit_Order): Use Standard's setting.
6318         * system-linux-arm.ads (Default_Bit_Order): Likewise.
6319         * system-linux-mips.ads (Default_Bit_Order): Likewise.
6320         * system-linux-armeb.ads: Delete.
6321         * system-linux-mipsel.ads: Likewise.
6322         * gcc-interface/Makefile.in (MIPS/Linux): Adjust.
6323         (ARM/Linux): Likewise.
6325 2017-02-24  Jakub Jelinek  <jakub@redhat.com>
6327         PR c/79677
6328         * gcc-interface/misc.c (gnat_handle_option): Pass true to
6329         handle_generated_option GENERATED_P.
6331 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6333         * gcc-interface/decl.c (gnat_to_gnu_field): Do not remove the wrapper
6334         around a justified modular type if it doesn't have the same scalar
6335         storage order as the enclosing record type.
6337 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6339         * gcc-interface/trans.c (gnat_to_gnu): Do not apply special handling
6340         of boolean rvalues to function calls.
6342 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6344         * gcc-interface/utils.c (fold_bit_position): New function.
6345         (rest_of_record_type_compilation): Call it instead of bit_position to
6346         compute the field position and remove the call to remove_conversions.
6347         (compute_related_constant): Factor out the multiplication in both
6348         operands, if any, and streamline the final test.
6350 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6352         * gcc-interface/trans.c (return_value_ok_for_nrv_p): Add sanity check.
6354 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6356         * gcc-interface/decl.c: Include demangle.h.
6357         (is_cplusplus_method): Return again true for a primitive operation
6358         only if it is dispatching.  For a subprogram with an interface name,
6359         call the demangler to get the number of C++ parameters and compare it
6360         with the number of Ada parameters.
6362 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6364         * gcc-interface/trans.c (Handled_Sequence_Of_Statements_to_gnu): If
6365         there is no end label, put the location of the At_End procedure on
6366         the call to the procedure.
6368 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6370         * gcc-interface/misc.c (gnat_type_max_size): Try to return a meaningful
6371         value for array types with TYPE_INDEX_TYPE set on their domain type.
6372         * gcc-interface/utils.c (max_size): For operations and expressions, do
6373         not build a new node if the operands have not changed or are missing.
6375 2017-02-24  Eric Botcazou  <ebotcazou@adacore.com>
6377         * gcc-interface/utils.c (max_size) <tcc_expression>: Flip the second
6378         argument when recursing on TRUTH_NOT_EXPR.
6380 2017-02-12  John Marino  <gnugcc@marino.st>
6382         * system-freebsd-x86.ads: Rename into...
6383         * system-freebsd.ads: ...this.
6384         (Default_Bit_Order): Define using Standard'Default_Bit_Order.
6385         * gcc-interface/Makefile.in: Support aarch64-freebsd.
6386         (x86-64/FreeBSD): Adjust to above renaming.
6387         (i386/FreeBSD): Likewise.
6389 2017-02-09  Gerald Pfeifer  <gerald@pfeifer.com>
6391         * comperr.adb: Update FSF bug reporting URL.
6393 2017-02-01  Eric Botcazou  <ebotcazou@adacore.com>
6394             Jakub Jelinek  <jakub@redhat.com>
6396         PR ada/79309
6397         * adaint.c (__gnat_killprocesstree): Fix broken string handling.
6399 2017-01-25  Maxim Ostapenko  <m.ostapenko@samsung.com>
6401         PR lto/79061
6402         * gcc-interface/utils.c (get_global_context): Pass main_input_filename
6403         to build_translation_unit_decl.
6405 2017-01-23  Javier Miranda  <miranda@adacore.com>
6407         * sem_util.adb (New_Copy_Tree): Code cleanup:
6408         removal of the internal map (ie. variable Actual_Map, its
6409         associated local variables, and all the code handling it).
6410         * sem_ch9.adb (Analyze_Task_Type_Declaration): in GNATprove mode
6411         force loading of the System package when processing a task type.
6412         (Analyze_Protected_Type_Declaration): in GNATprove mode force
6413         loading of the System package when processing a protected type.
6414         * sem_ch10.adb (Analyze_Compilation_Unit): in GNATprove mode
6415         force loading of the System package when processing compilation
6416         unit with a main-like subprogram.
6417         * frontend.adb (Frontend): remove forced loading of the System
6418         package.
6420 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6422         * sem_prag.adb (Default_Initial_Condition): If the desired type
6423         declaration is a derived type declaration with discriminants,
6424         it is rewritten as a private type declaration.
6425         * sem_ch13.adb (Replace_Type_References_Generic,
6426         Visible_Component): A discriminated private type with descriminnts
6427         has components that must be rewritten as selected components
6428         if they appear as identifiers in an aspect expression such as
6429         a Default_Initial_Condition.
6430         * sem_util.adb (Defining_Entity): support N_Iterator_Specification
6431         nodes.
6433 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6435         * ghost.ads, ghost.adb (Is_Ignored_Ghost_Unit): New routine.
6436         * gnat1drv.adb Generate an empty object file for an ignored
6437         Ghost compilation unit.
6438         * inline.adb, sem_util.adb, sem_ch4.adb: Minor reformatting.
6440 2017-01-23  Yannick Moy  <moy@adacore.com>
6442         * sem_ch4.adb (Analyze_Indexed_Component_Form):
6443         Adapt to inlined prefix with string literal subtype.
6444         * inline.adb (Expand_Inlined_Call): Keep unchecked
6445         conversion inside inlined call when formal type is constrained.
6447 2017-01-23  Javier Miranda  <miranda@adacore.com>
6449         * sem_util.adb (New_Copy_Tree): Code cleanup:
6450         removal of global variables. All the global variables, global
6451         functions and tables of this subprogram are now declared locally.
6453 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
6455         * exp_strm.ads: Minor reformatting and typo fixes.
6457 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6459         * sem_aggr.adb, par_sco.adb, exp_util.adb, sem.adb, sem_ch4.adb,
6460         exp_aggr.adb: Minor reformatting.
6461         * g-diopit.adb: minor grammar/punctuation fix in comment.
6462         * g-byorma.ads: minor fix of unbalanced parens in comment.
6464 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6466         * par.adb: Update the documentation of component Labl.
6467         * par-ch6.adb (P_Return_Statement): Set the expected label of
6468         an extended return statement to Error.
6470 2017-01-23  Tristan Gingold  <gingold@adacore.com>
6472         * s-boustr.ads, s-boustr.adb (Is_Full): New function.
6474 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6476         * expander.adb: Handle N_Delta_Aggregate.
6478 2017-01-23  Javier Miranda  <miranda@adacore.com>
6480         * exp_ch6.adb (Expand_Call): Improve the code that
6481         checks if some formal of the called subprogram is a class-wide
6482         interface, to handle subtypes of class-wide interfaces.
6484 2017-01-23  Javier Miranda  <miranda@adacore.com>
6486         * checks.adb (Apply_Parameter_Aliasing_Checks):
6487         Remove side effects of the actuals before generating the overlap
6488         check.
6490 2017-01-23  Justin Squirek  <squirek@adacore.com>
6492         * exp_strm.ads, exp_strm.ads
6493         (Build_Record_Or_Elementary_Input_Function): Add an extra parameter so
6494         as to avoid getting the underlying type by default.
6495         * exp_attr.adb (Expand_N_Attribute_Reference): Remove use of
6496         underlying type in the Iiput and output attribute cases when
6497         building their respective functions.
6499 2017-01-23  Gary Dismukes  <dismukes@adacore.com>
6501         * scng.adb: Minor reformatting of error message.
6503 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6505         * sem_ch6.adb (Analyze_Expression_Function): Do not attempt
6506         to freeze the return type of an expression funxtion that is a
6507         completion, if the type is a limited view and the non-limited
6508         view is available.
6510 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6512         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): Recognize delta
6513         aggregate construct.
6514         (P_Record_Or_Array_Component_Association): An array aggregate
6515         can start with an Iterated_Component_Association.
6516         * scng.adb: Modify error message on improper use of @ in earlier
6517         versions of the language.
6518         * sinfo.ads: New node kind N_Delta_Aggregate.
6519         * sinfo.adb: An N_Delta_Aggregate has component associations and
6520         an expression.
6521         * sem_res.adb (Resolve): Call Resolve_Delta_Aggregate.
6522         * sem_aggr.ads, sem_aggr.adb (Resolve_Iterated_Component_Association):
6523         Create a new index for each one of the choices in the association,
6524         to prevent spurious homonyms in the scope.
6525         (Resolve_Delta_Aggregate): New.
6526         * sem.adb: An N_Delta_Aggregate is analyzed like an aggregate.
6527         * exp_util.adb (Insert_Actions): Take into account
6528         N_Delta_Aggregate.
6529         * exp_aggr.ads: New procedure Expand_N_Delta_Aggregate.
6530         * exp_aggr.adb: New procedure Expand_N_Delta_Aggregate,
6531         and local procedures Expand_Delta_Array_Aggregate and
6532         expand_Delta_Record_Aggregate.
6533         * sprint.adb: Handle N_Delta_Aggregate.
6535 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6537         * exp_ch11.adb (Expand_N_Exception_Declaration): Generate an
6538         empty name when the exception declaration is subject to pragma
6539         Discard_Names.
6540         (Null_String): New routine.
6542 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6544         * par-ch9.adb (P_Protected_Definition): Parse
6545         any optional and potentially illegal pragmas which appear in
6546         a protected operation declaration list.
6547         (P_Task_Items): Parse
6548         any optional and potentially illegal pragmas which appear in a
6549         task item list.
6551 2017-01-23  Pascal Obry  <obry@adacore.com>
6553         * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which
6554         is needed when a foreign thread call a Win32 API using a thread handle
6555         like GetThreadTimes() for example.
6557 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6559         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6560         allow an 'Address clause to be specified on a prefix of a
6561         class-wide type.
6563 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6565         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6566         attribute 'Valid is a renaming of the original expression when
6567         the expression denotes a name. For all other kinds of expression,
6568         use a constant to capture the value.
6569         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6570         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6572 2017-01-23  Justin Squirek  <squirek@adacore.com>
6574         * sem_eval.adb (Eval_Integer_Literal): Add special
6575         case to avoid optimizing out check if the literal appears in
6576         an if-expression.
6578 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6580         * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
6581         allow an 'Address clause to be specified on a prefix of a
6582         class-wide type.
6584 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6586         * checks.adb (Insert_Valid_Check): Ensure that the prefix of
6587         attribute 'Valid is a renaming of the original expression when
6588         the expression denotes a name. For all other kinds of expression,
6589         use a constant to capture the value.
6590         * exp_util.adb (Is_Name_Reference): Moved to Sem_Util.
6591         * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util.
6593 2017-01-23  Justin Squirek  <squirek@adacore.com>
6595         * sem_eval.adb (Eval_Integer_Literal): Add special
6596         case to avoid optimizing out check if the literal appears in
6597         an if-expression.
6599 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6601         * sem_ch4.adb (Try_Primitive_Operations,
6602         Is_Valid_First_Argument_Of): argument is valid if it is a derived
6603         type with unknown discriminants that matches its underlying
6604         record view.
6605         * exp_util.adb (Expand_Subtype_From_Expr): Do not expand
6606         expression if its type is derived from a limited type with
6607         unknown discriminants, because the expansion (which is a call)
6608         must be expanded in the enclosing context to add the proper build-
6609         in-place parameters to the call.
6610         * lib.ads, exp_ch9.adb: Minor fixes in comments.
6612 2017-01-23  Yannick Moy  <moy@adacore.com>
6614         * frontend.adb (Frontend): Do not load runtime
6615         unit for GNATprove when parsing failed.
6616         * exp_ch9.adb: minor removal of extra whitespace
6617         * exp_ch6.adb: minor typo in comment
6618         * sem_util.adb: Code cleanup.
6619         * exp_ch9.ads, par-ch2.adb: minor style fixes in whitespace and comment
6620         * a-ngcefu.adb: minor style fix in whitespace
6622 2017-01-23  Thomas Quinot  <quinot@adacore.com>
6624         * scos.ads: Document usage of 'd' as default SCO kind for
6625         declarations.
6626         * par_sco.adb (Traverse_Declarations_Or_Statements.
6627         Traverse_Degenerate_Subprogram): New supporting routine for expression
6628         functions and null procedures.
6629         (Traverse_Declarations_Or_Statements.Traverse_One): Add
6630         N_Expression_Function to the subprogram case; add required
6631         support for null procedures and expression functions.
6633 2017-01-23  Bob Duff  <duff@adacore.com>
6635         * namet.ads (Bounded_String): Decrease the size of type
6636         Bounded_String to avoid running out of stack space.
6637         * namet.ads (Append): Don't ignore buffer overflow; raise
6638         Program_Error instead.
6640 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6642         * exp_ch5.adb, freeze.adb, par-ch4.adb, scng.adb, sem_ch13.adb,
6643         sem_ch3.adb, sem_ch5.adb, sem_ch5.ads, sem_util.adb, sinfo.ads: Minor
6644         reformatting.
6645         * exp_ch9.adb: minor style fix in comment.
6647 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6649         * sem_ch4.adb (Analyze_Allocator): Handle properly a type derived
6650         for a limited record extension with unknown discriminants whose
6651         full view has no discriminants.
6653 2017-01-23  Yannick Moy  <moy@adacore.com>
6655         * exp_spark.adb: Alphabetize with clauses.
6657 2017-01-23  Yannick Moy  <moy@adacore.com>
6659         * sem_util.adb (Has_Enabled_Property): Treat
6660         protected objects and variables differently from other variables.
6662 2017-01-23  Thomas Quinot  <quinot@adacore.com>
6664         * sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order):
6665         Split original Ada 95 part off into new subprogram
6666         below. Call that subprogram (instead of proceeding with
6667         AI95-0133 behaviour) if debug switch -gnatd.p is in use.
6668         (Adjust_Record_For_Reverse_Bit_Order_Ada_95): ... new subprogram
6669         * debug.adb Document new switch -gnatd.p
6670         * freeze.adb (Freeze_Entity.Freeze_Record_Type): Do not adjust
6671         record for reverse bit order if an error has already been posted
6672         on the record type.  This avoids generating extraneous "info:"
6673         messages for illegal code.
6675 2017-01-23  Justin Squirek  <squirek@adacore.com>
6677         * sem_ch3.adb (Analyze_Declarations): Correct comments
6678         * freeze.adb (Find_Constant): Add detection of deferred constants
6679         so they are not incorrectly flagged as premature.
6681 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6683         * scans.ads: New token At_Sign. Remove '@' from list of illegal
6684         characters for future version of the language. '@' is legal name.
6685         * scng.ads, scng.adb (Scan):  Handle '@' appropriately.
6686         * scn.adb (Scan_Reserved_Identifier): An occurrence of '@'
6687         denotes a Target_Name.
6688         * par-ch4.adb (P_Name, P_Primary): Handle Target_Name.
6689         * sinfo.ads, sinfo.adb (N_Target_Name): New non-terminal node.
6690         (Has_Target_Names): New flag on N_Assignment_Statement, to
6691         indicate that RHS has occurrences of N_Target_Name.
6692         * sem.adb: Call Analyze_Target_Name.
6693         * sem_ch5.ads, sem_ch5.adb (Analyze_Target_Name): New subpogram.
6694         (urrent_LHS): Global variable that denotes LHS of assignment,
6695         used in the analysis of Target_Name nodes.
6696         * sem_res.adb (Resolve_Target_Name): New procedure.
6697         * exp_ch5.adb (Expand_Assign_With_Target_Names): (AI12-0125):
6698         N is an assignment statement whose RHS contains occurences of @
6699         that designate the value of the LHS of the assignment. If the
6700         LHS is side-effect free the target names can be replaced with
6701         a copy of the LHS; otherwise the semantics of the assignment
6702         is described in terms of a procedure with an in-out parameter,
6703         and expanded as such.
6704         (Expand_N_Assignment_Statement): Call
6705         Expand_Assign_With_Target_Names when needed.
6706         * exp_util.adb (Insert_Actions): Take into account N_Target_Name.
6707         * sprint.adb: Handle N_Target_Name.
6709 2017-01-23  Eric Botcazou  <ebotcazou@adacore.com>
6711         * checks.adb: Minor fix in comment.
6713 2017-01-23  Philippe Gil  <gil@adacore.com>
6715         * g-debpoo.adb (Do_Report) remove freed chunks from chunks
6716         count in Sort = Memory_Usage or Allocations_Count
6718 2017-01-23  Justin Squirek  <squirek@adacore.com>
6720         * sem_ch3.adb: Code cleanup.
6722 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6724         * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Move all global
6725         variables to the local variable section. Update the profile
6726         of various nested routine that previously had visibility
6727         of those globals. One the matching phase has completed,
6728         remove certain classes of clauses which are considered noise.
6729         (Check_Dependency_Clause): Properly detect a match between two
6730         'Result attributes. Update the various post-match cases to use
6731         Is_Already_Matched as this routine now automatically recognizes
6732         a previously matched 'Result attribute.
6733         (Is_Already_Matched): New routine.
6734         (Remove_Extra_Clauses): New routine.
6735         (Report_Extra_Clauses): Remove the detection of ... => null
6736         clauses as this is now done in Remove_Extra_Clauses.
6738 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6740         * sem_aggr.adb (Resolve_Array_Aggregate): In ASIS mode do not
6741         report on spurious overlaps between values involving a subtype
6742         with a static predicate, because the expansion of such a subtype
6743         into individual ranges in inhibited in ASIS mode.
6745 2017-01-23  Justin Squirek  <squirek@adacore.com>
6747         * sem_ch3.adb (Analyze_Declarations): Add detection
6748         of an edge case and delay freezing if it is present.
6750 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6752         * sem_ch3.adb, exp_spark.adb, exp_attr.adb, sem_ch9.adb, sem_prag.adb,
6753         sem_util.adb, sem_warn.adb, exp_ch3.adb: Minor reformatting.
6755 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6757         * freeze.adb (Freeze_Subprogram): Ensure that all anonymous
6758         access-to-subprogram types inherit the convention of the
6759         associated subprogram.  (Set_Profile_Convention): New routine.
6760         * sem_ch6.adb (Check_Conformance): Do not compare the conventions
6761         of the two entities directly, use Conventions_Match to account
6762         for anonymous access-to-subprogram and subprogram types.
6763         (Conventions_Match): New routine.
6765 2017-01-23  Claire Dross  <dross@adacore.com>
6767         * exp_spark.adb (Expand_SPARK_Attribute_Reference): For attributes
6768         which return Universal_Integer, force the overflow check flag for
6769         Length and Range_Length for types as big as Long_Long_Integer.
6771 2017-01-23  Claire Dross  <dross@adacore.com>
6773         * exp_spark.adb (Expand_SPARK_Attribute_Reference):  For
6774         attributes which return Universal_Integer, introduce a conversion
6775         to the expected type with the appropriate check flags set.
6776         * sem_res.adb (Resolve_Range): The higher bound can be in Typ's
6777         base type if the range is null. It may still be invalid if it
6778         is higher than the lower bound. This is checked later in the
6779         context in which the range appears.
6781 2017-01-23  Pierre-Marie de Rodat  <derodat@adacore.com>
6783         * scos.ads: Introduce a constant to represent ignored
6784         dependencies in SCO_Unit_Table_Entry.
6786 2017-01-23  Hristian Kirtchev  <kirtchev@adacore.com>
6788         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Remove extra
6789         spaces from error messages.
6791 2017-01-23  Ed Schonberg  <schonberg@adacore.com>
6793         * exp_ch3.adb (Check_Large_Modular_Array): New procedure,
6794         subsidiary to Expand_N_Object_ Declaration, to compute a guard on
6795         an object declaration for an array type with a modular index type
6796         with the size of Long_Long_Integer. Special processing is needed
6797         in this case to compute reliably the size of the object, and
6798         eventually  to raise Storage_Error, when wrap-around arithmetic
6799         might compute a meangingless size for the object.
6801 2017-01-23  Justin Squirek  <squirek@adacore.com>
6803         * a-wtenau.adb, par-endh.adb, sem_prag.adb,
6804         sem_type.adb: Code cleanups.
6806 2017-01-23  Bob Duff  <duff@adacore.com>
6808         * sem_res.adb (Resolve_Call): In the part of the code where
6809         it is deciding whether to turn the call into an indexed
6810         component, avoid doing so if the call is to an instance of
6811         Unchecked_Conversion. Otherwise, the compiler turns it into an
6812         indexed component, and resolution of that turns it back into a
6813         function call, and so on, resulting in infinite recursion.
6814         * sem_util.adb (Needs_One_Actual): If the first formal has a
6815         default, then return False.
6817 2017-01-21  Eric Botcazou  <ebotcazou@adacore.com>
6819         * sem_eval.adb (Compile_Time_Compare): Reinstate the expr+literal (etc)
6820         optimizations when the type is modular and the offsets are equal.
6822 2017-01-20  Thomas Quinot  <quinot@adacore.com>
6824         * sem_warn.adb (Warn_On_Useless_Assignment): Adjust wording of warning
6825         message.
6827 2017-01-20  Nicolas Roche  <roche@adacore.com>
6829         * terminals.c: Ignore failures on setpgid and tcsetpgrp commands.
6831 2017-01-20  Bob Duff  <duff@adacore.com>
6833         * sem_eval.adb (Compile_Time_Compare): Disable the expr+literal
6834         (etc) optimizations when the type is modular.
6836 2017-01-20  Yannick Moy  <moy@adacore.com>
6838         * sem_ch6.adb (Move_Pragmas): move some pragmas,
6839         but copy the SPARK_Mode pragma instead of moving it.
6840         (Build_Subprogram_Declaration): Ensure that the generated spec
6841         and original body share the same SPARK_Pragma aspect/pragma.
6842         * sem_util.adb, sem_util.ads (Copy_SPARK_Mode_Aspect): New
6843         procedure to copy SPARK_Mode aspect.
6845 2017-01-20  Bob Duff  <duff@adacore.com>
6847         * sem_ch3.adb (Analyze_Declarations): Disable Resolve_Aspects
6848         even in ASIS mode.
6849         * sem_ch13.adb (Resolve_Name): Enable setting the entity to
6850         Empty even in ASIS mode.
6852 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6854         * exp_ch9.adb: minor style fixes in comments.
6855         * sem_ch9.adb (Analyze_Delay_Relative): in GNATprove mode a delay
6856         relative statement introduces an implicit dependency on
6857         Ada.Real_Time.Clock_Time.
6858         * sem_util.adb: Minor reformatting.
6860 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6862         * sem_ch13.adb (Analyze_Aspect_Specifications): Aspect Alignment
6863         must be treated as delayed aspect even if the expression is
6864         a literal, because the aspect affects the freezing and the
6865         elaboration of the object to which it applies.
6867 2017-01-20  Tristan Gingold  <gingold@adacore.com>
6869         * s-osinte-vxworks.ads (Interrup_Range): New subtype.
6871 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6873         * lib-xref.adb (Generate_Reference): Do not warn about the
6874         presence of a pragma Unreferenced if the entity appears as the
6875         actual in a procedure call that does not come from source.
6877 2017-01-20  Pascal Obry  <obry@adacore.com>
6879         * expect.c, terminals.c: Fix some warnings about unused variables.
6880         * gsocket.h, adaint.c, adaint.h: Fix some more warnings in the C part
6881         of the runtime.
6883 2017-01-20  Bob Duff  <duff@adacore.com>
6885         * exp_attr.adb (Constrained): Apply an access check (check that
6886         the prefix is not null) when the prefix denotes an object of an
6887         access type; that is, when there is an implicit dereference.
6889 2017-01-20  Gary Dismukes  <dismukes@adacore.com>
6891         * s-rident.ads (constant Profile_Info): Remove
6892         No_Calendar from GNAT_Extended_Ravenscar restrictions.
6894 2017-01-20  Tristan Gingold  <gingold@adacore.com>
6896         *  s-maccod.ads: Add pragma No_Elaboration_Code_All
6898 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6900         * ghost.adb (Mark_Ghost_Clause): New routine.
6901         (Prune_Node): Do not prune compilation unit nodes.
6902         (Remove_Ignored_Ghost_Code): Prune the compilation unit node directly.
6903         This does not touch the node itself, but does prune all its fields.
6904         * ghost.ads (Mark_Ghost_Clause): New routine.
6905         * sem_ch8.adb (Analyze_Use_Package): Emit an error when a use
6906         package clause mentions Ghost and non-Ghost packages. Mark a
6907         use package clause as Ghost when it mentions a Ghost package.
6908         (Analyze_Use_Type): Emit an error when a use type clause mentions
6909         Ghost and non-Ghost types. Mark a use type clause as Ghost when
6910         it mentions a Ghost type.
6911         * sem_ch10.adb (Analyze_With_Clause): Mark a with clause as
6912         Ghost when it withs a Ghost unit.
6914 2017-01-20  Javier Miranda  <miranda@adacore.com>
6916         * sem_res.adb (Resolve_Call): If a function call
6917         returns a limited view of a type and at the point of the call the
6918         function is not declared in the extended main unit then replace
6919         it with the non-limited view, which must be available. If the
6920         called function is in the extended main unit then no action is
6921         needed since the back-end handles this case.
6923 2017-01-20  Eric Botcazou  <ebotcazou@adacore.com>
6925         * sem_ch7.adb (Contains_Subp_Or_Const_Refs): Rename into...
6926         (Contains_Subprograms_Refs): ...this.  Adjust comment
6927         for constants.  (Is_Subp_Or_Const_Ref): Rename into...
6928         (Is_Subprogram_Ref): ...this.
6929         (Has_Referencer): Rename Has_Non_Subp_Const_Referencer variable into
6930         Has_Non_Subprograms_Referencer and adjust comment.  Remove
6931         incorrect shortcut for package declarations and bodies.
6933 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6935         * sem_ch3.adb (Complete_Private_Subtype): If the scope of the
6936         base type differs from that of the completion and the private
6937         subtype is an itype (created for a constraint on an access
6938         type e.g.), set Delayed_Freeze on both to prevent out-of-scope
6939         anomalies in gigi.
6941 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6943         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
6944         When inheriting the SPARK_Mode of a prior expression function,
6945         look at the properly resolved entity rather than the initial
6946         candidate which may denote a homonym.
6948 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6950         * sem_prag.adb (Rewrite_Assertion_Kind): If the name is
6951         Precondition or Postcondition, and the context is pragma
6952         Check_Policy, indicate that this Pre-Ada2012 usage is deprecated
6953         and suggest the standard names Assertion_Policy /Pre /Post
6954         instead.
6956 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6958         * sem_ch10.adb, sem_cat.adb: Minor reformatting.
6960 2017-01-20  Javier Miranda  <miranda@adacore.com>
6962         * sem_ch3.adb (Access_Type_Declaration): Protect access to the
6963         Entity attribute.
6964         * sem_ch10.adb (Install_Siblings): Skip processing malformed trees.
6965         * sem_cat.adb (Validate_Categoriztion_Dependency): Skip processing
6966         malformed trees.
6968 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6970         * sem_ch13.adb (Analyze_Aspect_Specification, case
6971         Dynamic_Predicate): If the entity E is a subtype that inherits
6972         a static predicate for its parent P,, the inherited and the
6973         new predicate combine in the generated predicate function,
6974         and E only has a dynamic predicate.
6976 2017-01-20  Tristan Gingold  <gingold@adacore.com>
6978         * s-boustr.ads, s-boustr.adb: New package.
6979         * Makefile.rtl: Add s-boustr.
6981 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6983         * inline.adb (Process_Formals): Qualify the
6984         expression of a return statement when it yields a universal type.
6986 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
6988         * freeze.adb (Freeze_All): Freeze the default
6989         expressions of all eligible formal parameters that appear in
6990         entries, entry families, and protected subprograms.
6992 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
6994         * sem_ch3.adb (Check_Nonoverridable_Aspects); Refine check
6995         for illegal inherited Implicit_Dereference aspects with renamed
6996         discriminants.
6998 2017-01-20  Javier Miranda  <miranda@adacore.com>
7000         * debug.adb (switch d.6): do not avoid declaring unreferenced itypes.
7001         * nlists.ads (Lock_Lists, Unlock_Lists): New subprograms.
7002         * nlists.adb (Lock_Lists, Unlock_Lists): New subprograms.
7003         (Set_First, Set_Last, Set_List_Link, Set_Next, Set_Parent,
7004         Set_Prev, Tree_Read): Adding assertion.
7005         * atree.ads (Lock_Nodes, Unlock_Nodes): New subprograms.
7006         * atree.adb (Lock_Nodes, Unlock_Nodes): New subprograms.
7007         (Set_Analyzed, Set_Check_Actuals, Set_Comes_From_Source,
7008         Set_Ekind, Set_Error_Posted, Set_Has_Aspects,
7009         Set_Is_Ignored_Ghost_Node, Set_Original_Node, Set_Paren_Count,
7010         Set_Parent, Set_Sloc, Set_Nkind, Set_FieldNN, Set_NodeNN,
7011         Set_ListNN, Set_ElistNN, Set_NameN, Set_StrN, Set_UintNN,
7012         Set_UrealNN, Set_FlagNNN, Set_NodeN_With_Parent,
7013         Set_ListN_With_Parent): Adding assertion.
7015 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
7017         * sem_prag.adb (Process_Convention): Diagnose properly a pragma
7018         import that applies to several homograph subprograms. when one
7019         of them is declared by a subprogram body.
7021 2017-01-20  Justin Squirek  <squirek@adacore.com>
7023         * exp_ch6.adb (Expand_Call): Remove optimization
7024         that nulls out calls to null procedures.
7026 2017-01-20  Yannick Moy  <moy@adacore.com>
7028         * inline.adb (Expand_Inlined_Call): Keep more
7029         precise type of actual for inlining whenever possible. In
7030         particular, do not switch to the formal type in GNATprove mode in
7031         some case where the GNAT backend might require it for visibility.
7033 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
7035         * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited
7036         aspect Implicit_Dereference can be inherited by a full view if
7037         the partial view has no discriminants, because there is no way
7038         to apply the aspect to the partial view.
7039         (Build_Derived_Record_Type): If derived type renames discriminants
7040         of the parent, the new discriminant inherits the aspect from
7041         the old one.
7042         * sem_ch4.adb (Analyze_Call): Handle properly a parameterless
7043         call through an access discriminant designating a subprogram.
7044         * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle
7045         properly a parameterless call through an access discriminant on
7046         the left-hand side of an assignment.
7047         * sem_res.adb (resolve): If an interpreation involves a
7048         discriminant with an implicit dereference and the expression is an
7049         entity, resolution takes place later in the appropriate routine.
7050         * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize
7051         access discriminants that designate a subprogram type.
7053 2017-01-20  Pascal Obry  <obry@adacore.com>
7055         * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
7057 2017-01-20  Yannick Moy  <moy@adacore.com>
7059         * sem_ch10.adb (Check_No_Elab_Code_All): Do not issue an error
7060         on implicitly with'ed units in GNATprove mode.
7061         * sinfo.ads (Implicit_With): Document use of flag for implicitly
7062         with'ed units in GNATprove mode.
7064 2017-01-20  Ed Schonberg  <schonberg@adacore.com>
7066         * sem_cat.adb (Validate_Static_Object_Name): In a preelaborated
7067         unit Do not report an error on a non-static entity that appears
7068         in the context of a spec expression, such as an aspect expression.
7070 2017-01-20  Hristian Kirtchev  <kirtchev@adacore.com>
7072         * einfo.adb: Flag298 now denotes Is_Underlying_Full_View.
7073         (Is_Underlying_Full_View): New routine.
7074         (Set_Is_Underlying_Full_View): New routine.
7075         (Write_Entity_Flags): Add an entry for Is_Underlying_Full_View.
7076         * einfo.ads Add new attribute Is_Underlying_Full_View.
7077         (Is_Underlying_Full_View): New routine along with pragma Inline.
7078         (Set_Is_Underlying_Full_View): New routine along with pragma Inline.
7079         * exp_util.adb (Build_DIC_Procedure_Body): Do not consider
7080         class-wide types and underlying full views. The first subtype
7081         is used as the working type for all Itypes, not just array base types.
7082         (Build_DIC_Procedure_Declaration): Do not consider
7083         class-wide types and underlying full views. The first subtype
7084         is used as the working type for all Itypes, not just array
7085         base types.
7086         * freeze.adb (Freeze_Entity): Inherit the freeze node of a full
7087         view or an underlying full view without clobbering the attributes
7088         of a previous freeze node.
7089         (Inherit_Freeze_Node): New routine.
7090         * sem_ch3.adb (Build_Derived_Private_Type): Mark an underlying
7091         full view as such.
7092         (Build_Underlying_Full_View): Mark an underlying full view as such.
7093         * sem_ch7.adb (Install_Private_Declarations): Mark an underlying
7094         full view as such.
7096 2017-01-20  Yannick Moy  <moy@adacore.com>
7098         * sinfo.ads: Document lack of Do_Division_Check flag
7099         on float exponentiation.
7101 2017-01-19  Javier Miranda  <miranda@adacore.com>
7103         * ghost.adb (Propagate_Ignored_Ghost_Code): Protect access to the
7104         identifier attribute of a block-statement node. Required to avoid
7105         assertion failure when building the new containers library.
7107 2017-01-19  Bob Duff  <duff@adacore.com>
7109         * exp_ch3.adb: Update comment.
7111 2017-01-19  Vincent Celier  <celier@adacore.com>
7113         * gprep.adb (Gnatprep): Parse the definition file without
7114         "replace in comments" even when switch -C is used.
7116 2017-01-19  Justin Squirek  <squirek@adacore.com>
7118         * exp_ch9.adb (Is_Pure_Barrier): Create function
7119         Is_Count_Attribute to identify an expansion of the 'Count
7120         attribute.
7122 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7124         * sem_ch5.adb (Analyze_Loop_Statement): In GNATprove mode the
7125         statements within an element iterator loop are only analyzed
7126         agter the loop is rewritten. Within a generic the analysis must
7127         be performed in any case to complete name capture.
7129 2017-01-19  Bob Duff  <duff@adacore.com>
7131         * sem_prag.adb (Analyze_Pragma): Check for ignored pragmas first,
7132         before checking for unrecognized pragmas.
7133         Initialize Pname on its declarations; that's always good style.
7135 2017-01-19  Claire Dross  <dross@adacore.com>
7137         * exp_ch7.adb (Build_Invariant_Procedure_Body): Semi-insert the
7138         body into the tree for GNATprove by setting its Parent field. The
7139         components invariants of composite types are not checked by
7140         the composite type's invariant procedure in GNATprove mode.
7141         (Build_Invariant_Procedure_Declaration): Semi-insert the
7142         declaration into the tree for GNATprove by setting its Parent
7143         field.
7144         * freeze.adb (Freeze_Arry_Type):In GNATprove mode, do not add
7145         the component invariants to the array type  invariant procedure
7146         so that the procedure can be used to  check the array type
7147         invariants if any.
7148         (Freeze_Record_Type): In GNATprove mode, do
7149         not add the component invariants to the record type  invariant
7150         procedure so that the procedure can be used to  check the record
7151         type invariants if any.
7153 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
7155         * lib-xref-spark_specific.adb: Minor reformatting.
7156         * exp_ch7.adb (Add_Parent_Invariants): Do not process array types.
7158 2017-01-19  Javier Miranda  <miranda@adacore.com>
7160         * exp_aggr.adb (Pass_Aggregate_To_Back_End): Renamed as
7161         Build_Back_End_Aggregate.
7162         (Generate_Aggregate_For_Derived_Type): Code cleanup.
7163         (Prepend_Stored_Values): Code cleanup.
7165 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7167         * sem_ch6.adb (Analyze_Expression_Function): Check for an
7168         incomplete return type after attempting to freeze it, so that
7169         other freeze actiona are generated in the proper order.
7171 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7173         * sem_aggr.adb (Resolve_Aggregate): If the type is a string
7174         type, ie. a type whose component is a character type, and the
7175         aggregate is positional, do not convert into a string literal
7176         if the index type is not an integer type, because the original
7177         type may be required in an enclosing operation.
7179 2017-01-19  Bob Duff  <duff@adacore.com>
7181         * binde.adb, debug.adb: Enable new elaboration order algorithm
7182         by default. -dp switch reverts to the old algorithm.
7184 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
7186         * sem_ch3.adb Add with and use clauses for Exp_Ch7.
7187         (Analyze_Declarations): Create the DIC and Invariant
7188         procedure bodies s after all freezing has taken place.
7189         (Build_Assertion_Bodies): New routine.
7190         * sem_ch7.adb Remove the with and use clauses for Exp_Ch7
7191         and Exp_Util.
7192         (Analyze_Package_Specification): Remove the
7193         generation of the DIC and Invariant procedure bodies. This is
7194         now done by Analyze_Declarations.
7195         * sem_disp.adb (Check_Dispatching_Operation): DIC and Invariant
7196         procedures are never treated as primitives.
7198 2017-01-19  Yannick Moy  <moy@adacore.com>
7200         * frontend.adb: Analyze inlined bodies and check elaboration
7201         rules in GNATprove mode too.
7202         * sem_elab.adb (Delay_Element): Add Boolean component to save
7203         indication that call is in SPARK code.  (Check_Elab_Calls):
7204         Check elaboration rules in GNATprove mode, and correctly set
7205         the current value of SPARK_Mode.
7206         * lib-xref-spark_specific.adb
7207         (Add_SPARK_Xrefs): Simplify iteration over dereferences.
7209 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7211         * exp_ch4.adb (Expand_Concatenate): Do no enable overflow
7212         checks on the expression for the high bound of concatenation
7213         when checks are disabled, to suppress warnings about potential
7214         constraint errors in restricted runtimes.
7216 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
7218         * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the
7219         representation-to-position function as inlined.
7220         * sem_cat.adb (Set_Categorization_From_Scope): Do not modify
7221         the purity of an internally generated entity if it has been
7222         explicitly marked as pure for optimization purposes.
7223         * exp_aggr.adb: Minor reformatting.
7225 2017-01-19  Javier Miranda  <miranda@adacore.com>
7227         * exp_ch6.adb (Expand_Call): Remove side effects on
7228         actuals that are allocators with qualified expression since the
7229         initialization of the object is performed by means of individual
7230         statements (and hence it must be done before the call).
7232 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7234         * sem_ch3.adb (Analyze_Declarations): Minor reformatting.
7235         (Build_Derived_Enumeration_Type): If the derived type inherits a
7236         dynamic predicate from its parent, the bounds of the type must
7237         freeze because an explicit constraint is constructed for the
7238         type and the corresponding range is elaborated now.
7240 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
7242         * sem_attr.ads: minor fix of inconsistent casing in comment
7243         * lib-writ.ads: minor align comments in columns
7244         * sem_ch3.adb: Minor reformatting.
7245         * spark_xrefs.ads: minor fix typo in SPARK-related comment
7246         * table.ads: minor style fix in comment
7247         * lib-xref-spark_specific.adb
7248         (Add_SPARK_Xrefs): simplify processing of SPARK cross-references.
7249         * sem_ch12.adb: minor whitespace fix
7250         * freeze.adb: Add comment.
7251         * sem_util.adb (Unique_Name): for instances of
7252         generic subprograms ignore the name of the wrapper package.
7254 2017-01-19  Javier Miranda  <miranda@adacore.com>
7256         * exp_aggr.adb (Resolve_Record_Aggregate):
7257         Factorize code needed for aggregates of limited and unlimited
7258         types in a new routine.
7259         (Pass_Aggregate_To_Back_End): New subprogram.
7261 2017-01-19  Yannick Moy  <moy@adacore.com>
7263         * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map.
7265 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7267         * sem_ch4.ads, sem_ch4.adb (Try_Object_Operation): Make subprogram
7268         public, for use elsewhere.
7269         * sem_ch6.adb (Analyze_Procedure_Call): In SPARK_Mode and within
7270         an Inlined_body, recognize a call that uses object notation
7271         and has not been rewritten as a regular call because regular
7272         expansion has not taken place.
7274 2017-01-19  Bob Duff  <duff@adacore.com>
7276         * checks.adb (Apply_Type_Conversion_Checks): Disable small optimization
7277         in case of generic formal discrete types, because it causes crashes in
7278         the compiler when built with assertions on.
7280 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
7282         * lib-xref-spark_specific.adb, sem_util.adb, sem_util.ads,
7283         sem_ch4.adb, sem_ch8.adb, lib-xref.ads: Minor reformatting.
7285 2017-01-19  Bob Duff  <duff@adacore.com>
7287         * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking):
7288         Increment Warnings_Detected.  It was decrementing, which is
7289         wrong since we just issued a warning message.
7290         * binderr.ads (Errors_Detected, Warnings_Detected): Declare
7291         these variables to be of subtype Nat instead of Int, because
7292         they should never be negative.
7294 2017-01-19  Javier Miranda  <miranda@adacore.com>
7296         * contracts.adb (Build_Postconditions_Procedure): Replace
7297         Generate_C_Code by Modify_Tree_For_C.
7298         * exp_aggr.adb (Build_Record_Aggr_Code, Expand_Array_Aggregate):
7299         Replace Generate_C_Code by Modify_Tree_For_C.
7300         * exp_attr.adb (Float_Valid, Is_GCC_Target): Replace Generate_C_Code by
7301         Modify_Tree_For_C.
7302         * exp_ch11.adb (Expand_N_Exception_Declaration): Replace
7303         Generate_C_Code by Modify_Tree_For_C.
7304         * exp_ch4.adb (Expand_Allocator_Expression): Replace
7305         Generate_C_Code by Modify_Tree_For_C.
7306         * exp_dbug.adb (Qualify_Entity_Name): Replace Generate_C_Code
7307         by Modify_Tree_For_C.
7308         * exp_util.adb (Remove_Side_Effects, Side_Effect_Free): Replace
7309         Generate_C_Code by Modify_Tree_For_C.
7310         * sem_res.adb (Resolve_Type_Conversion): Replace Generate_C_Code
7311         by Modify_Tree_For_C.
7312         * sinfo.ads (Modify_Tree_For_C): Adding documentation.
7314 2017-01-19  Javier Miranda  <miranda@adacore.com>
7316         * sem_util.ads, sem_util.adb (Expression_Of_Expression_Function): New
7317         subprogram.
7318         (Is_Inlinable_Expression_Function): New subprogram.
7319         * exp_ch6.ads, exp_ch6.adb (Expression_Of_Expression_Function): Moved
7320         to Sem_Util.
7321         (Is_Inlinable_Expression_Function): Moved to Sem_Util.
7323 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7325         * sem_ch4.adb (Diagnose_Call): Improve error message when a
7326         selected component has a prefix that might be interpreted
7327         as a parameterless function call, but none of the candidate
7328         interpretations is parameterless, and there is a hidden homonym
7329         of the prefix that is a package.
7330         * sem_ch8.adb (Find_Selected_Component): If the prefix might be
7331         interpreted as a parameterless function call and its analysis
7332         fails, do not call Analyze_Selected_Component.
7334 2017-01-19  Steve Baird  <baird@adacore.com>
7336         * sem_util.ads: Add new Use_Full_View Boolean parameter to
7337         Get_Index_Bounds.
7338         * sem_util.adb (Get_Index_Bounds): replace calls to Scalar_Range with
7339         calls to a newly-defined Scalar_Range_Of_Right_View function.
7341 2017-01-19  Arnaud Charlet  <charlet@adacore.com>
7343         * gnat1drv.adb: minor fix of unbalanced parens in comment
7344         * lib-xref.ads (Traverse_Compilation_Unit): declaration moved
7345         to visible part of the package to allow re-use in GNATprove.
7346         * lib-xref-spark_specific.adb (Traverse_Stub): routine refactored
7347         from repeated code of Traverse_Compilation_Unit.
7348         (Traverse_Declaration_Or_Statement): fixed detection of
7349         generic subprograms and packages; also, iteration over case
7350         statement alternatives rewritten to avoid testing if the first
7351         alternative is present (since it must be present due to Ada
7352         syntax restrictions).
7354 2017-01-19  Hristian Kirtchev  <kirtchev@adacore.com>
7356         * exp_ch6.adb (Expand_N_Subprogram_Body): Mark the spec as
7357         returning by reference not just for subprogram body stubs,
7358         but for all subprogram cases.
7359         * sem_util.adb: Code reformatting.
7360         (Requires_Transient_Scope): Update the call to Results_Differ.
7361         (Results_Differ): Update the parameter profile and the associated
7362         comment on usage.
7364 2017-01-19  Ed Schonberg  <schonberg@adacore.com>
7366         * sem_dim.adb (Analyze_Dimension): Analyze object declaration and
7367         identifier nodes that do not come from source, to handle properly
7368         dimensionality check within an inlined body which inclddes both
7369         original operands and rewritten operands. This removes spurious
7370         dimensionality errors in the presence of front-end inlining,
7371         as well as in SPARK mode.
7373 2017-01-16  Jakub Jelinek  <jakub@redhat.com>
7375         PR driver/49726
7376         * gcc-interface/lang.opt (gant, gnatO, gnat): Add Driver flag.
7378 2017-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
7380         * gcc-interface/Makefile.in (SPARC/Solaris): Fix typo.
7382 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
7384         * doc/gnat_ugn/getting_started_with_gnat.rst,
7385         doc/gnat_ugn/inline_assembler.rst,
7386         doc/gnat_ugn/building_executable_programs_with_gnat.rst,
7387         doc/gnat_ugn/elaboration_order_handling_in_gnat.rst,
7388         doc/gnat_ugn/about_this_guide.rst,
7389         doc/gnat_ugn/platform_specific_information.rst,
7390         doc/gnat_ugn/example_of_binder_output.rst,
7391         doc/gnat_ugn/gnat_and_program_execution.rst,
7392         doc/gnat_ugn/gnat_utility_programs.rst,
7393         doc/gnat_ugn/the_gnat_compilation_model.rst,
7394         doc/gnat_rm/implementation_defined_attributes.rst,
7395         doc/gnat_rm/compatibility_and_porting_guide.rst,
7396         doc/gnat_rm/standard_library_routines.rst,
7397         doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
7398         doc/gnat_rm/implementation_defined_pragmas.rst,
7399         doc/gnat_rm/the_gnat_library.rst,
7400         doc/gnat_rm/obsolescent_features.rst,
7401         doc/gnat_rm/about_this_guide.rst,
7402         doc/gnat_rm/the_implementation_of_standard_i_o.rst,
7403         doc/gnat_rm/implementation_of_ada_2012_features.rst,
7404         doc/gnat_rm/interfacing_to_other_languages.rst,
7405         doc/gnat_rm/implementation_defined_aspects.rst,
7406         doc/gnat_rm.rst: Update documentation.
7407         * gnat_rm.texi, gnat_ugn.texi: Regenerated.
7409 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7411         * einfo.ads: minor grammar fixes in comment of Normalized_Position_Max.
7412         * scil_ll.adb: Minor style fix in comment.
7413         * sem_ch8.adb (Analyze_Expanded_Name): Perform dimension analysis
7414         even if entity is already set, because the node may be renalyzed
7415         after inlining transformations.
7417 2017-01-13  Javier Miranda  <miranda@adacore.com>
7419         * sem_res.adb (Resolve_Call): Do not establish a transient scope
7420         for a call to inlinable expression function (since the call will
7421         be replaced by its returned object).
7422         * exp_ch6.ads (Is_Inlinable_Expression_Function): New subprogram.
7423         * exp_ch6.adb (Expression_Of_Expression_Function): New subprogram.
7424         (Expand_Call): For inlinable expression function call replace the
7425         call by its returned object.
7426         (Is_Inlinable_Expression_Function): New subprogram.
7428 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7430         * checks.adb: Minor typo fix and reformatting.
7432 2017-01-13  Javier Miranda  <miranda@adacore.com>
7434         * contracts.adb (Contract_Only_Subprograms): Remove formal.
7435         (Copy_Original_Specification): Removed.
7436         (Skip_Contract_Only_Subprogram): Move here checks previously
7437         located in the caller of this routine (to leave the code more clean).
7438         (Build_Contract_Only_Subprogram): Code cleanup.
7439         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): Removed.
7440         (Get_Contract_Only_Missing_Body_Name): Removed.
7442 2017-01-13  Javier Miranda  <miranda@adacore.com>
7444         * sem_ch6.adb (Cloned_Expression): New subprogram.
7445         (Freeze_Expr_Types): Complete previous patch since the expression
7446         of an expression-function may have iterators and loops with
7447         defining identifiers which, as part of the preanalysis of the
7448         expression, may be left decorated with itypes that will not be
7449         available in the tree passed to the backend.
7451 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7453         * checks.adb (Apply_Type_Conversion_Checks): Optimize a type
7454         conversion to Integer of an expression that is an attribute
7455         reference 'Pos on an enumeration type.
7457 2017-01-13  Bob Duff  <duff@adacore.com>
7459         * atree.ads: Minor comment fix.
7461 2017-01-13  Justin Squirek  <squirek@adacore.com>
7463         * sem_ch6.adb (Check_Aggregate_Accessibility): Ignore function
7464         calls in accessibility check on return statement.
7466 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7468         * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
7469         Ensure that the input body is a subprogram body before trying to
7470         determine whether it denoted an expression function.  Note that
7471         subprogram body stubs cannot denote expression functions.
7473 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7475         * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
7476         and typo fixes.
7478 2017-01-13  Javier Miranda  <miranda@adacore.com>
7480         * einfo.ads (Component_Bit_Offset): Fix documentation.
7481         * sem_ch13.adb (Check_Record_Representation_Clause): Skip check
7482         on record holes for components with unknown compile-time offsets.
7484 2017-01-13  Bob Duff  <duff@adacore.com>
7486         * ali.ads, ali.adb (Static_Elaboration_Model_Used): Remove unused flag.
7487         * g-locfil.ads: Minor comment fix.
7489 2017-01-13  Bob Duff  <duff@adacore.com>
7491         * binde.adb (Elab_New): New elaboration order algorithm
7492         that is expected to cause fewer ABE issues. This is a work in
7493         progress. The new algorithm is currently disabled, and can be
7494         enable by the -dp switch, or by modifying the Do_Old and Do_New
7495         etc. flags and rebuilding. Experimental code is included to
7496         compare the results of the old and new algorithms.
7497         * binde.ads: Use GNAT.Dynamic_Tables instead of Table, so we
7498         can have multiple of these tables, so the old and new algorithms
7499         can coexist.
7500         * bindgen.ads (Gen_Output_File): Pass Elab_Order as an 'in'
7501         parameter of type array. This avoids the global variable, and
7502         allows bounds checking (which is normally defeated by the tables
7503         packages). It also ensures that the Elab_Order is read-only
7504         to Bindgen.
7505         * bindgen.adb: Pass Elab_Order as an 'in' parameter to all
7506         subprograms that need it, as above.
7507         * debug.adb: Document new -dp switch. Modify doc of old -do
7508         switch.
7509         * gnatbind.adb (Gnatbind): Make use of new interfaces to Binde
7510         and Bindgen.  Move writing of closure (-R and -Ra switches)
7511         to Binde; that's more convenient.
7513 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7515         * sem_ch6.adb (Analyze_Expression_Function): If the expression
7516         function is a completion, all entities referenced in the
7517         expression are frozen. As a consequence, a reference to an
7518         uncompleted private type from an enclosing scope is illegal.
7520 2017-01-13  Javier Miranda  <miranda@adacore.com>
7522         * sem_ch6.adb (Freeze_Expr_Types): New subprogram.
7523         (Analyze_Subprogram_Body_Helper): At the occurrence of an
7524         expression function declaration that is a completion, its
7525         expression causes freezing (AI12-0103).
7527 2017-01-13  Vadim Godunko  <godunko@adacore.com>
7529         * a-coinho-shared.adb: Fix memory leaks in Constant_Reference and
7530         Reference functions of Ada.Containers.Indefinite_Holders.
7532 2017-01-13  Bob Duff  <duff@adacore.com>
7534         * s-os_lib.ads: Minor comment fixes.
7536 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7538         * exp_ch3.adb (Default_Initialize_Object): Do not default
7539         initialize an object when it is of a task type and restriction
7540         No_Tasking is in effect because the initialization is obsolete.
7541         * exp_ch9.adb (Build_Master_Entity): Do not generate a master when
7542         restriction No_Tasking is in effect.
7543         (Build_Master_Renaming): Do not rename a master when restriction
7544         No_Tasking is in effect.
7546 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7548         * sem_aggr.adb (Resolve_Array_Aggregate): The code that verifies
7549         the legality of An others clause applies as well to a choice in
7550         an Iterated_component_ association.
7551         (Resolve_Iterated_Component_Association): An others choice
7552         is legal.
7553         * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): An
7554         Iterated_Component_Association is not static.
7556 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7558         * exp_ch3.adb (Freeze_Type): Mark the Ghost mode as set in case
7559         control is passed to the expresion handler before the new mode
7560         is set.
7561         * sem_ch12.adb (Analyze_Package_Instantiation,
7562         Analyze_Subprogram_Instantiation): Mark the Ghost mode as set
7563         in case control is passed to the expresion handler before the
7564         new mode is set.
7566 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7568         * sem_aggr.adb, sem_ch3.adb, inline.adb, sem_util.adb, exp_ch4.adb,
7569         exp_aggr.adb: Minor reformatting.
7571 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7573         * inline.adb: Minor reformatting and typo fix.
7575 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7577         * sem_util.ads, sem_util.adb (Choice_List): Move function here
7578         from sem_aggr.adb, for use elsewhere.
7579         * sem_ch3.adb (Analyze_Object_Declaration): Use Choice_List.
7580         * sem_aggr.adb (Resolve_Array_Aggregate): Remove
7581         Iterated_Component_Present.
7582         * exp_aggr.adb: Use Choice_List throughout, to handle
7583         Iterated_Component_Associations.
7584         (Gen_Loop): Generate proper loop for an
7585         Iterated_Component_Association: loop variable has the identifier
7586         of the original association. Generate a loop even for a single
7587         component choice, in order to make loop parameter visible in
7588         expression.
7589         (Flatten): An Iterated_Component_Association is not static.
7591 2017-01-13  Yannick Moy  <moy@adacore.com>
7593         * exp_ch4.adb (Expand_N_Op_Expon): Ensure that the value of
7594         float exponentiation for statically known small negative values
7595         is the reciprocal of the exponentiation for the opposite value
7596         of the exponent.
7597         * s-exnllf.adb (Exn_Float, Exn_Long_Float, Exn_Long_Long_Float):
7598         Ensure that the value of float exponentiation for negative values
7599         is the reciprocal of the exponentiation for the opposite value
7600         of the exponent.
7601         * inline.adb (Expand_Inlined_Call): Fix the count
7602         for the number of generated gotos.
7604 2017-01-13  Yannick Moy  <moy@adacore.com>
7606         * inline.adb: Code cleanup.
7607         * sem_util.adb (Is_OK_Volatile_Context): Add
7608         expression in delay statement as OK for volatile context.
7610 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7612         * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
7613         mode a choice that is a subtype with a static predicate is
7614         replaced by the values it covers. This transformation must not
7615         be performed in ASIS mode, to preserve the source for analysis.
7617 2017-01-13  Justin Squirek  <squirek@adacore.com>
7619         * nlists.ads: Correct minor typo.
7621 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7623         * sem_ch13.adb: Minor reformatting and typo fix.
7625 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7627         * par-ch4.adb (P_Aggregate_Or_Parent_Expr): An
7628         Iterated_Component_Association is a named association in an
7629         array aggregate.
7630         * sem_aggr.adb (Resolve_Iterated_Component_Association): New
7631         procedure, subsidiary of Resolve_Array_Aggregate, to analyze
7632         and resolve the discrete choices and the expression of the
7633         new construct.
7634         * sinfo.adb, sinfo.ads: In analogy with N_Component_Association,
7635         Loop_Actions and Box_Present are attributes of
7636         N_Iterated_Component_Association nodes. Box_Present is always
7637         False in this case.
7638         * sprint.adb (Sprint_Node): An Iterated_Component_Association
7639         has a Discrete_Choices list, as specified in the RM. A
7640         Component_Association for aggregate uses instead a Choices list.
7641         We have to live with this small inconsistency because the new
7642         construct also has a defining identifier, and there is no way
7643         to merge the two node structures.
7645 2017-01-13  Yannick Moy  <moy@adacore.com>
7647         * inline.adb (Remove_Aspects_And_Pragmas): Add Unused to the
7648         list of pragmas to remove.  Remove pragmas from the list of
7649         statements in the body to inline.
7650         * namet.adb, namet.ads (Nam_In): New version with 12 parameters.
7652 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7654         * sem_ch3.adb (Resolve_Aspects): New procedure, subsidiary of
7655         Analyze_Declarations, to analyze and resolve the expressions of
7656         aspect specifications in the current declarative list, so that
7657         the expressions have proper entity and type info.  This is needed
7658         for ASIS when there is no subsequent expansion to generate this
7659         semantic information.
7660         * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): Use Etype of
7661         original expression, to suppress cascaded errors when expression
7662         has been constant-folded.
7663         (Resolve_Aspect_Expressions, Resolve_Name): Preserve entities in
7664         ASIS mode, because there is no subsequent expansion to decorate
7665         the tree.
7667 2017-01-13  Yannick Moy  <moy@adacore.com>
7669         * inline.adb, inline.ads (Call_Can_Be_Inlined_In_GNATprove_Mode):
7670         New function to detect when a call may be inlined or not in
7671         GNATprove mode.
7672         (Expand_Inlined_Call): Ensure that a temporary
7673         is always created in the cases where a type conversion may be
7674         needed on an input parameter in GNATprove mode, so that GNATprove
7675         sees the check to perform.
7676         * sem_res.adb (Resolve_Call): In GNATprove mode, skip inlining
7677         when not applicable due to actual requiring type conversion
7678         with possible check but no temporary value can be copied for
7679         GNATprove to see the check.
7681 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7683         * sem_aggr.adb, par_sco.adb, s-osprim-mingw.adb, exp_ch5.adb,
7684         exp_prag.adb, sem_ch3.adb, xr_tabls.adb, lib-xref-spark_specific.adb,
7685         layout.adb, sem_dist.adb, exp_spark.adb, exp_ch7.adb, gnatcmd.adb,
7686         exp_util.adb, prj-proc.adb, sem_aux.adb, comperr.adb, g-memdum.adb,
7687         exp_attr.adb, s-intman-solaris.adb, exp_ch9.adb, make.adb, live.adb,
7688         g-sercom-linux.adb, sem_dim.adb, mlib-prj.adb, s-intman-posix.adb,
7689         sem_ch9.adb, sem_ch10.adb, prep.adb, einfo.adb, scng.adb, checks.adb,
7690         prj-strt.adb, sem_prag.adb, eval_fat.adb, sem_ch12.adb, sem.adb,
7691         a-numaux-x86.adb, a-stwifi.adb, i-cobol.adb, prj.adb,
7692         get_spark_xrefs.adb, s-tasini.adb, rtsfind.adb, freeze.adb,
7693         g-arrspl.adb, par-ch4.adb, sem_util.adb, sem_res.adb, expander.adb,
7694         sem_attr.adb, exp_dbug.adb, prj-pp.adb, a-stzfix.adb, s-interr.adb,
7695         s-wchcnv.adb, switch-m.adb, gnat1drv.adb, sinput-l.adb, stylesw.adb,
7696         contracts.adb, s-intman-android.adb, g-expect.adb, exp_ch4.adb,
7697         g-comlin.adb, errout.adb, sinput.adb, s-exctra.adb, repinfo.adb,
7698         g-spipat.adb, g-debpoo.adb, exp_ch6.adb, sem_ch4.adb, exp_ch13.adb,
7699         a-wtedit.adb, validsw.adb, pprint.adb, widechar.adb, makeutl.adb,
7700         ali.adb, set_targ.adb, sem_mech.adb, sem_ch6.adb, gnatdll.adb,
7701         get_scos.adb, g-pehage.adb, s-tratas-default.adb, gnatbind.adb,
7702         prj-dect.adb, g-socthi-mingw.adb, par-prag.adb, prj-nmsc.adb,
7703         exp_disp.adb, par-ch12.adb, binde.adb, sem_ch8.adb,
7704         s-tfsetr-default.adb, s-regexp.adb, gprep.adb, s-tpobop.adb,
7705         a-teioed.adb, sem_warn.adb, sem_eval.adb, g-awk.adb, s-io.adb,
7706         a-ztedit.adb, xoscons.adb, exp_intr.adb, sem_cat.adb, sprint.adb,
7707         g-socket.adb, exp_dist.adb, sem_ch13.adb, s-tfsetr-vxworks.adb,
7708         par-ch3.adb, treepr.adb, g-forstr.adb, g-catiio.adb, par-ch5.adb,
7709         uname.adb, osint.adb, exp_ch3.adb, prj-env.adb, a-strfix.adb,
7710         a-stzsup.adb, prj-tree.adb, s-fileio.adb: Update all eligible case
7711         statements to reflect the new style for case alternatives. Various
7712         code clean up and reformatting.
7714 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7716         * exp_util.adb: Minor reformatting.
7718 2017-01-13  Yannick Moy  <moy@adacore.com>
7720         * exp_spark.adb: Code cleanup.
7721         * sem_ch9.adb (Analyze_Delay_Until): Resolve
7722         expression so that calls are identified as such inside delay
7723         until.
7725 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7727         * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association.
7728         * par-ch3.adb (P_Discrete_Choice_List): An
7729         Iterated_Component_Association is an array aggregate component.
7730         * par-ch4.adb (P_Iterated_Component_Association): New procedure.
7731         (Is_Quantified_Expression): New function that performs a lookahead
7732         to distinguish quantified expressions from iterated component
7733         associations.
7734         (P_Aggregate_Or_Paren_Expr): Recognize iterated component
7735         associations.
7736         (P_Unparen_Cond_Case_Quant_Expression, P_Primary): Ditto.
7737         * sem.adb (Analyze): Handle Iterated_Component_Association.
7738         * sem_aggr.adb (Resolve_Array_Aggregate): Dummy handling of iterated
7739         component associations.
7740         * sinfo.ads, sinfo.adb: Entries for for
7741         N_Iterated_Component_Association and its fields.
7742         * sprint.adb (Sprint_Node_Actual): Handle
7743         N_Iterated_Component_Association.
7745 2017-01-13  Justin Squirek  <squirek@adacore.com>
7747         * sem_ch12.adb (Analyze_Package_Instantiation): Move disabiling
7748         of the style check until after preanalysis of acutals.
7750 2017-01-13  Yannick Moy  <moy@adacore.com>
7752         * sem_ch13.adb: Minor reformatting.
7753         * par-ch11.adb: minor style fix in whitespace
7754         * gnatbind.adb (Gnatbind): Scope of Std_Lib_File
7755         reduced to Add_Artificial_ALI_File; style fix in declaration of
7756         Text; grammar fix in comment.
7757         * osint-c.adb (Read_Library_Info): strip trailing NUL from result.
7758         * freeze.adb: Cleanup to pass pragma instead of
7759         expression to call.
7760         * exp_spark.adb (Expand_SPARK_Attribute_Reference): New procedure to
7761         replace System'To_Address by equivalent call.
7763 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
7765         * bindusg.adb: Improve usage output for -f switch.
7767 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7769         * frontend.adb, freeze.adb, sem_res.adb, sem_attr.adb, sem_ch8.adb:
7770         Minor reformatting.
7772 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7774         * sem_ch13.adb (Is_Predicate_Static): Following the intent of the RM,
7775         treat comparisons on strings as legal in a Static_Predicate.
7776         (Is_Predicate_Static, Is_Type_Ref): Predicate also returns true on
7777         a function call that is the expansion of a string comparison.The
7778         function call is built when compiling the corresponding predicate
7779         function, but the expression has been found legal as a static
7780         predicate during earlier analysis.
7781         * sem_eval.adb (Real_Or_String_Static_Predicate_Matches): Handle
7782         properly a function call that is the expansion of a string
7783         comparison operation, in order to recover the Static_Predicate
7784         expression and apply it to a static argument when needed.
7786 2017-01-13  Tristan Gingold  <gingold@adacore.com>
7788         * s-mmap.adb, s-mmap.ads (Open_Read_No_Exception): New function.
7789         (Open_Read): Re-implement using Open_Read_No_Exception.
7790         (Open_Write): Raise exception in case of error.
7791         * s-mmosin-mingw.adb (Open_Common): Do not raise exception.
7792         * s-mmosin-unix.adb (Open_Read, Open_Write): Do not
7793         reaise exception.
7794         * s-mmosin-mingw.ads, s-mmosin-unix.ads (Open_Read): Adjust comment.
7796 2017-01-13  Yannick Moy  <moy@adacore.com>
7798         * checks.adb: Code cleanup.
7800 2017-01-13  Yannick Moy  <moy@adacore.com>
7802         * freeze.adb (Check_Inherited_Conditions): Use analyzed pragma
7803         expression instead of unanalyzed aspect expression for checking
7804         the validity of inheriting an operation. Also copy the expression
7805         being passing it to Build_Class_Wide_Expression, as this call
7806         modifies its argument.
7807         * sem_util.ads Fix comment to reference correct function name
7808         New_Copy_Tree.
7810 2017-01-13  Javier Miranda  <miranda@adacore.com>
7812         * sem_res.adb (Resolve_Generalized_Indexing): Compiling in ASIS mode,
7813         when we propagate information about the indexes back to the original
7814         indexing mode and the prefix of the index is a function call, do not
7815         remove any parameter from such call.
7817 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7819         * exp_ch6.ads (Needs_BIP_Finalization_Master): Update comment.
7820         * exp_ch6.adb (Needs_BIP_Finalization_Master): Return True for
7821         a build-in-place function whose result type is tagged.
7823 2017-01-13  Yannick Moy  <moy@adacore.com>
7825         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7826         Do not generate a wrapper when the only candidate is a class-wide
7827         subprogram.
7828         (Analyze_Subprogram_Renaming): Do not freeze the renaming or renamed
7829         inside a generic context.
7831 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7833         * exp_util.adb (Add_Inherited_Tagged_DIC):
7834         Pass the object parameters of both the parent and the derived
7835         type DIC procedure to the reference replacement circuitry.
7836         (Find_DIC_Type): Modify the circuitry to present the partial
7837         view of a private type in case the private type defines its own
7838         DIC pragma.
7839         (Replace_Object_And_Primitive_References): Add two
7840         optional formal parameters.  Update the comment on usage. Update
7841         the replacement of references to object parameters.
7843 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
7845         * einfo.adb, sem_ch6.adb, atree.adb: Minor reformatting and typo fix.
7847 2017-01-13  Ed Schonberg  <schonberg@adacore.com>
7849         * sem_res.adb (Resolve_Actuals): Apply Scalar_Range_Check to
7850         an out parameter that is a type conversion, independently of th
7851         range check that may apply to the expression of the conversion,
7852         for use in GNATProve.
7854 2017-01-13  Yannick Moy  <moy@adacore.com>
7856         * gnat1drv.adb (Gnat1drv): Move the implicit with for System in
7857         GNATprove_Mode here to Frontend.
7858         * frontend.adb (Frontend): Move the implicit with for System
7859         in GNATprove_Mode here as it ismore correct this way; the old
7860         place only worked by chance, since there were no overloaded names.
7861         * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_Tasking_State.
7862         * sem_attr.adb (Analyze_Attribute): In GNATprove_Mode, for the
7863         four attributes identified in SRM 9(18), add an implicit with
7864         to Ada.Task_Identification.
7865         * sem_ch8.adb (Analyze_Subprogram_Renaming.Build_Class_Wide_Wrapper):
7866         Deal specially with the wrapper introduced for AI05-0071 in GNATprove
7867         mode.
7868         * checks.adb (Apply_Discriminant_Check,
7869         Apply_Selected_Length_Checks, Apply_Selected_Range_Checks):
7870         In GNATprove mode, we do not apply the checks, but we still
7871         analyze the expression to possibly issue errors on SPARK
7872         code when a run-time error can be detected at compile time.
7873         (Selected_Length_Checks, Selected_Range_Checks): Perform analysis
7874         in GNATprove mode.
7876 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7878         * expander.adb (Expand): Add a warning about using return
7879         statements in Ghost management code.
7880         * exp_ch3.adb (Freeze_Type): Add a warning about using return
7881         statements in Ghost management code.
7882         * exp_ch7.adb (Build_Invariant_Procedure_Body,
7883         Build_Invariant_Procedure_Declaration): Add a warning about
7884         using return statements in Ghost management code.
7885         * exp_disp.adb (Make_DT): Add a warning about using return
7886         statements in Ghost management code.
7887         * exp_util.adb (Build_DIC_Procedure_Body,
7888         Build_DIC_Procedure_Declaration, Make_Predicated_Call): Add a
7889         warning about using return statements in Ghost management code.
7890         * freeze.adb (Freeze_Entity): Add a warning about using return
7891         statements in Ghost management code.
7892         * sem.adb (Analyze, Do_Analyze): Add a warning about using return
7893         statements in Ghost management code.
7894         * sem_ch3.adb (Analyze_Object_Declaration, Process_Full_View): Add
7895         a warning about using return statements in Ghost management code.
7896         * sem_ch5.adb (Analyze_Assignment): Add a warning about using
7897         return statements in Ghost management code.
7898         * sem_ch6.adb (Analyze_Procedure_Call,
7899         Analyze_Subprogram_Body_Helper): Add a warning about using return
7900         statements in Ghost management code.
7901         * sem_ch7.adb (Analyze_Package_Body_Helper): Add a warning about
7902         using return statements in Ghost management code.
7903         * sem_ch12.adb (Analyze_Package_Instantiation,
7904         Analyze_Subprogram_Instantiation, Instantiate_Package_Body,
7905         Instantiate_Subprogram_Body): Add a warning about using return
7906         statements in Ghost management code.
7907         * sem_ch13.adb (Build_Predicate_Functions,
7908         Build_Predicate_Function_Declarations): Add a warning about
7909         using return statements in Ghost management code.
7910         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part,
7911         Analyze_Initial_Condition_In_Decl_Part, Analyze_Pragma,
7912         Analyze_Pre_Post_Condition_In_Decl_Part):  Add a warning about
7913         using return statements in Ghost management code.
7915 2017-01-13  Tristan Gingold  <gingold@adacore.com>
7917         * s-mmosin-mingw.adb: Fix pragma import.
7919 2017-01-13  Arnaud Charlet  <charlet@adacore.com>
7921         * gnat1drv.adb (Adjust_Global_Switches): Ignore -gnateE in
7922         codepeer mode.
7924 2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
7926         * atree.adb (Allocate_Initialize_Node): A newly created node is
7927         no longer marked as Ghost at this level.
7928         (Mark_New_Ghost_Node): New routine.
7929         (New_Copy): Mark the copy as Ghost.
7930         (New_Entity): Mark the entity as Ghost.
7931         (New_Node): Mark the node as Ghost.
7932         * einfo.adb (Is_Checked_Ghost_Entity): This attribute can now
7933         apply to unanalyzed entities.
7934         (Is_Ignored_Ghost_Entity): This attribute can now apply to unanalyzed
7935         entities.
7936         (Set_Is_Checked_Ghost_Entity): This attribute now
7937         applies to all entities as well as unanalyzed entities.
7938         (Set_Is_Ignored_Ghost_Entity): This attribute now applies to
7939         all entities as well as unanalyzed entities.
7940         * expander.adb Add with and use clauses for Ghost.
7941         (Expand): Install and revert the Ghost region associated with the node
7942         being expanded.
7943         * exp_ch3.adb (Expand_Freeze_Array_Type): Remove all Ghost-related code.
7944         (Expand_Freeze_Class_Wide_Type): Remoe all Ghost-related code.
7945         (Expand_Freeze_Enumeration_Type): Remove all Ghost-related code.
7946         (Expand_Freeze_Record_Type): Remove all Ghost-related code.
7947         (Freeze_Type): Install and revert the Ghost region associated
7948         with the type being frozen.
7949         * exp_ch5.adb Remove with and use clauses for Ghost.
7950         (Expand_N_Assignment_Statement): Remove all Ghost-related code.
7951         * exp_ch6.adb Remove with and use clauses for Ghost.
7952         (Expand_N_Procedure_Call_Statement): Remove all Ghost-relatd code.
7953         (Expand_N_Subprogram_Body): Remove all Ghost-related code.
7954         * exp_ch7.adb (Build_Invariant_Procedure_Body): Install and revert the
7955         Ghost region of the working type.
7956         (Build_Invariant_Procedure_Declaration): Install and revert
7957         the Ghost region of the working type.
7958         (Expand_N_Package_Body): Remove all Ghost-related code.
7959         * exp_ch8.adb Remove with and use clauses for Ghost.
7960         (Expand_N_Exception_Renaming_Declaration): Remove all Ghost-related
7961         code.
7962         (Expand_N_Object_Renaming_Declaration): Remove all Ghost-related code.
7963         (Expand_N_Package_Renaming_Declaration): Remove all Ghost-related code.
7964         (Expand_N_Subprogram_Renaming_Declaration): Remove all Ghost-related
7965         code.
7966         * exp_ch13.adb Remove with and use clauses for Ghost.
7967         (Expand_N_Freeze_Entity): Remove all Ghost-related code.
7968         * exp_disp.adb (Make_DT): Install and revert the Ghost region of
7969         the tagged type. Move the generation of various entities within
7970         the Ghost region of the type.
7971         * exp_prag.adb Remove with and use clauses for Ghost.
7972         (Expand_Pragma_Check): Remove all Ghost-related code.
7973         (Expand_Pragma_Contract_Cases): Remove all Ghost-related code.
7974         (Expand_Pragma_Initial_Condition): Remove all Ghost-related code.
7975         (Expand_Pragma_Loop_Variant): Remove all Ghost-related code.
7976         * exp_util.adb (Build_DIC_Procedure_Body): Install
7977         and revert the Ghost region of the working types.
7978         (Build_DIC_Procedure_Declaration): Install and revert the
7979         Ghost region of the working type.
7980         (Make_Invariant_Call): Install and revert the Ghost region of the
7981         associated type.
7982         (Make_Predicate_Call): Reimplemented. Install and revert the
7983         Ghost region of the associated type.
7984         * freeze.adb (Freeze_Entity): Install and revert the Ghost region
7985         of the entity being frozen.
7986         (New_Freeze_Node): Removed.
7987         * ghost.adb Remove with and use clauses for Opt.
7988         (Check_Ghost_Completion): Update the parameter profile
7989         and all references to formal parameters.
7990         (Ghost_Entity): Update the comment on usage.
7991         (Install_Ghost_Mode): New routines.
7992         (Is_Ghost_Assignment): New routine.
7993         (Is_Ghost_Declaration): New routine.
7994         (Is_Ghost_Pragma): New routine.
7995         (Is_Ghost_Procedure_Call): New routine.
7996         (Is_Ghost_Renaming): Removed.
7997         (Is_OK_Declaration): Reimplemented.
7998         (Is_OK_Pragma): Reimplemented.
7999         (Is_OK_Statement): Reimplemented.
8000         (Is_Subject_To_Ghost): Update the comment on usage.
8001         (Mark_And_Set_Ghost_Assignment): New routine.
8002         (Mark_And_Set_Ghost_Body): New routine.
8003         (Mark_And_Set_Ghost_Completion): New routine.
8004         (Mark_And_Set_Ghost_Declaration): New routine.
8005         (Mark_And_Set_Ghost_Instantiation): New routine.
8006         (Mark_And_Set_Ghost_Procedure_Call): New routine.
8007         (Mark_Full_View_As_Ghost): Removed.
8008         (Mark_Ghost_Declaration_Or_Body): New routine.
8009         (Mark_Ghost_Pragma): New routine.
8010         (Mark_Ghost_Renaming): New routine.
8011         (Mark_Pragma_As_Ghost): Removed.
8012         (Mark_Renaming_As_Ghost): Removed.
8013         (Propagate_Ignored_Ghost_Code): Update the comment on usage.
8014         (Prune_Node): Freeze nodes no longer need special pruning, they
8015         are processed by the general ignored Ghost code mechanism.
8016         (Restore_Ghost_Mode): New routine.
8017         (Set_Ghost_Mode): Reimplemented.
8018         (Set_Ghost_Mode_From_Entity): Removed.
8019         * ghost.ads Add with and use clauses for Ghost.
8020         (Check_Ghost_Completion): Update the parameter profile
8021         along with the comment on usage.
8022         (Install_Ghost_Mode): New routine.
8023         (Is_Ghost_Assignment): New routine.
8024         (Is_Ghost_Declaration): New routine.
8025         (Is_Ghost_Pragma): New routine.
8026         (Is_Ghost_Procedure_Call): New routine.
8027         (Mark_And_Set_Ghost_Assignment): New routine.
8028         (Mark_And_Set_Ghost_Body): New routine.
8029         (Mark_And_Set_Ghost_Completion): New routine.
8030         (Mark_And_Set_Ghost_Declaration): New routine.
8031         (Mark_And_Set_Ghost_Instantiation): New routine.
8032         (Mark_And_Set_Ghost_Procedure_Call): New routine.
8033         (Mark_Full_View_As_Ghost): Removed.
8034         (Mark_Ghost_Pragma): New routine.
8035         (Mark_Ghost_Renaming): New routine.
8036         (Mark_Pragma_As_Ghost): Removed.
8037         (Mark_Renaming_As_Ghost): Removed.
8038         (Restore_Ghost_Mode): New routine.
8039         (Set_Ghost_Mode): Redefined.
8040         (Set_Ghost_Mode_From_Entity): Removed.
8041         * sem.adb (Analyze): Install and revert the Ghost region of the
8042         node being analyzed.
8043         (Do_Analyze): Change the way a clean Ghost
8044         region is installed and reverted.
8045         * sem_ch3.adb (Analyze_Full_Type_Declaration): Remove
8046         all Ghost-related code.
8047         (Analyze_Incomplete_Type_Decl): Remove all Ghost-related code.
8048         (Analyze_Number_Declaration): Remove all Ghost-related code.
8049         (Analyze_Object_Declaration): Install and revert the Ghost region of
8050         a deferred object declaration's completion.
8051         (Array_Type_Declaration): Remove all Ghost-related code.
8052         (Build_Derived_Type): Update the comment on
8053         the propagation of Ghost attributes from a parent to a derived type.
8054         (Derive_Subprogram): Remove all Ghost-related code.
8055         (Make_Class_Wide_Type): Remove all Ghost-related code.
8056         (Make_Implicit_Base): Remove all Ghost-related code.
8057         (Process_Full_View): Install and revert the Ghost region of
8058         the partial view.  There is no longer need to check the Ghost
8059         completion here.
8060         * sem_ch5.adb (Analyze_Assignment): Install and revert the Ghost
8061         region of the left hand side.
8062         * sem_ch6.adb (Analyze_Abstract_Subprogram_Declaration): Remove
8063         all Ghost-related code.
8064         (Analyze_Expression_Function): Remove all Ghost-related code.
8065         (Analyze_Generic_Subprogram_Body): Remove all Ghost-related code.
8066         (Analyze_Procedure_Call): Install and revert the Ghost region of
8067         the procedure being called.
8068         (Analyze_Subprogram_Body_Helper): Install and revert the Ghost
8069         region of the spec or body.
8070         (Analyze_Subprogram_Declaration): Remove all Ghost-related code.
8071         (Build_Subprogram_Declaration): Remove all Ghost-related code.
8072         (Find_Corresponding_Spec): Remove all Ghost-related code.
8073         (Process_Formals): Remove all Ghost-related code.
8074         * sem_ch7.adb (Analyze_Package_Body_Helper): Install and revert
8075         the Ghost region of the spec.
8076         (Analyze_Package_Declaration): Remove all Ghost-related code.
8077         * sem_ch8.adb (Analyze_Exception_Renaming): Mark a renaming as
8078         Ghost when it aliases a Ghost entity.
8079         (Analyze_Generic_Renaming): Mark a renaming as Ghost when it aliases
8080         a Ghost entity.
8081         (Analyze_Object_Renaming): Mark a renaming as Ghost when
8082         it aliases a Ghost entity.
8083         (Analyze_Package_Renaming): Mark a renaming as Ghost when it aliases
8084         a Ghost entity.
8085         (Analyze_Subprogram_Renaming): Mark a renaming as Ghost when it
8086         aliases a Ghost entity.
8087         * sem_ch11.adb Remove with and use clauses for Ghost.
8088         (Analyze_Exception_Declaration): Remove all Ghost-related code.
8089         * sem_ch12.adb (Analyze_Generic_Package_Declaration): Remove all
8090         Ghost-related code.
8091         (Analyze_Generic_Subprogram_Declaration): Remove all Ghost-related
8092         code.
8093         (Analyze_Package_Instantiation): Install and revert the Ghost region
8094         of the package instantiation.
8095         (Analyze_Subprogram_Instantiation): Install
8096         and revert the Ghost region of the subprogram instantiation.
8097         (Instantiate_Package_Body): Code clean up. Install and revert the
8098         Ghost region of the package body.
8099         (Instantiate_Subprogram_Body): Code clean up. Install and revert the
8100         Ghost region of the subprogram body.
8101         * sem_ch13.adb (Build_Predicate_Functions): Install
8102         and revert the Ghost region of the related type.
8103         (Build_Predicate_Function_Declaration): Code clean up. Install
8104         and rever the Ghost region of the related type.
8105         * sem_prag.adb (Analyze_Contract_Cases_In_Decl_Part):
8106         Install and revert the Ghost region of the pragma.
8107         (Analyze_Initial_Condition_In_Decl_Part): Install and revert the
8108         Ghost region of the pragma.
8109         (Analyze_Pragma): Install and revert the Ghost region of various
8110         pragmas.  Mark a pragma as Ghost when it is related to a Ghost entity
8111         or encloses a Ghost entity.
8112         (Analyze_Pre_Post_Condition): Install and revert the Ghost
8113         region of the pragma.
8114         (Analyze_Pre_Post_Condition_In_Decl_Part): Install and revert the
8115         Ghost region of the pragma.
8116         * sem_res.adb (Resolve): Remove all Ghost-related code.
8117         * sem_util.adb (Is_Declaration): Reimplemented.
8118         (Is_Declaration_Other_Than_Renaming): New routine.
8119         * sem_util.ads (Is_Declaration_Other_Than_Renaming): New routine.
8120         * sinfo.adb (Is_Checked_Ghost_Pragma): New routine.
8121         (Is_Ghost_Pragma): Removed.
8122         (Is_Ignored_Ghost_Pragma): New routine.
8123         (Set_Is_Checked_Ghost_Pragma): New routine.
8124         (Set_Is_Ghost_Pragma): Removed.
8125         (Set_Is_Ignored_Ghost_Pragma): New routine.
8126         * sinfo.ads: Update the documentation on Ghost mode and
8127         Ghost regions.  New attributes Is_Checked_Ghost_Pragma
8128         and Is_Ignored_Ghost_Pragma along with usages in nodes.
8129         Remove attribute Is_Ghost_Pragma along with usages in nodes.
8130         (Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
8131         (Is_Ghost_Pragma): Removed along with pragma Inline.
8132         (Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
8133         (Set_Is_Checked_Ghost_Pragma): New routine along with pragma Inline.
8134         (Set_Is_Ghost_Pragma): Removed along with pragma Inline.
8135         (Set_Is_Ignored_Ghost_Pragma): New routine along with pragma Inline.
8137 2017-01-12  Tristan Gingold  <gingold@adacore.com>
8139         * s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
8140         s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
8142 2017-01-12  Yannick Moy  <moy@adacore.com>
8144         * errout.adb, errout.ads (Initialize): Factor common treatment
8145         in Reset_Warnings.
8146         (Reset_Warnings): New procedure to reset counts related to warnings.
8147         (Record_Compilation_Errors): New variable to store the presence of an
8148         error, used in gnat2why to allow changing the Warning_Mode.
8149         (Compilation_Errors): Use new variable Record_Compilation_Errors to
8150         store the presence of an error.
8152 2017-01-12  Javier Miranda  <miranda@adacore.com>
8154         * sem_ch13.adb (Analyze_Aspect_Specifications):
8155         For Interrupt_Handler and Attach_ Handler aspects, decorate the
8156         internally built reference to the protected procedure as coming
8157         from sources and force its analysis.
8159 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
8161         * sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
8162         inherit predicates if any from the first_subtype of the parent,
8163         not from the anonymous parent type.
8164         * sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
8165         predicate is not a static subtype.
8167 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
8169         * freeze.adb (Check_Suspicious_Convention): New procedure
8170         performing a warning check on discriminated record types with
8171         convention C or C++. Factored out of procedure Freeze_Record_Type,
8172         and changed to only apply to base types (to avoid spurious
8173         warnings on subtypes). Minor improvement of warning messages
8174         to refer to discriminated rather than variant record types.
8175         (Freeze_Record_Type): Remove code for performing a suspicious
8176         convention check.
8177         (Freeze_Entity): Only call Freeze_Record_Type
8178         on types that aren't declared within any enclosing generic units
8179         (rather than just excluding the type when the innermost scope
8180         is generic). Call Check_Suspicious_Convention whether or not
8181         the type is declared within a generic unit.
8182         * sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
8183         * sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
8184         from Sem_Ch8).
8186 2017-01-12  Tristan Gingold  <gingold@adacore.com>
8188         * sysdep.c, adaint.c, rtinit.c, ming32.h:
8189         (__gnat_current_codepage): Renamed from CurrentCodePage
8190         (__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
8192 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
8194         * sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
8195         quantified expressions, following AI12-050: the loop parameters
8196         of two quantified expressions are conformant if they have the
8197         same identifier.
8199 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
8201         * gcc-interface/Makefile.in: Clean up VxWorks targets.
8203 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
8205         * sem_attr.adb (Analyze_Attribute_Reference, case Loop_Entry):
8206         Hnadle properly the attribute reference when it appears as part
8207         of an expression in another loop aspect.
8209 2017-01-12  Ed Schonberg  <schonberg@adacore.com>
8211         * exp_ch3.adb (Check_Predicated_Discriminant): New procedure,
8212         subsidiary of Build_Initialization_Call, to complete generation
8213         of predicate checks on discriminants whose (sub)types have
8214         predicates, and to add checks on variants that do not have an
8215         others clause.
8216         * sem_util.adb (Gather_Components): A missing Others alternative is
8217         not an error when the type of the discriminant is a static predicate
8218         (and coverage has been checked when analyzing the case statement). A
8219         runtime check is generated to verify that a given discriminant
8220         satisfies the predicate (RM 3.8.1. (21.1/2)).
8222 2017-01-12  Yannick Moy  <moy@adacore.com>
8224         * gnat1drv.adb (Adjust_Global_Switches): Only
8225         perform checking of exception mechanism when generating code.
8227 2017-01-12  Justin Squirek  <squirek@adacore.com>
8229         * exp_ch7.adb (Add_Type_Invariants, Process_Array_Component):
8230         Remove handling of access component with invariant.
8231         (Build_Invariant_Procedure_Declaration): Remove return on class
8232         wide type.
8233         * freeze.adb (Freeze_Array_Type, Freeze_Record_Type): Remove
8234         conditional exception for component or array so Has_Own_Invariants
8235         flag is not falsly set.
8236         * sem_ch3.adb (Make_Class_Wide_Type): Initialize copy of class
8237         wide type to have no invariant flags.
8239 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8241         * exp_ch9.adb, sem_prag.adb, s-tassta.adb, sem_util.adb, s-tarest.adb,
8242         sem_ch13.adb: Minor reformatting.
8244 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8246         * exp_aggr.adb (Build_Record_Aggr_Code): Guard against a missing
8247         adjustment primitive when the ancestor type was not properly frozen.
8248         (Gen_Assign): Guard against a missing initialization
8249         primitive when the component type was not properly frozen.
8250         (Initialize_Array_Component): Guard against a missing adjustment
8251         primitive when the component type was not properly frozen.
8252         (Initialize_Record_Component): Guard against a missing adjustment
8253         primitive when the component type was not properly frozen.
8254         (Process_Transient_Component_Completion): The transient object may
8255         not be finalized when its associated type was not properly frozen.
8256         * exp_ch3.adb (Build_Assignment): Guard against a missing
8257         adjustment primitive when the component type was not properly frozen.
8258         (Build_Initialization_Call): Guard against a missing
8259         initialization primitive when the associated type was not properly
8260         frozen.
8261         (Expand_N_Object_Declaration): Guard against a missing
8262         adjustment primitive when the base type was not properly frozen.
8263         (Predefined_Primitive_Bodies): Create an empty Deep_Adjust
8264         body when there is no adjustment primitive available. Create an
8265         empty Deep_Finalize body when there is no finalization primitive
8266         available.
8267         * exp_ch4.adb (Apply_Accessibility_Check): Guard against a
8268         missing finalization primitive when the designated type was
8269         not properly frozen.
8270         (Expand_N_Allocator): Guard against a missing initialization primitive
8271         when the designated type was not properly frozen.
8272         * exp_ch5.adb (Make_Tag_Ctrl_Assignment): Add the adjustment call
8273         only when the corresponding adjustment primitive is available.
8274         * exp_ch7.adb (Build_Adjust_Or_Finalize_Statements): Generate the
8275         adjustment/finalization statements only when there is an available
8276         primitive to carry out the action.
8277         (Build_Initialize_Statements): Generate the initialization/finalization
8278         statements only when there is an available primitive to carry out the
8279         action.
8280         (Make_Adjust_Call): Do not generate a call when the underlying
8281         type is not present due to a possible missing full view.
8282         (Make_Final_Call): Do not generate a call when the underlying
8283         type is not present due to a possible missing full view.
8284         (Make_Finalize_Address_Stmts): Generate an empty body when the
8285         designated type lacks a finalization primitive.
8286         (Make_Init_Call): Do not generate a call when the underlying type is
8287         not present due to a possible missing full view.
8288         (Process_Component_For_Adjust): Add the adjustment call only when the
8289         corresponding adjustment primitive is available.
8290         (Process_Component_For_Finalize): Add the finalization call only when
8291         the corresponding finalization primitive is available.
8292         (Process_Object_Declaration): Use a null statement to emulate a
8293         missing call to the finalization primitive of the object type.
8294         * exp_ch7.ads (Make_Adjust_Call): Update the comment on usage.
8295         (Make_Final_Call): Update the comment on usage.
8296         (Make_Init_Call): Update the comment on usage.
8297         * exp_util.adb (Build_Transient_Object_Statements): Code reformatting.
8299 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
8301         * einfo.ads: Update documentation of Address_Taken.
8302         * sem_attr.adb (Analyze_Access_Attribute, Resolve_Attribute
8303         [Access_Attribute]): Only consider 'Access/'Unchecked_Access
8304         for subprograms when setting Address_Taken flag.
8306 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
8308         * sem_ch10.adb (Analyze_With_Clause): Removed code that turned
8309         Configurable_Run_Time_Mode off when analysing with'ed predefined
8310         libraries.
8312 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
8314         * sem_prag.adb: Minor reformatting.
8315         * sem_util.adb (Unique_Entity): fix result for
8316         bodies of entry families.
8318 2017-01-12  Justin Squirek  <squirek@adacore.com>
8320         * sem_prag.adb (Analyze_Pragma): Add appropriate calls to
8321         Resolve_Suppressible in the pragma Assertion_Policy case.
8322         (Resolve_Suppressible): Created this function to factor out
8323         common code used to resolve Suppress to either Ignore or Check
8324         * snames.ads-tmpl: Add name for Suppressible.
8326 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
8328         * exp_ch9.adb, s-secsta.adb, snames.ads-tmpl, exp_ch3.adb: Minor
8329         reformatting.
8330         * debug.adb: Minor comment fixes.
8332 2017-01-12  Arnaud Charlet  <charlet@adacore.com>
8334         * sem_util.adb (Unique_Entity): For concurrent
8335         bodies that are defined with stubs and complete a declaration
8336         of a single concurrent object return the entity of an implicit
8337         concurrent type, not the entity of the anonymous concurrent
8338         object.
8339         * debug.adb: -gnatd.J is no longer used.
8340         * make.adb (Globalize): Removed, no longer used.
8341         * sem_ch9.adb: minor typo in comment for entry index
8343 2017-01-12  Patrick Bernardi  <bernardi@adacore.com>
8345         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8346         * exp_ch3.adb (Build_Init_Statements): As part of initialising
8347         the value record of a task, set its _Secondary_Stack_Size field
8348         if present.
8349         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8350         a _Secondary_Stack_Size field in the value record of
8351         the task if a Secondary_Stack_Size rep item is present.
8352         (Make_Task_Create_Call): Include secondary stack size
8353         parameter. If No_Secondary_Stack restriction is in place, passes
8354         stack size of 0.
8355         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8356         Secondary_Stack_Size.
8357         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8358         function to define the overhead of the secondary stack.
8359         * s-tarest.adb (Create_Restricted_Task,
8360         Create_Restricted_Task_Sequential): Functions now include
8361         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8362         * s-tarest.adb (Create_Restricted_Task,
8363         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB now
8364         include Secondary_Stack_Size parameter.
8365         (Task_Wrapper): Secondary stack now allocated to the size specified by
8366         the Secondary_Stack_Size parameter in the task's ATCB.
8367         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialize_ATCB): New
8368         Secondary_Stack_Size component.
8369         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8370         Create_Restricted_Task_Sequential): Function now include
8371         Secondary_Stack_Size parameter.
8372         (Task_Wrapper): Secondary stack now allocated to the size
8373         specified by the Secondary_Stack_Size parameter in the task's
8374         ATCB.
8375         * s-tproft.adb (Register_Foreign_Thread): Amended Initialize_ATCB call
8376         to include Secondary_Stack_Size parameter.
8377         * sem_ch13.adb (Analyze_Aspect_Specification): Add support for
8378         Secondary_Stack_Size aspect, turning the aspect into its corresponding
8379         internal attribute.
8380         (Analyze_Attribute_Definition): Process Secondary_Stack_Size attribute.
8381         * snames.adb-tmpl, snames.ads-tmpl: Added names
8382         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8383         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8385 2017-01-12  Yannick Moy  <moy@adacore.com>
8387         * exp_spark.adb (Expand_SPARK_Potential_Renaming): Fix sloc of copied
8388         subtree.
8390 2017-01-12  Justin Squirek  <squirek@adacore.com>
8392         * exp_attr.adb (Expand_N_Attribute_Reference):
8393         Fix Finalization_Size case by properly resolving the type after
8394         rewritting the node.
8396 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8398         * exp_util.adb (Build_DIC_Procedure_Body): Semi-insert the body into
8399         the tree.
8400         (Build_DIC_Procedure_Declaration): Semi-insert the body into the tree.
8401         * binde.adb, exp_ch5.adb, sem_type.adb, sem.ads, sem_res.adb,
8402         exp_sel.ads: Minor reformatting.
8404 2017-01-12  Justin Squirek  <squirek@adacore.com>
8406         * exp_ch6.adb (Expand_Call): Add guard to prevent
8407         invariant checks from being created for internally generated
8408         subprograms.
8410 2017-01-12  Bob Duff  <duff@adacore.com>
8412         * lib-writ.ads: Remove incorrect comment.
8414 2017-01-12  Javier Miranda  <miranda@adacore.com>
8416         * debug.adb (-gnatd.K): Enable generation of contract-only
8417         procedures in CodePeer mode.
8418         * contracts.adb (Build_And_Analyze_Contract_Only_Subprograms):
8419         New subprogram.
8420         (Analyze_Contracts): Generate contract-only procedures if -gnatdK is
8421         set.
8422         * scil_ll.ads, scil_ll.adb (Get_Contract_Only_Body_Name): New
8423         subprogram.
8424         (Get_Contract_Only_Missing_Body_Name): New subprogram.
8425         (Get_Contract_Only_Body): New subprogram.
8426         (Set_Contract_Only_Body): New subprogram.
8427         (Is_Contract_Only_Body): New subprogram.
8428         (Set_Is_Contract_Only_Body): New subprogram.
8429         (SCIL_Nodes): Replace table by hash-table.
8431 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8433         * exp_ch6.adb: Minor reformatting.
8434         * spark_xrefs.ads: minor cleanup of comments for SPARK xrefs
8436 2017-01-12  Bob Duff  <duff@adacore.com>
8438         * binde.adb (Forced): New reason for a dependence.
8439         (Force_Elab_Order): Implementation of the new switch.
8440         * binde.ads: Minor comment fixes.
8441         * bindusg.adb: Add -f switch. Apparently, there was an -f switch
8442         long ago that is no longer supported; removed comment about that.
8443         * opt.ads (Force_Elab_Order_File): Name of file specified for
8444         -f switch.
8445         * switch-b.adb: Parse -f switch.
8447 2017-01-12  Justin Squirek  <squirek@adacore.com>
8449         * exp_ch6.adb (Check_View_Conversion): Created this function
8450         to properly chain calls to check type invariants that may be
8451         present in a subprogram call after the subprogram.
8452         (Expand_Call): Add a conditional to identify when a view conversion
8453         needs to be checked.
8454         * nlists.adb, nlists.ads (Prepend_New): New routine.
8455         (Prepend_New_To): New routine.
8457 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8459         * sinfo.ads: Minor reformatting.
8461 2017-01-12  Gary Dismukes  <dismukes@adacore.com>
8463         * exp_util.adb, exp_util.ads, einfo.ads: Minor typo fixes and
8464         reformatting.
8466 2017-01-12  Hristian Kirtchev  <kirtchev@adacore.com>
8468         * exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Add new
8469         variable Definite. Create a local object and pass its 'Access to the
8470         BIP function when the result type is either definite or it does not
8471         require any finalization or secondary stack management.
8473 2017-01-12  Bob Duff  <duff@adacore.com>
8475         * contracts.adb, einfo.adb, errout.adb, exp_attr.adb,
8476         exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_prag.adb, freeze.adb,
8477         frontend.adb, ghost.adb, inline.adb, lib-writ.adb, lib-xref.adb,
8478         par.adb, par-ch10.adb, par-ch2.adb, par-prag.adb, par_sco.adb,
8479         sem_attr.adb, sem_aux.adb, sem_ch10.adb, sem_ch12.adb,
8480         sem_ch13.adb, sem_ch6.adb, sem_ch8.adb, sem_ch9.adb, sem_elab.adb,
8481         sem_prag.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8482         sem_warn.adb, sinfo.adb, sinfo.ads, sprint.adb (Pragma_Name):
8483         Change name to Pragma_Name_Unmapped.
8484         (Pragma_Name_Mapped): Change name to Pragma_Name.
8485         This is because the "mapped" version should be the usual case.
8487 2017-01-09  Hristian Kirtchev  <kirtchev@adacore.com>
8489         * einfo.ads, einfo.adb: Remove uses of flags Has_Default_Init_Cond,
8490         Is_Default_Init_Cond_Procedure, and
8491         Has_Inherited_Default_Init_Cond.  Add uses of flags
8492         Has_Own_DIC, Is_DIC_Procedure, and Has_Inherited_DIC.
8493         (Default_Init_Cond_Procedure): Removed.
8494         (DIC_Procedure): New routine.
8495         (Has_Default_Init_Cond): Removed.
8496         (Has_DIC): New routine.
8497         (Has_Inheritable_Invariants): The attribute applies to the base type.
8498         (Has_Inherited_Default_Init_Cond): Removed.
8499         (Has_Inherited_DIC): New routine.
8500         (Has_Inherited_Invariants): The attribute applies to the base type.
8501         (Has_Own_DIC): New routine.
8502         (Has_Own_Invariants): The attribute applies to the base type.
8503         (Is_Default_Init_Cond_Procedure): Removed.
8504         (Is_DIC_Procedure): New routine.
8505         (Set_Default_Init_Cond_Procedure): Removed.
8506         (Set_DIC_Procedure): New routine.
8507         (Set_Has_Default_Init_Cond): Removed.
8508         (Set_Has_Inheritable_Invariants): The attribute applies
8509         to the base type.
8510         (Set_Has_Inherited_Default_Init_Cond): Removed.
8511         (Set_Has_Inherited_DIC): New routine.
8512         (Set_Has_Inherited_Invariants): The attribute applies to the base type.
8513         (Set_Has_Own_DIC): New routine.
8514         (Set_Has_Own_Invariants): The attribute applies to the base type.
8515         (Set_Is_Default_Init_Cond_Procedure): Removed.
8516         (Set_Is_DIC_Procedure): New routine.
8517         (Write_Entity_Flags): Update the output of all flags related to
8518         default initial condition.
8519         * exp_ch3.adb (Expand_N_Object_Declaration): Update the generation
8520         of the call to the DIC procedure.
8521         (Freeze_Type): Generate the body of the DIC procedure.
8522         * exp_ch7.adb (Build_Invariant_Procedure_Body): Replace
8523         all occurrences of Create_Append with Append_New_To. Do
8524         not generate an invariant procedure for a class-wide type.
8525         The generated body acts as a freeze action of the working type.
8526         (Build_Invariant_Procedure_Declaration): Do not generate an
8527         invariant procedure for a class-wide type.
8528         (Create_Append): Removed.
8529         * exp_util.adb: Add with and use clauses for Sem_Ch3, sem_ch6,
8530         sem_Ch12, Sem_Disp, and GNAT.HTable. Move the handling of
8531         class-wide pre/postcondition description and data structures from
8532         Sem_Prag.
8533         (Build_Class_Wide_Expression): Moved from Sem_Prag.
8534         (Build_DIC_Call): New routine.
8535         (Build_DIC_Procedure_Body): New routine.
8536         (Build_DIC_Procedure_Declaration): New routine.
8537         (Entity_Hash): Moved from Sem_Prag.
8538         (Find_DIC_Type): New routine.
8539         (Update_Primitives_Mapping): Reimplemented.
8540         (Update_Primitives_Mapping_Of_Types): New routine.
8541         * exp_util.ads (Build_Class_Wide_Expression): Moved from Sem_Prag.
8542         (Build_DIC_Call): New routine.
8543         (Build_DIC_Procedure_Body): New routine.
8544         (Build_DIC_Procedure_Declaration): New routine.
8545         (Update_Primitives_Mapping): Moved from Sem_Prag.
8546         (Update_Primitives_Mapping_Of_Types): New routine.
8547         * nlists.adb (Append_New): New routine.
8548         (Append_New_To): New routine.
8549         * nlists.ads (Append_New): New routine.
8550         (Append_New_To): New routine.
8551         * sem_ch3.adb (Analyze_Declarations): Do not generate the bodies
8552         of DIC procedures here. This is now done at the end of the
8553         visible declarations, private declarations, and at the freeze
8554         point of a type.
8555         (Analyze_Private_Extension_Declaration):
8556         A private extension inherits the DIC pragma of a parent type.
8557         (Analyze_Subtype_Declaration): No need to propagate invariant
8558         attributes to a subtype as those apply to the base type.
8559         (Build_Derived_Record_Type): No need to inherit invariants here
8560         as this is now done in Build_Derived_Type.
8561         (Build_Derived_Type): Inherit both the DIC pragma and invariants from
8562         a parent type.
8563         (Process_Full_View): Update the propagation of DIC attributes.
8564         (Propagate_Default_Init_Cond_Attributes): Removed.
8565         * sem_ch7.adb Add with and use clauses for Exp_Util.
8566         (Analyze_Package_Specification): Create the body of the DIC
8567         procedure at the end of the visible and private declarations.
8568         (Preserve_Full_Attributes): Propagate DIC attributes.
8569         * sem_ch9.adb (Analyze_Protected_Type_Declaration): Propagate
8570         DIC attributes.
8571         (Analyze_Task_Type_Declaration): Propagate DIC attributes.
8572         * sem_elab.adb (Check_A_Call): Update the call to
8573         Is_Nontrivial_Default_Init_Cond_Procedure.
8574         * sem_prag.adb Remove the with and use clauses for
8575         GNAT.HTable. Move the handling of class- wide pre/postcondition
8576         description and data structures to Exp_Util.
8577         (Analyze_Pragma): Create the declaration of the DIC procedure. There
8578         is no need to propagate invariant-related attributes at this point
8579         as this is done in Build_Invariant_Procedure_Declaration.
8580         (Build_Class_Wide_Expression): Moved to Exp_Util.
8581         (Entity_Hash): Moved to Exp_Util.
8582         (Update_Primitives_Mapping): Moved to Exp_Util.
8583         * sem_prag.ads (Build_Class_Wide_Expression): Moved to Exp_Util.
8584         (Update_Primitives_Mapping): Moved to Exp_Util.
8585         * sem_util.adb: Remove with and use clauses for Ghost
8586         and Sem_Ch13.
8587         (Build_Default_Init_Cond_Call): Removed.
8588         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8589         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8590         (Get_Views): Reimplemented.
8591         (Has_Full_Default_Initialization): Reimplement the section on DIC.
8592         (Inherit_Default_Init_Cond_Procedure): Removed.
8593         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8594         (Is_Nontrivial_DIC_Procedure): New routine.
8595         (Is_Verifiable_DIC_Pragma): New routine.
8596         (Propagate_DIC_Attributes): New routine.
8597         * sem_util.ads (Build_Default_Init_Cond_Call): Removed.
8598         (Build_Default_Init_Cond_Procedure_Bodies): Removed.
8599         (Build_Default_Init_Cond_Procedure_Declaration): Removed.
8600         (Inherit_Default_Init_Cond_Procedure): Removed.
8601         (Is_Nontrivial_Default_Init_Cond_Procedure): Removed.
8602         (Is_Nontrivial_DIC_Procedure): New routine.
8603         (Is_Verifiable_DIC_Pragma): New routine.
8604         (Propagate_DIC_Attributes): New routine.
8605         * sem_warn.adb (Is_OK_Fully_Initialized): Reimplement the section
8606         on DIC.
8607         * sinfo.ads, sinfo.adb: Add new attribute Expression_Copy along with
8608         usage in nodes.
8609         (Expression_Copy): New routine along with pragma Inline.
8610         (Set_Expression_Copy): New routine along with pragma Inline.
8612 2017-01-06  Bob Duff  <duff@adacore.com>
8614         * bindgen.adb (Gen_Adainit, Gen_Adafinal): Change
8615         "Bind_Main_Program" to "not Bind_For_Library", because otherwise
8616         we won't generate the call to s_stalib_adafinal when the main
8617         is not written in Ada.
8619 2017-01-06  Bob Duff  <duff@adacore.com>
8621         * sem_prag.adb: Minor: remove pragma Warnings.
8623 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8625         * Makefile.rtl: Do not compile s-stchop by default.
8627 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
8629         * aspects.adb, aspects.ads, exp_ch3.adb, exp_ch9.adb, par-prag.adb,
8630         sem_ch13.adb, sem_prag.adb, sem_prag.ads, snames.adb-tmpl,
8631         snames.ads-tmpl, s-secsta.adb, s-secsta.ads, s-tarest.adb,
8632         s-tarest.ads, s-taskin.adb, s-taskin.ads, s-tassta.adb, s-tassta.ads:
8633         Reverted previous change for now.
8635 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8637         * exp_ch3.adb (Build_Initialization_Call): Apply predicate
8638         check to default discriminant value if checks are enabled.
8639         (Build_Assignment): If type of component has static predicate,
8640         apply check to its default value, if any.
8642 2017-01-06  Patrick Bernardi  <bernardi@adacore.com>
8644         * aspect.adb, aspect.ads: Added new aspect Secondary_Stack_Size.
8645         * exp_ch3.adb (Build_Init_Statements): As part of initialising
8646         the value record of a task, set its _Secondary_Stack_Size field
8647         if present.
8648         * exp_ch9.adb (Expand_N_Task_Type_Declaration): Create
8649         a _Secondary_Stack_Size field in the value record of
8650         the task if a Secondary_Stack_Size rep item is present.
8651         (Make_Task_Create_Call): Include secondary stack size
8652         parameter. If No_Secondary_Stack restriction is in place, passes
8653         stack size of 0.
8654         * par-prag.adb, sem_prag.adb, sem_prag.ads: Added new pragma
8655         Secondary_Stack_Size.
8656         * s-secsta.adb, s-secsta.ads (Minimum_Secondary_Stack_Size): New
8657         function to define the overhead of the secondary stack.
8658         * s-tarest.adb (Create_Restricted_Task,
8659         Create_Restricted_Task_Sequential): Functions now include
8660         Secondary_Stack_Size parameter to pass to Initialize_ATCB.
8661         * s-tarest.adb (Create_Restricted_Task,
8662         Create_Restricted_Task_Sequential): Calls to Initialize_ATCB
8663         now include Secondary_Stack_Size parameter.
8664         (Task_Wrapper):
8665         Secondary stack now allocated to the size specified by the
8666         Secondary_Stack_Size parameter in the task's ATCB.
8667         * s-taskin.adb, s-taskin.adb (Common_ATCB, Initialise_ATCB): New
8668         Secondary_Stack_Size component.
8669         * s-tassta.adb, s-tassta.ads (Create_Restricted_Task,
8670         Create_Restricted_Task_Sequential): Function now include
8671         Secondary_Stack_Size parameter.
8672         (Task_Wrapper): Secondary stack
8673         now allocated to the size specified by the Secondary_Stack_Size
8674         parameter in the task's ATCB.
8675         * sem_ch13.adb (Analyze_Aspect_Specification): Add support
8676         for Secondary_Stack_Size aspect, turning the aspect into its
8677         corresponding internal attribute.
8678         (Analyze_Attribute_Definition):
8679         Process Secondary_Stack_Size attribute.
8680         * snames.adb-tmpl, snames.ads-tmpl: Added names
8681         Name_Secondary_Stack_Size, Name_uSecondary_Stack_Size,
8682         Attribute_Secondary_Stack_Size and Pragma_Secondary_Stack_Size.
8684 2017-01-06  Pascal Obry  <obry@adacore.com>
8686         * a-direio.adb, a-direio.ads, a-sequio.adb, a-sequio.ads: Add Flush to
8687         Sequential_IO and Direct_IO.
8689 2017-01-06  Bob Duff  <duff@adacore.com>
8691         * snames.ads-tmpl (Renamed): New name for the pragma argument.
8692         * par-ch2.adb: Allow the new pragma (with analysis deferred
8693         to Sem_Prag).
8694         * sinfo.ads, sinfo.adb (Map_Pragma_Name, Pragma_Name_Mapped):
8695         Keep a mapping from new pragma names to old names.
8696         * sem_prag.adb: Check legality of pragma Rename_Pragma, and
8697         implement it by calling Map_Pragma_Name.
8698         * checks.adb, contracts.adb, einfo.adb, errout.adb,
8699         * exp_attr.adb, exp_ch3.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb,
8700         * exp_prag.adb, exp_util.adb, freeze.adb, frontend.adb, ghost.adb,
8701         * inline.adb, lib-writ.adb, scans.adb, scans.ads, sem_attr.adb,
8702         * sem_aux.adb, sem_ch10.adb, sem_ch13.adb, sem_ch6.adb, sem_ch9.adb,
8703         * sem_elab.adb, sem_res.adb, sem_util.adb, sem_util.ads,
8704         * sem_warn.adb: Call Pragma_Name_Mapped instead of Pragma_Name
8705         as appropriate.
8707 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
8709         * exp_ch9.adb: Minor reformatting.
8711 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8713         * exp_ch9.ads, exp_ch9.adb (Build_Entry_Names): Remove (unused).
8714         * rtsfind.ads (RE_Task_Entry_Names_Array, RO_ST_Set_Entry_Names)
8715         (RE_Protected_Entry_Names_Array, RO_PE_Set_Entry_Names): Remove
8716         (unused).
8717         * s-taskin.ads, s-taskin.adb (Set_Entry_Names,
8718         Task_Entry_Names_Array, Task_Entry_Names_Access): Remove.
8719         * s-tpoben.ads, s-tpoben.adb (Set_Entry_Names,
8720         Protected_Entry_Names_Array, Protected_Entry_Names_Access): Remove.
8722 2017-01-06  Bob Duff  <duff@adacore.com>
8724         * sinfo.ads, sinfo.adb (Map_Pragma_Name): Preparation work,
8725         dummy implementation of Map_Pragma_Name.
8727 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8729         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Make the
8730         entry_body variable constant.
8731         * s-taprob.ads (Entry_Body_Access): Move to s-tposen.
8732         * s-tpoben.ads (Protected_Entry_Body_Access): Now access
8733         to constant.
8734         * s-tposen.ads (Entry_Body_Access): Moved from s-taprob,
8735         now access to constant.
8737 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
8739         * einfo.ads, sem_res.adb, sem_attr.adb, sem_ch6.adb: Minor
8740         reformatting and typo fixes.
8742 2017-01-06  Bob Duff  <duff@adacore.com>
8744         * snames.ads-tmpl: New names for pragma renaming.
8745         * snames.adb-tmpl (Is_Configuration_Pragma_Name): Minor cleanup.
8746         * par-prag.adb: Add new pragma name to case statement.
8747         * sem_prag.adb (Rename_Pragma): Initial cut at semantic analysis
8748         of the pragma.
8749         * sinfo.ads, sinfo.adb (Pragma_Name_Mapped): Preparation work,
8750         Dummy implementation of Pragma_Name_Mapped.
8752 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8754         * exp_ch6.adb (Expand_Protected_Subprogram_Call): Add guard to
8755         better detect call within an entry_wrapper.
8756         * sem_res.adb (Resolve_Call): A protected call within an
8757         entity_wrapper is analyzed in the context of the protected
8758         object but corresponds to a pre-analysis and is not an access
8759         before elaboration.
8760         * sem_attr.adb: Minor reformatting.
8762 2017-01-06  Justin Squirek  <squirek@adacore.com>
8764         * sem_attr.adb (Analyze_Attribute): Modify semantic checks for
8765         Finalization_Size to allow a prefix of any non-class-wide type.
8766         * sem_attr.ads Modify comment for Finalization_Size to include
8767         definite type use case.
8769 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8771         * einfo.ads, einfo.adb (Is_Entry_Wrapper): New flag, defined
8772         on procedures that are wrappers created for entries that have
8773         preconditions.
8774         * sem_ch6.adb (Analyze_Subrogram_Body_Helper): If the subprogram
8775         body is an entry_wrapper, compile it in the context of the
8776         synchronized type, because a precondition may refer to funtions
8777         of the type.
8778         * exp_ch9.adb (Build_Contract_Wrapper): Set Is_Entry_Wrapper on
8779         body entity.
8780         * exp_ch6.adb (Expand_Protected_Subprogram_Call): if the call is
8781         within an Entry_Wrapper this is an external call whose target
8782         is the synchronized object that is the actual in the call to
8783         the wrapper.
8785 2017-01-06  Yannick Moy  <moy@adacore.com>
8787         * sem_attr.adb (Analyze_Attribute/Attribute_Loop_Entry): Analyze node
8788         in tree, which means not analyzing the previous prefix if the node has
8789         been rewritten into its prefix.
8791 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
8793         * s-tpobop.adb: Minor reformatting.
8795 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8797         * checks.adb (Ensure_Valid): Do not generate a validity check
8798         within a generated predicate function, validity checks will have
8799         been applied earlier when required.
8801 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8803         * s-tpoben.ads (Protection_Entries): Add comment and reorder
8804         components for performances.
8805         * s-tpobop.adb (PO_Do_Or_Queue): Implement Max_Queue_Length runtime
8806         semantic.
8808 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8810         * sem_eval.adb (Check_Expression_Against_Static_Predicate):
8811         If expression is compile-time known and obeys a static predicate
8812         it must be labelled as static, to prevent spurious warnings and
8813         run-time errors, e.g. in case statements. This is relevant when
8814         the expression is the result of constant-folding a type conversion
8815         whose expression is a variable with a known static value.
8817 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
8819         * exp_attr.adb, sem_attr.ads: Minor reformatting.
8821 2017-01-06  Justin Squirek  <squirek@adacore.com>
8823         * exp_attr.adb (Expand_N_Attribute_Reference): Add entry for
8824         expansion of Finalization_Size attribute.
8825         * sem_attr.adb (Analyze_Attribute): Add entry to check the
8826         semantics of Finalization_Size.
8827         (Eval_Attribute): Add null entry for Finalization_Size.
8828         * sem_attr.ads: Add Finalization_Size to the implementation
8829         dependent attribute list.
8830         * snames.ads-tmpl: Add name entry for Finalization_Size attribute.
8832 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8834         * sem_ch5.adb (Analyze_Loop_Statement): If the loop includes an
8835         iterator specification with a serious syntactic error, transform
8836         construct into an infinite loop in order to continue analysis
8837         and prevent a compiler abort.
8839 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8841         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Do not generate
8842         max_queue_lengths_array if unused.
8844 2017-01-06  Bob Duff  <duff@adacore.com>
8846         * errout.adb (Set_Msg_Text): Protect against out-of-bounds
8847         array access, in case "\" is at the end of Text.
8848         * stylesw.adb (Set_Style_Check_Options): Don't include input
8849         characters in the error message template, because they could
8850         be control characters such as "\", which Errout will try to
8851         interpret.
8853 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8855         * sem_ch4.adb (Find_Indexing_Operations, Inspect_Declarations):
8856         For a private type examine the visible declarations that follow
8857         the partial view, not just the private declarations that follow
8858         the full view.
8860 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
8862         * exp_ch5.adb, sem_ch3.adb, checks.adb: Minor reformatting and
8863         code cleanup.
8865 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
8867         * exp_ch5.adb (Get_Default_Iterator): For a derived type, the
8868         alias of the inherited op is the parent iterator, no need to
8869         examine dispatch table positions which might not be established
8870         yet if type is not frozen.
8871         * sem_disp.adb (Check_Controlling_Formals): The formal of a
8872         predicate function may be a subtype of a tagged type.
8873         * sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
8874         of representation items for the completion of a type extension
8875         where a predicate applies to the partial view.
8876         * checks.ads, checks.adb (Apply_Predicate_Check): Add optional
8877         parameter that designates function whose actual receives a
8878         predicate check, to improve warning message when the check will
8879         lead to infinite recursion.
8880         * sem_res.adb (Resolve_Actuals): Pass additional parameter to
8881         Apply_Predicate_Check.
8883 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8885         * s-rident.ads (Profile_Info): Remove No_Entry_Queue from
8886         Gnat_Extended_Ravenscar.
8887         * exp_ch9.adb, s-tpoben.adb, s-tpoben.ads: Fix spelling.
8889 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
8891         * sem_util.ads: Minor typo fix and reformatting.
8893 2017-01-06  Yannick Moy  <moy@adacore.com>
8895         * ghost.adb Minor fixing of references to SPARK RM.
8896         (Check_Ghost_Context): Check whether reference is to a lvalue
8897         before issuing an error about violation of SPARK RM 6.9(13)
8898         when declaration has Ghost policy Check and reference has Ghost
8899         policy Ignore.
8900         * sem_util.adb Minor indentation.
8901         * sem_ch10.adb (Analyze_Package_Body_Stub, Analyze_Protected_Body_Stub,
8902         Analyze_Task_Body_Stub): Set Ekind of the defining identifier.
8903         * sem_util.ads (Unique_Defining_Entity): Document the result
8904         for package body stubs.
8906 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8908         * raise-gcc.c (abort): Macro to call Abort_Propagation.
8909         * s-tpoben.ads (Protected_Entry_Queue_Max_Access): Make it access
8910         constant.
8911         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8912         Do not generate the Entry_Max_Queue_Lengths_Array if all default
8913         values.
8914         * exp_util.adb (Corresponding_Runtime_Package): Consider
8915         Max_Queue_Length pragma.
8917 2017-01-06  Justin Squirek  <squirek@adacore.com>
8919         * exp_ch9.adb (Expand_N_Protected_Type_Declaration):
8920         Remove declaration generation in the case of
8921         System_Tasking_Protected_Objects_Single_Entry being used,
8922         and add a warning message when this is detected to occur.
8923         (Make_Initialize_Protection): Remove reference pass in the case
8924         of System_Tasking_Protected_Objects_Single_Entry.
8925         * rtsfind.ads: Remove RE_Protected_Entry_Queue_Max
8926         * s-tposen.adb (Initialize_Protection_Entry): Remove
8927         Entry_Queue_Max parameter.
8928         * s-tposen.ads: Remove the types use to store the entry queue
8929         maximum.
8930         * sem_prag.adb (Analyze_Pragma): Remove entry families restriction
8932 2017-01-06  Yannick Moy  <moy@adacore.com>
8934         * sem_util.adb, sem_util.ads (Get_Enum_Lit_From_Pos): Strengthen
8935         behavior of function, to also accept out of range positions
8936         and raise Constraint_Error in such case, and to copy sloc from
8937         literal if No_Location passed as location.
8938         * uintp.adb, uintp.ads (UI_To_Int, UI_To_CC): Strengthen behavior
8939         of functions to raise Constraint_Error in case of value not in
8940         appropriate range.
8942 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8944         * sem_util.adb, s-taprop-linux.adb (Finalize_TCB): Remove call to
8945         Invalidate_Stack_Cache.
8947 2017-01-06  Eric Botcazou  <ebotcazou@adacore.com>
8949         * s-os_lib.adb: Minor fix to the signature of Readlink.
8951 2017-01-06  Javier Miranda  <miranda@adacore.com>
8953         * sem_ch6.adb (Conforming_Types): Handle another
8954         confusion between views in a nested instance with an actual
8955         private type whose full view is not in scope.
8957 2017-01-06  Arnaud Charlet  <charlet@adacore.com>
8959         * exp_ch5.adb (Expand_N_If_Statement): Obey existing comment and
8960         mark a rewritten if statement as explicit (Comes_From_Source).
8962 2017-01-06  Gary Dismukes  <dismukes@adacore.com>
8964         * sem_prag.adb, rtsfind.adb, sem_util.adb: Minor typo fixes.
8966 2017-01-06  Tristan Gingold  <gingold@adacore.com>
8968         * ada.ads, a-unccon.ads: Add pragma No_Elaboration_Code_All.
8970 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
8972         * sem_case.adb: Minor reformatting.
8974 2017-01-06  Thomas Quinot  <quinot@adacore.com>
8976         * g-socthi-mingw.adb: Remove now extraneous USE TYPE clause
8978 2017-01-06  Justin Squirek  <squirek@adacore.com>
8980         * aspects.adb: Register aspect in Canonical_Aspect.
8981         * aspects.ads: Associate qualities of Aspect_Max_Queue_Length
8982         into respective tables.
8983         * einfo.ads, einfo.adb: Add a new attribute for
8984         handling the parameters for Pragma_Max_Entry_Queue
8985         (Entry_Max_Queue_Lengths_Array) in E_Protected_Type. Subprograms
8986         for accessing and setting were added as well.
8987         * par-prag.adb (Prag): Register Pramga_Max_Entry_Queue.
8988         * exp_ch9.adb (Expand_N_Protected_Type_Declaration): Emit
8989         declaration for pramga arguments and store them in the protected
8990         type node.
8991         (Make_Initialize_Protection): Pass a reference to
8992         the Entry_Max_Queue_Lengths_Array in the protected type node to
8993         the runtime.
8994         * rtsfind.adb: Minor grammar fix.
8995         * rtsfind.ads: Register new types taken from the
8996         runtime libraries RE_Protected_Entry_Queue_Max and
8997         RE_Protected_Entry_Queue_Max_Array
8998         * s-tposen.adb, s-tpoben.adb
8999         (Initialize_Protection_Entry/Initialize_Protection_Entries):
9000         Add extra parameter and add assignment to local object.
9001         * s-tposen.ads, s-tpoben.ads: Add new types to
9002         store entry queue maximums and a field to the entry object record.
9003         * sem_ch13.adb (Analyze_Aspect_Specifications): Add case statement
9004         for Aspect_Max_Queue_Length.
9005         (Check_Aspect_At_Freeze_Point):
9006         Add aspect to list of aspects that don't require delayed analysis.
9007         * sem_prag.adb (Analyze_Pragma): Add case statement for
9008         Pragma_Max_Queue_Length, check semantics, and register arugments
9009         in the respective entry nodes.
9010         * sem_util.adb, sem_util.ads Add functions Get_Max_Queue_Length
9011         and Has_Max_Queue_Length
9012         * snames.ads-tmpl: Add constant for the new aspect-name
9013         Name_Max_Queue_Length and corrasponding pragma.
9015 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
9017         * exp_util.adb (Is_Controlled_Function_Call):
9018         Reimplemented. Consider any node which has an entity as the
9019         function call may appear in various ways.
9021 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
9023         * exp_attr.adb (Rewrite_Stream_Proc_Call): Use
9024         an unchecked type conversion when performing a view conversion
9025         to/from a private type. In all other cases use a regular type
9026         conversion to ensure that any relevant checks are properly
9027         installed.
9029 2017-01-06  Hristian Kirtchev  <kirtchev@adacore.com>
9031         * sem_prag.adb, sem_ch8.adb: Minor reformatting.
9033 2017-01-06  Ed Schonberg  <schonberg@adacore.com>
9035         * sem_case.adb (Explain_Non_Static_Bound): Suppress cascaded
9036         error on case expression that is an entity, when coverage is
9037         incomplete and entity has a static value obtained by local
9038         propagation.
9039         (Handle_Static_Predicate): New procedure, subsidiary of
9040         Check_Choices, to handle case alternatives that are either
9041         subtype names or subtype indications involving subtypes that
9042         have static predicates.
9044 2017-01-06  Thomas Quinot  <quinot@adacore.com>
9046         * s-oscons-tmplt.c, g-socket.adb, g-socket.ads, g-sothco.ads:
9047         (GNAT.Socket): Add support for Busy_Polling and Generic_Option
9049 2017-01-06  Bob Duff  <duff@adacore.com>
9051         * sem_elab.adb (Activate_Elaborate_All_Desirable): Don't add
9052         Elaborate_All(P) to P itself. That could happen in obscure cases,
9053         and always introduced a cycle (P body must be elaborated before
9054         P body).
9055         * lib-writ.ads: Comment clarification.
9056         * ali-util.ads: Minor comment fix.
9057         * ali.adb: Minor reformatting.
9059 2017-01-06  Tristan Gingold  <gingold@adacore.com>
9061         * a-exexpr-gcc.adb: Improve comment.
9063 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
9065         * s-linux-mips.ads: Use correct signal and errno constants.
9066         (sa_handler_pos, sa_mask_pos): Fix offsets for 64-bit MIPS.
9068 2017-01-03  James Cowgill  <James.Cowgill@imgtec.com>
9070         * s-linux-mips.ads: Rename from s-linux-mipsel.ads.
9071         * gcc-interface/Makefile.in (MIPS/Linux): Merge mips and mipsel
9072         sections.
9074 2017-01-01  Eric Botcazou  <ebotcazou@adacore.com>
9076         * gnatvsn.ads: Bump copyright year.
9078 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
9080         * gnat_ugn.texi: Bump @copying's copyright year.
9081         * gnat_rm.texi: Likewise.
9083 Copyright (C) 2017 Free Software Foundation, Inc.
9085 Copying and distribution of this file, with or without modification,
9086 are permitted in any medium without royalty provided the copyright
9087 notice and this notice are preserved.